Repository: diesel-rs/diesel (language: rust)

Issue:
begin_test_transaction behavior changed in Diesel 2.0
## Setup

### Versions

- **Rust:** 1.62.1
- **Diesel:** 2.0.0-rc.1
- **Database:** PG 11
- **Operating System** macOS 12.4

### Feature Flags

- **diesel:**  ["postgres", "r2d2", "chrono"]

## Problem Description

In my 1.4.8 diesel usage I had a connection customizer that set the begin_test_transaction

Which I injected into my "test-only" connection pool which has a max-size of 1.

Then in my tests I was able to grab the DB connection perform inserts, then drop the connection and pass the pool to the code being tested (e.g. API requests) and it would use the SAME Connection & transaction block.

### What are you trying to accomplish?

Happy testing with a single-connection pool.

### What is the expected output?

The tests to run correctly.

### What is the actual output?

The transaction is rolled back once the connection is returned to the pool and thus breaking the tests.  as the code being tests creates a new separate transaction.

### Are you seeing any additional errors?


### Steps to reproduce

Connection customizer to call begin_test_transaction

```rust
    #[derive(Debug, Clone, Copy)]
    struct TestConnectionCustomizer;

    impl<C, E> CustomizeConnection<C, E> for TestConnectionCustomizer
    where
        C: diesel::Connection,
    {
        fn on_acquire(&self, conn: &mut C) -> Result<(), E> {
            conn.begin_test_transaction()
                .expect("Failed to start test transaction");

            Ok(())
        }
    }
```

Sample test

```rust
#[tokio::test]
async fn my_test() {
    let pool  = test_pool();
    let mut db = pool.get().unwrap();
    let user = UserFactory::default().insert(&mut db);
    drop(db);

    let obj = ObjectToTest::new(&pool);
    obj.some_method(user.id);

    let mut db = pool.get().unwrap();
    let updated_user = users::table.filter(users::id.eq(user.id)).first(&mut db).unwrap();
    drop(db);

    assert_eq!(user.name, new_user.name);
}
```

This code works under Diesel 1.4.8 but does not in Diesel 2.0.0-rc.1

Here is raw SQL queries that were run

- Diesel 1.4.8

```
execute <unnamed>: SET TIME ZONE 'UTC'
execute <unnamed>: SET CLIENT_ENCODING TO 'UTF8'
statement: BEGIN
execute <unnamed>: SELECT 1
execute <unnamed>: INSERT INTO "users" ("name") VALUES ($1) RETURNING "users"."id", "users"."name", "users"."created_at", "users"."updated_at"
execute <unnamed>: SELECT 1
execute <unnamed>: UPDATE "users" SET "name" = $1 WHERE "users"."id" = $2 RETURNING "users"."id", "users"."name", "users"."created_at", "users"."updated_at"
execute <unnamed>: SELECT 1
execute __diesel_stmt_0: SELECT "users"."id", "users"."name", "users"."created_at", "users"."updated_at" FROM "users" WHERE "users"."id" = $1 LIMIT $2
-- implicit close & rollback
```

- Diesel 2.0.0-rc.1

```
execute <unnamed>: SET TIME ZONE 'UTC'
execute <unnamed>: SET CLIENT_ENCODING TO 'UTF8'
statement: BEGIN
execute <unnamed>: SELECT 1
execute <unnamed>: INSERT INTO "users" ("name") VALUES ($1) RETURNING "users"."id", "users"."name", "users"."created_at", "users"."updated_at"
-- implicit close & rollback
execute <unnamed>: SET TIME ZONE 'UTC'
execute <unnamed>: SET CLIENT_ENCODING TO 'UTF8'
statement: BEGIN
execute <unnamed>: SELECT 1
execute <unnamed>: UPDATE "users" SET "name" = $1 WHERE "users"."id" = $2 RETURNING "users"."id", "users"."name", "users"."created_at", "users"."updated_at"
-- implicit close & rollback
execute <unnamed>: SET TIME ZONE 'UTC'
execute <unnamed>: SET CLIENT_ENCODING TO 'UTF8'
statement: BEGIN
execute <unnamed>: SELECT 1
execute __diesel_stmt_0: SELECT "users"."id", "users"."name", "users"."created_at", "users"."updated_at" FROM "users" WHERE "users"."id" = $1 LIMIT $2
-- implicit close & rollback
```

## Checklist

- [x] I have already looked over the [issue tracker](https://github.com/diesel-rs/diesel/issues)  and the [disussion forum](https://github.com/diesel-rs/diesel/discussions)  for similar possible closed issues.
<!--
If you are unsure if your issue is a duplicate of an existing issue please link the issue in question here
--> 
- [x] This issue can be reproduced on Rust's stable channel. (Your issue will be
  closed if this is not the case)
- [x] This issue can be reproduced without requiring a third party crate



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/benches.yml b/.github/workflows/benches.yml
index b2959c011133..ea77542cc111 100644
--- a/.github/workflows/benches.yml
+++ b/.github/workflows/benches.yml
@@ -45,23 +45,13 @@ jobs:
           echo 'DATABASE_URL=mysql://root:root@localhost/diesel_test' >> $GITHUB_ENV
 
       - name: Install rust toolchain
-        uses: actions-rs/toolchain@v1
-        with:
-          profile: minimal
-          toolchain: stable
-          override: true
+        uses: dtolnay/rust-toolchain@stable
 
       - name: Install critcmp
-        uses: actions-rs/cargo@v1
-        with:
-          command: install
-          args: critcmp
+        run: cargo +stable install critcmp
 
       - name: Benchmark changes
-        uses: actions-rs/cargo@v1
-        with:
-          command: bench
-          args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}}" -- --save-baseline changes
+        run: cargo +stable bench --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}}" -- --save-baseline changes
 
       - name: Checkout master
         run: |
@@ -69,10 +59,7 @@ jobs:
           git reset --hard origin/master
 
       - name: Benchmark master
-        uses: actions-rs/cargo@v1
-        with:
-          command: bench
-          args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}}" -- --save-baseline master
+        run: cargo +stable bench --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}}" -- --save-baseline master
 
       - name: Critcmp
         run: |
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7ead1e69a92b..a497c98a63fd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -192,135 +192,109 @@ jobs:
           echo "MYSQLCLIENT_LIB_DIR=C:\tools\mysql\current\lib" >> $GITHUB_ENV
 
       - name: Install rust toolchain
-        uses: actions-rs/toolchain@v1
+        uses: dtolnay/rust-toolchain@master
         with:
-          profile: minimal
           toolchain: ${{ matrix.rust }}
-          override: true
+
       - name: Rust version check
-        uses: actions-rs/cargo@v1
-        with:
-          command: version
+        shell: bash
+        run: |
+          cargo +${{ matrix.rust }} --version
+          rustc +${{ matrix.rust }} --version
 
       - name: Test diesel (nightly)
         if: matrix.rust == 'nightly'
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel/Cargo.toml --no-default-features --features "${{ matrix.backend }} unstable extras i-implement-a-third-party-backend-and-opt-into-breaking-changes"
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel/Cargo.toml --no-default-features --features "${{ matrix.backend }} unstable extras i-implement-a-third-party-backend-and-opt-into-breaking-changes"
 
       - name: Test diesel
-        if: matrix.rust != 'nightly'
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel/Cargo.toml --no-default-features --features "${{ matrix.backend }} extras r2d2"
+        if: matrix.rust == 'stable'
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel/Cargo.toml --no-default-features --features "${{ matrix.backend }} extras r2d2"
 
       - name: Test diesel (with-deprecated)
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel/Cargo.toml --no-default-features --features "${{ matrix.backend }} extras with-deprecated"
+        if: matrix.rust == 'beta'
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel/Cargo.toml --no-default-features --features "${{ matrix.backend }} extras with-deprecated"
 
       - name: Test diesel-derives (nightly)
         if: matrix.rust == 'nightly'
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_derives/Cargo.toml --no-default-features --features "diesel/${{ matrix.backend }} diesel/unstable"
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel_derives/Cargo.toml --no-default-features --features "diesel/${{ matrix.backend }} diesel/unstable"
 
       - name: Test diesel-derives
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_derives/Cargo.toml --no-default-features --features "diesel/${{ matrix.backend }}"
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel_derives/Cargo.toml --no-default-features --features "diesel/${{ matrix.backend }}"
 
       - name: Test diesel-cli
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_cli/Cargo.toml --no-default-features --features "${{ matrix.backend }}"
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel_cli/Cargo.toml --no-default-features --features "${{ matrix.backend }}"
 
       - name: Test diesel examples
         shell: bash
+        env:
+          BACKEND: ${{ matrix.backend }}
         run: |
-          (cd examples/${{ matrix.backend }} && BACKEND=${{ matrix.backend }} ./test_all)
+           (cd examples/${{ matrix.backend }} && rustup run ${{ matrix.rust }} bash test_all)
 
       - name: Test migrations-internals
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_migrations/migrations_internals/Cargo.toml
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel_migrations/migrations_internals/Cargo.toml
 
       - name: Test migrations-macros
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_migrations/migrations_macros/Cargo.toml --features "diesel/${{ matrix.backend }} ${{ matrix.backend }}"
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel_migrations/migrations_macros/Cargo.toml --features "diesel/${{ matrix.backend }} ${{ matrix.backend }}"
 
       - name: Test diesel_migrations
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_migrations/Cargo.toml --features "${{ matrix.backend }} diesel/${{ matrix.backend }}"
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel_migrations/Cargo.toml --features "${{ matrix.backend }} diesel/${{ matrix.backend }}"
 
       - name: Run diesel_tests (nightly)
-        if: matrix.run == 'nightly'
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_tests/Cargo.toml --no-default-features --features "${{ matrix.backend }} unstable"
+        if: matrix.rust == 'nightly'
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel_tests/Cargo.toml --no-default-features --features "${{ matrix.backend }} unstable"
 
       - name: Run diesel_tests (beta)
-        if: matrix.run == 'beta'
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_tests/Cargo.toml --no-default-features --features "${{ matrix.backend }},returning_clauses_for_sqlite_3_35"
+        if: matrix.rust == 'beta'
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel_tests/Cargo.toml --no-default-features --features "${{ matrix.backend }} returning_clauses_for_sqlite_3_35 libsqlite3-sys/bundled"
 
       - name: Run diesel_tests
-        if: matrix.run == 'stable'
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_tests/Cargo.toml --no-default-features --features "${{ matrix.backend }}"
+        if: matrix.rust == 'stable'
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel_tests/Cargo.toml --no-default-features --features "${{ matrix.backend }}"
 
       - name: Run diesel_dynamic_schema tests
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_dynamic_schema/Cargo.toml --no-default-features --features "${{ matrix.backend }} diesel/${{ matrix.backend }}"
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel_dynamic_schema/Cargo.toml --no-default-features --features "${{ matrix.backend }} diesel/${{ matrix.backend }}"
 
       - name: Run diesel_benches
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{ matrix.backend }}" --bench benchmarks
+        shell: bash
+        run: cargo +${{ matrix.rust }} test --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{ matrix.backend }}" --bench benchmarks
 
       - name: Run rustdoc (nightly)
-        if: matrix.run == 'nightly'
-        uses: actions-rs/cargo@v1
-        with:
-          command: doc
-          args: --manifest-path diesel/Cargo.toml --no-deps --no-default-features --features "${{ matrix.backend }} unstable i-implement-a-third-party-backend-and-opt-into-breaking-changes"
+        if: matrix.rust == 'nightly'
+        shell: bash
+        run: cargo +${{ matrix.rust }} doc --manifest-path diesel/Cargo.toml --no-deps --no-default-features --features "${{ matrix.backend }} unstable i-implement-a-third-party-backend-and-opt-into-breaking-changes extras"
 
       - name: Run rustdoc
-        if: matrix.run != 'nightly'
-        uses: actions-rs/cargo@v1
-        with:
-          command: doc
-          args: --manifest-path diesel/Cargo.toml --no-deps --no-default-features --features "${{ matrix.backend }}"
+        if: matrix.rust == 'stable'
+        shell: bash
+        run: cargo +${{ matrix.rust }} doc --manifest-path diesel/Cargo.toml --no-deps --no-default-features --features "${{ matrix.backend }}"
+
+      - name: Run rustdoc (with-deprecated)
+        if: matrix.rust == 'beta'
+        shell: bash
+        run: cargo +${{ matrix.rust }} doc --manifest-path diesel/Cargo.toml --no-deps --no-default-features --features "${{ matrix.backend }} with-deprecated"
 
   compile_tests:
     name: Compiletests
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
-      - uses: actions-rs/toolchain@v1
+      - uses: dtolnay/rust-toolchain@master
         with:
-          toolchain: 1.56.0
-          profile: minimal
-          override: true
+          toolchain: nightly-2022-08-12
       - name: Cache cargo registry
         uses: actions/cache@v3
         with:
@@ -335,22 +309,17 @@ jobs:
           sudo apt-get -y install libsqlite3-dev libpq-dev libmysqlclient-dev
 
       - name: Run compile tests
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_compile_tests/Cargo.toml
+        shell: bash
+        run: cargo +nightly-2022-08-12 test --manifest-path diesel_compile_tests/Cargo.toml
 
   rustfmt_and_clippy:
     name: Check rustfmt style && run clippy
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
-      - uses: actions-rs/toolchain@v1
+      - uses: dtolnay/rust-toolchain@stable
         with:
-          toolchain: 1.57.0
-          profile: minimal
           components: clippy, rustfmt
-          override: true
       - name: Cache cargo registry
         uses: actions/cache@v2
         with:
@@ -377,63 +346,57 @@ jobs:
 
       - name: Run clippy
         run: |
-          cargo clippy --tests --manifest-path diesel_derives/Cargo.toml --features "postgres diesel/postgres"
-          cargo clippy --tests --manifest-path diesel/Cargo.toml --features "postgres"
-          cargo clippy --tests --manifest-path diesel_dynamic_schema/Cargo.toml --features "postgres diesel/postgres"
-          cargo clippy --tests --manifest-path diesel_migrations/migrations_internals/Cargo.toml
-          cargo clippy --tests --manifest-path diesel_migrations/migrations_macros/Cargo.toml --features "postgres diesel/postgres"
-          cargo clippy --tests --manifest-path diesel_migrations/Cargo.toml --features "postgres diesel/postgres"
-          cargo clippy --tests --manifest-path diesel_cli/Cargo.toml --features "postgres" --no-default-features
-          cargo clippy --tests --manifest-path diesel_tests/Cargo.toml --features "postgres"
-          cargo clippy --tests --manifest-path examples/postgres/getting_started_step_1/Cargo.toml
-          cargo clippy --tests --manifest-path examples/postgres/getting_started_step_2/Cargo.toml
-          cargo clippy --tests --manifest-path examples/postgres/getting_started_step_3/Cargo.toml
-          cargo clippy --tests --manifest-path examples/postgres/advanced-blog-cli/Cargo.toml
-          cargo clippy --tests --manifest-path examples/postgres/all_about_inserts/Cargo.toml
-          cargo clippy --tests --manifest-path examples/postgres/all_about_updates/Cargo.toml
-          cargo clippy --tests --manifest-path examples/postgres/custom_types/Cargo.toml
-
-          cargo clippy --tests --manifest-path diesel_derives/Cargo.toml --features "sqlite diesel/sqlite"
-          cargo clippy --tests --manifest-path diesel/Cargo.toml --features "sqlite"
-          cargo clippy --tests --manifest-path diesel_dynamic_schema/Cargo.toml --features "sqlite diesel/sqlite"
-          cargo clippy --tests --manifest-path diesel_migrations/migrations_macros/Cargo.toml --features "sqlite diesel/sqlite"
-          cargo clippy --tests --manifest-path diesel_migrations/Cargo.toml --features "sqlite diesel/sqlite"
-          cargo clippy --tests --manifest-path diesel_cli/Cargo.toml --features "sqlite" --no-default-features
-          cargo clippy --tests --manifest-path diesel_tests/Cargo.toml --features "sqlite"
-          cargo clippy --tests --manifest-path examples/sqlite/getting_started_step_1/Cargo.toml
-          cargo clippy --tests --manifest-path examples/sqlite/getting_started_step_2/Cargo.toml
-          cargo clippy --tests --manifest-path examples/sqlite/getting_started_step_3/Cargo.toml
-          cargo clippy --tests --manifest-path examples/sqlite/all_about_inserts/Cargo.toml
-
-          cargo clippy --tests --manifest-path diesel_derives/Cargo.toml --features "mysql diesel/mysql"
-          cargo clippy --tests --manifest-path diesel/Cargo.toml --features "mysql"
-          cargo clippy --tests --manifest-path diesel_dynamic_schema/Cargo.toml --features "mysql diesel/mysql"
-          cargo clippy --tests --manifest-path diesel_migrations/migrations_macros/Cargo.toml --features "mysql diesel/mysql"
-          cargo clippy --tests --manifest-path diesel_migrations/Cargo.toml --features "mysql diesel/mysql"
-          cargo clippy --tests --manifest-path diesel_cli/Cargo.toml --features "mysql" --no-default-features
-          cargo clippy --tests --manifest-path diesel_tests/Cargo.toml --features "mysql"
-          cargo clippy --tests --manifest-path examples/mysql/getting_started_step_1/Cargo.toml
-          cargo clippy --tests --manifest-path examples/mysql/getting_started_step_2/Cargo.toml
-          cargo clippy --tests --manifest-path examples/mysql/getting_started_step_3/Cargo.toml
-          cargo clippy --tests --manifest-path examples/mysql/all_about_inserts/Cargo.toml
+          cargo +stable clippy --tests --manifest-path diesel_derives/Cargo.toml --features "postgres diesel/postgres"
+          cargo +stable clippy --tests --manifest-path diesel/Cargo.toml --features "postgres"
+          cargo +stable clippy --tests --manifest-path diesel_dynamic_schema/Cargo.toml --features "postgres diesel/postgres"
+          cargo +stable clippy --tests --manifest-path diesel_migrations/migrations_internals/Cargo.toml
+          cargo +stable clippy --tests --manifest-path diesel_migrations/migrations_macros/Cargo.toml --features "postgres diesel/postgres"
+          cargo +stable clippy --tests --manifest-path diesel_migrations/Cargo.toml --features "postgres diesel/postgres"
+          cargo +stable clippy --tests --manifest-path diesel_cli/Cargo.toml --features "postgres" --no-default-features
+          cargo +stable clippy --tests --manifest-path diesel_tests/Cargo.toml --features "postgres"
+          cargo +stable clippy --tests --manifest-path examples/postgres/getting_started_step_1/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/postgres/getting_started_step_2/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/postgres/getting_started_step_3/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/postgres/advanced-blog-cli/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/postgres/all_about_inserts/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/postgres/all_about_updates/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/postgres/custom_types/Cargo.toml
+
+          cargo +stable clippy --tests --manifest-path diesel_derives/Cargo.toml --features "sqlite diesel/sqlite"
+          cargo +stable clippy --tests --manifest-path diesel/Cargo.toml --features "sqlite"
+          cargo +stable clippy --tests --manifest-path diesel_dynamic_schema/Cargo.toml --features "sqlite diesel/sqlite"
+          cargo +stable clippy --tests --manifest-path diesel_migrations/migrations_macros/Cargo.toml --features "sqlite diesel/sqlite"
+          cargo +stable clippy --tests --manifest-path diesel_migrations/Cargo.toml --features "sqlite diesel/sqlite"
+          cargo +stable clippy --tests --manifest-path diesel_cli/Cargo.toml --features "sqlite" --no-default-features
+          cargo +stable clippy --tests --manifest-path diesel_tests/Cargo.toml --features "sqlite"
+          cargo +stable clippy --tests --manifest-path examples/sqlite/getting_started_step_1/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/sqlite/getting_started_step_2/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/sqlite/getting_started_step_3/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/sqlite/all_about_inserts/Cargo.toml
+
+          cargo +stable clippy --tests --manifest-path diesel_derives/Cargo.toml --features "mysql diesel/mysql"
+          cargo +stable clippy --tests --manifest-path diesel/Cargo.toml --features "mysql"
+          cargo +stable clippy --tests --manifest-path diesel_dynamic_schema/Cargo.toml --features "mysql diesel/mysql"
+          cargo +stable clippy --tests --manifest-path diesel_migrations/migrations_macros/Cargo.toml --features "mysql diesel/mysql"
+          cargo +stable clippy --tests --manifest-path diesel_migrations/Cargo.toml --features "mysql diesel/mysql"
+          cargo +stable clippy --tests --manifest-path diesel_cli/Cargo.toml --features "mysql" --no-default-features
+          cargo +stable clippy --tests --manifest-path diesel_tests/Cargo.toml --features "mysql"
+          cargo +stable clippy --tests --manifest-path examples/mysql/getting_started_step_1/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/mysql/getting_started_step_2/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/mysql/getting_started_step_3/Cargo.toml
+          cargo +stable clippy --tests --manifest-path examples/mysql/all_about_inserts/Cargo.toml
 
       - name: Check formating
-        uses: actions-rs/cargo@v1
-        with:
-          command: fmt
-          args: --all -- --check
+        run: cargo +stable fmt --all -- --check
 
   sqlite_bundled:
     name: Check sqlite bundled + Sqlite with asan
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
-      - uses: actions-rs/toolchain@v1
+      - uses: dtolnay/rust-toolchain@nightly
         with:
-          toolchain: nightly
-          profile: minimal
-          override: true
-          components: rust-src
+          components: "rust-src"
       - name: Cache cargo registry
         uses: actions/cache@v2
         with:
@@ -443,34 +406,30 @@ jobs:
           key: sqlite_bundled-cargo-${{ hashFiles('**/Cargo.toml') }}
 
       - name: Test diesel-cli
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --manifest-path diesel_cli/Cargo.toml --no-default-features --features "sqlite-bundled"
+        run: cargo +nightly test --manifest-path diesel_cli/Cargo.toml --no-default-features --features "sqlite-bundled"
 
       - name: Run diesel_tests with ASAN enabled
         env:
           RUSTFLAGS: -Zsanitizer=address
           ASAN_OPTIONS: detect_stack_use_after_return=1
-        run: cargo -Z build-std test --manifest-path diesel_tests/Cargo.toml --no-default-features --features "sqlite libsqlite3-sys libsqlite3-sys/bundled libsqlite3-sys/with-asan" --target x86_64-unknown-linux-gnu
+        run: cargo +nightly -Z build-std test --manifest-path diesel_tests/Cargo.toml --no-default-features --features "sqlite libsqlite3-sys libsqlite3-sys/bundled libsqlite3-sys/with-asan" --target x86_64-unknown-linux-gnu
 
       - name: Run diesel tests with ASAN enabled
         env:
           RUSTDOCFLAGS: -Zsanitizer=address
           RUSTFLAGS: -Zsanitizer=address
           ASAN_OPTIONS: detect_stack_use_after_return=1
-        run: cargo -Z build-std test --manifest-path diesel/Cargo.toml --no-default-features --features "sqlite extras libsqlite3-sys libsqlite3-sys/bundled libsqlite3-sys/with-asan" --target x86_64-unknown-linux-gnu
+        run: cargo +nightly -Z build-std test --manifest-path diesel/Cargo.toml --no-default-features --features "sqlite extras libsqlite3-sys libsqlite3-sys/bundled libsqlite3-sys/with-asan" --target x86_64-unknown-linux-gnu
 
   minimal_rust_version:
     name: Check Minimal supported rust version (1.56.0)
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
-      - uses: actions-rs/toolchain@v1
-        with:
-          toolchain: 1.56.0
-          profile: minimal
-          override: true
+      - uses: dtolnay/rust-toolchain@1.56.0
+      - uses: dtolnay/rust-toolchain@nightly
+      - uses: taiki-e/install-action@cargo-hack
+      - uses: taiki-e/install-action@cargo-minimal-versions
       - name: Cache cargo registry
         uses: actions/cache@v2
         with:
@@ -482,14 +441,13 @@ jobs:
         run: |
           sudo apt-get update
           sudo apt-get -y install libsqlite3-dev libpq-dev libmysqlclient-dev
-      - name: Use minimal dependencies
-        run: |
-          RUSTC_BOOTSTRAP=1 cargo update -Z minimal-versions
-
-      - name: Check building with rust 1.54.0
-        uses: actions-rs/cargo@v1
-        with:
-          command: check
-          # This example pulls generic-array v0.14.1 that cannot compile with rustc 1.40.0.
-          # We could exclude it as it won't affect our MSRV.
-          args: --all --exclude=advanced-blog-cli
+      - name: Check diesel_derives
+        run: cargo +1.56.0 minimal-versions check -p diesel_derives --all-features
+      - name: Check diesel
+        run: cargo +1.56.0 minimal-versions check -p diesel --features "postgres mysql sqlite extras"
+      - name: Check diesel_dynamic_schema
+        run: cargo +1.56.0 minimal-versions check -p diesel-dynamic-schema --all-features
+      - name: Check diesel_migrations
+        run: cargo +1.56.0 minimal-versions check -p diesel_migrations --all-features
+      - name: Check diesel_cli
+        run: cargo +1.56.0 minimal-versions check -p diesel_cli --all-features
diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml
index 4262b78525c8..e54b45f7967e 100644
--- a/.github/workflows/doc.yml
+++ b/.github/workflows/doc.yml
@@ -27,11 +27,7 @@ jobs:
       shell: bash
       run: |
         echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
-    - uses: actions-rs/toolchain@v1
-      with:
-        toolchain: nightly
-        profile: minimal
-        override: true
+    - uses: dtolnay/rust-toolchain@nightly
     - name: Install dependencies
       run: |
         sudo apt-get update
diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml
index 1cf5d7315977..57f58153a432 100644
--- a/.github/workflows/metrics.yml
+++ b/.github/workflows/metrics.yml
@@ -58,32 +58,19 @@ jobs:
           echo 'DATABASE_URL=mysql://root:root@localhost/diesel_test' >> $GITHUB_ENV
 
       - name: Install rust toolchain
-        uses: actions-rs/toolchain@v1
-        with:
-          profile: minimal
-          toolchain: stable
-          override: true
+        uses: dtolnay/rust-toolchain@stable
 
       - name: Run Benchmarks (Postgres)
         if: matrix.backend == 'postgres'
-        uses: actions-rs/cargo@v1
-        with:
-          command: bench
-          args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} rust_postgres futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio quaint quaint/postgresql quaint/serde-support serde diesel-async diesel-async/${{matrix.backend}}"
+        run: cargo +stable bench --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} rust_postgres futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio quaint quaint/postgresql quaint/serde-support serde diesel-async diesel-async/${{matrix.backend}}"
 
       - name: Run Benchmarks (Sqlite)
         if: matrix.backend == 'sqlite'
-        uses: actions-rs/cargo@v1
-        with:
-          command: bench
-          args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} tokio rusqlite futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio"
+        run: cargo +stable bench --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} tokio rusqlite futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio"
 
       - name: Run Benchmarks (Mysql)
         if: matrix.backend == 'mysql'
-        uses: actions-rs/cargo@v1
-        with:
-          command: bench
-          args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} tokio rustorm rustorm/with-${{matrix.backend}} rustorm_dao rust_mysql futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio quaint quaint/mysql quaint/serde-support serde diesel-async diesel-async/${{matrix.backend}}"
+        run: cargo +stable bench --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} tokio rustorm rustorm/with-${{matrix.backend}} rustorm_dao rust_mysql futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio quaint quaint/mysql quaint/serde-support serde diesel-async diesel-async/${{matrix.backend}}"
 
       - name: Push metrics
         env:
@@ -96,6 +83,7 @@ jobs:
           ssh-keyscan github.com >> ~/.ssh/known_hosts
           echo "${{ secrets.METRIC_ACCESS_KEY }}" >> ~/.ssh/id_ed25519
           chmod 600 ~/.ssh/id_ed25519
+          rm diesel_bench/target/release -rf
 
           git clone --depth 1 git@github.com:diesel-rs/metrics.git
 
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 55cec9f0c8d7..a0c5c54eda60 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,30 +8,9 @@ default features enabled using some set of dependencies. Those set of dependenci
 an up to date version of the specific dependency. We check this by using the unstable `-Z minimal-version` cargo flag. 
 Increasing the minimal supported Rust version will always be coupled at least with a minor release.
 
-## [2.0.0 Rc1] 2022-07-22 
+## Unreleased 
 
-### Changed
-
-* We've changed the `RunQueryDsl::load_iter` interface to support different
-loading modes. This enables us to support more than one strategy for loading 
-values by iterator from the database. 
-
-### Added
-
-* Adds an `ipnet-address` feature flag, allowing support (de)serializing IP
-  values from the database using types provided by `ipnet`. This feature
-  may be enabled concurrently with the previously existing `network-address`
-  feature.
-* We've added support for loading values using libpq's row-by-row mode via 
-the new iterator interface
-
-### Fixed
-
-* Updated `ipnetwork` to allow version 0.20.
-* Updated `libsqlite3-sys` to allow version 0.25
-* Fix a bug that prevents connection reusing with r2d2 
-
-## [2.0.0 Rc0] 2022-04-22
+## [2.0.0] 2022-08-29
 
 ### Added
 
@@ -109,6 +88,17 @@ the new iterator interface
 
 * Added support for updating individual array elements `UPDATE table SET array_column[1] = true`
 
+* Adds an `ipnet-address` feature flag, allowing support (de)serializing IP
+  values from the database using types provided by `ipnet`. This feature
+  may be enabled concurrently with the previously existing `network-address`
+  feature.
+
+* We've added support for loading values using libpq's row-by-row mode via
+  the new iterator interface
+
+* Adds `Timestamp`, `Timestamptz` support for appropriate types for `time v0.3.9`.
+  This feature enables using the `time` crate as an alternative to `chrono`.
+
 ### Removed
 
 * All previously deprecated items have been removed.
@@ -230,6 +220,12 @@ the new iterator interface
   with the database. Beside of the changed signature, existing impls of this trait should remain unchanged in almost 
   all cases.
 
+* The `PIPES_AS_CONCAT` sql_mode is no longer set
+by default. This setting requires a modification to MySQL query parsing that is
+not supported by certain systems (such as Vitess). If you are using MySQL and
+executing raw queries with the `||` operator, you will need to rewrite your
+queries or set `PIPES_AS_CONCAT` manually.
+
 ### Fixed
 
 * Many types were incorrectly considered non-aggregate when they should not
@@ -1960,3 +1956,4 @@ the new iterator interface
 [1.4.8]: https://github.com/diesel-rs/diesel/compare/v1.4.7...v1.4.8
 [2.0.0 Rc0]: https://github.com/diesel-rs/diesel/compare/v.1.4.0...v2.0.0-rc0
 [2.0.0 Rc1]: https://github.com/diesel-rs/diesel/compare/v.2.0.0-rc0...v2.0.0-rc1
+[2.0.0]: https://github.com/diesel-rs/diesel/compare/v.1.4.0...v2.0.0
diff --git a/bin/diesel b/bin/diesel
index a032dd816310..8ef8c17e4838 100755
--- a/bin/diesel
+++ b/bin/diesel
@@ -4,5 +4,5 @@ set -e
 SCRIPT_DIR=$(dirname "$0")
 ABSOLUTE_SCRIPT_DIR=$(cd "$SCRIPT_DIR" && pwd)
 BASE_DIR=$(dirname "$ABSOLUTE_SCRIPT_DIR")
-$(cd $BASE_DIR/diesel_cli && cargo build --quiet --no-default-features --features "$BACKEND")
-$BASE_DIR/target/debug/diesel $@
+eval "$(cd "$BASE_DIR"/diesel_cli && cargo build --quiet --no-default-features --features "$BACKEND")"
+"$BASE_DIR"/target/debug/diesel "$@"
diff --git a/diesel/Cargo.toml b/diesel/Cargo.toml
index 6e0603e42daa..dac80110425a 100644
--- a/diesel/Cargo.toml
+++ b/diesel/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "diesel"
-version = "2.0.0-rc.1"
+version = "2.0.0"
 license = "MIT OR Apache-2.0"
 description = "A safe, extensible ORM and Query Builder for PostgreSQL, SQLite, and MySQL"
 readme = "README.md"
@@ -14,7 +14,7 @@ rust-version = "1.56.0"
 
 [dependencies]
 byteorder = { version = "1.0", optional = true }
-chrono = { version = "0.4.19", optional = true, default-features = false, features = ["clock", "std"] }
+chrono = { version = "0.4.20", optional = true, default-features = false, features = ["clock", "std"] }
 libc = { version = "0.2.0", optional = true }
 libsqlite3-sys = { version = ">=0.17.2, <0.26.0", optional = true, features = ["bundled_bindings"] }
 mysqlclient-sys = { version = "0.2.5", optional = true }
@@ -33,9 +33,10 @@ bigdecimal = { version = ">=0.0.13, < 0.4.0", optional = true }
 bitflags = { version = "1.2.0", optional = true }
 r2d2 = { version = ">= 0.8.2, < 0.9.0", optional = true }
 itoa = { version = "1.0.0", optional = true }
+time = { version = "0.3.9", optional = true, features = ["macros", "formatting", "parsing"] }
 
 [dependencies.diesel_derives]
-version = "~2.0.0-rc.1"
+version = "~2.0.0"
 path = "../diesel_derives"
 
 [dev-dependencies]
@@ -46,7 +47,7 @@ quickcheck = "1.0.3"
 
 [features]
 default = ["with-deprecated", "32-column-tables"]
-extras = ["chrono", "serde_json", "uuid", "network-address", "numeric", "r2d2"]
+extras = ["chrono", "time", "serde_json", "uuid", "network-address", "numeric", "r2d2"]
 unstable = ["diesel_derives/nightly"]
 large-tables = ["32-column-tables"]
 huge-tables = ["64-column-tables"]
@@ -54,6 +55,10 @@ huge-tables = ["64-column-tables"]
 64-column-tables = ["32-column-tables", "diesel_derives/64-column-tables"]
 128-column-tables = ["64-column-tables", "diesel_derives/128-column-tables"]
 postgres = ["pq-sys", "postgres_backend"]
+# If we bumped the diesel MSRV to 1.60, we could eliminate the `time` "formatting" and "parsing" features
+# from the main import and instead put them into the `sqlite` dependency here, as
+# sqlite = ["libsqlite3-sys", "diesel_derives/sqlite", "time?/formatting", "time?/parsing"]
+# https://doc.rust-lang.org/cargo/reference/features.html#dependency-features
 sqlite = ["libsqlite3-sys", "diesel_derives/sqlite"]
 mysql = ["mysqlclient-sys", "url", "percent-encoding", "bitflags", "mysql_backend"]
 without-deprecated = ["diesel_derives/without-deprecated"]
@@ -65,6 +70,7 @@ postgres_backend = ["diesel_derives/postgres", "bitflags", "byteorder", "itoa"]
 mysql_backend = ["diesel_derives/mysql", "byteorder"]
 returning_clauses_for_sqlite_3_35 = []
 i-implement-a-third-party-backend-and-opt-into-breaking-changes = []
+nightly-error-messages = []
 
 [package.metadata.docs.rs]
 features = ["postgres", "mysql", "sqlite", "extras"]
diff --git a/diesel/src/backend.rs b/diesel/src/backend.rs
index 93e4bdc2e90d..664ddab9d4a8 100644
--- a/diesel/src/backend.rs
+++ b/diesel/src/backend.rs
@@ -31,7 +31,7 @@ pub(crate) use self::private::{
 ///
 /// Implementing a custom backend requires enabling the
 /// `i-implement-a-third-party-backend-and-opt-into-breaking-changes` crate feature
-/// to get access to all nessesary type and trait implementations.
+/// to get access to all necessary type and trait implementations.
 ///
 /// Implementations of this trait should not assume details about how the
 /// connection is implemented.
@@ -202,6 +202,24 @@ pub trait SqlDialect: self::private::TrustedBackend {
         doc = "See [`sql_dialect::batch_insert_support`] for provided default implementations"
     )]
     type BatchInsertSupport;
+    /// Configures how this backend handles the Concat clauses in
+    /// select statements.
+    ///
+    /// This allows backends to provide a custom [`QueryFragment`](crate::query_builder::QueryFragment)
+    #[cfg_attr(
+        feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes",
+        doc = "implementation for [`Concat`](crate::expression::Concat)"
+    )]
+    #[cfg_attr(
+        not(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"),
+        doc = "implementation for `Concat`"
+    )]
+    ///
+    #[cfg_attr(
+        feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes",
+        doc = "See [`sql_dialect::concat_clause`] for provided default implementations"
+    )]
+    type ConcatClause;
     /// Configures how this backend handles the `DEFAULT VALUES` clause for
     /// insert statements.
     ///
@@ -274,6 +292,26 @@ pub trait SqlDialect: self::private::TrustedBackend {
         doc = "See [`sql_dialect::array_comparison`] for provided default implementations"
     )]
     type ArrayComparison;
+
+    /// Configures how this backend structures `SELECT` queries
+    ///
+    /// This allows backends to provide custom [`QueryFragment`](crate::query_builder::QueryFragment)
+    /// implementations for
+    #[cfg_attr(
+        not(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"),
+        doc = "`SelectStatement` and `BoxedSelectStatement`"
+    )]
+    #[cfg_attr(
+        not(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"),
+        doc = "[`SelectStatement`](crate::query_builder::SelectStatement) and
+               [`BoxedSelectStatement`](crate::query_builder::BoxedSelectStatement)"
+    )]
+    ///
+    #[cfg_attr(
+        feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes",
+        doc = "See [`sql_dialect::select_statement_syntax`] for provided default implementations"
+    )]
+    type SelectStatementSyntax;
 }
 
 /// This module contains all options provided by diesel to configure the [`SqlDialect`] trait.
@@ -396,6 +434,19 @@ pub(crate) mod sql_dialect {
 
         impl SupportsBatchInsert for PostgresLikeBatchInsertSupport {}
     }
+    /// This module contains all reusable options to configure
+    /// [`SqlDialect::ConcatClause`]
+    #[diesel_derives::__diesel_public_if(
+        feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
+    )]
+    pub(crate) mod concat_clause {
+
+        /// Indicates that this backend uses the
+        /// `||` operator to select a concatenation
+        /// of two variables or strings
+        #[derive(Debug, Clone, Copy)]
+        pub struct ConcatWithPipesClause;
+    }
 
     /// This module contains all reusable options to configure
     /// [`SqlDialect::DefaultValueClauseForInsert`]
@@ -452,6 +503,18 @@ pub(crate) mod sql_dialect {
         #[derive(Debug, Copy, Clone)]
         pub struct AnsiSqlArrayComparison;
     }
+
+    /// This module contains all reusable options to configure
+    /// [`SqlDialect::SelectStatementSyntax`]
+    #[diesel_derives::__diesel_public_if(
+        feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
+    )]
+    pub(crate) mod select_statement_syntax {
+        /// Indicates that this backend uses the default
+        /// ANSI select statement structure
+        #[derive(Debug, Copy, Clone)]
+        pub struct AnsiSqlSelectStatement;
+    }
 }
 
 // These traits are not part of the public API
diff --git a/diesel/src/connection/mod.rs b/diesel/src/connection/mod.rs
index defeb5c2ac2d..8644472565f5 100644
--- a/diesel/src/connection/mod.rs
+++ b/diesel/src/connection/mod.rs
@@ -217,7 +217,7 @@ where
     ///
     /// This function executes the provided closure `f` inside a database
     /// transaction. If there is already an open transaction for the current
-    /// connection savepoints will be used instead. The connection is commited if
+    /// connection savepoints will be used instead. The connection is committed if
     /// the closure returns `Ok(_)`, it will be rolled back if it returns `Err(_)`.
     /// For both cases the original result value will be returned from this function.
     ///
@@ -299,7 +299,13 @@ where
             }
             TransactionManagerStatus::InError => panic!("Transaction manager in error"),
         };
-        Self::TransactionManager::begin_transaction(self)
+        Self::TransactionManager::begin_transaction(self)?;
+        // set the test transaction flag
+        // to pervent that this connection gets droped in connection pools
+        // Tests commonly set the poolsize to 1 and use `begin_test_transaction`
+        // to prevent modifications to the schema
+        Self::TransactionManager::transaction_manager_status_mut(self).set_test_transaction_flag();
+        Ok(())
     }
 
     /// Executes the given function inside a transaction, but does not commit
@@ -371,7 +377,7 @@ where
 
 /// The specific part of a [`Connection`] which actually loads data from the database
 ///
-/// This is a seperate trait to allow connection implementations to specify
+/// This is a separate trait to allow connection implementations to specify
 /// different loading modes via the generic paramater.
 pub trait LoadConnection<B = DefaultLoadingMode>: Connection
 where
diff --git a/diesel/src/connection/statement_cache.rs b/diesel/src/connection/statement_cache.rs
index 40dbc5717a65..f37f5b775a90 100644
--- a/diesel/src/connection/statement_cache.rs
+++ b/diesel/src/connection/statement_cache.rs
@@ -151,7 +151,7 @@ where
         }
     }
 
-    /// Get the current lenght of the statement cache
+    /// Get the current length of the statement cache
     #[allow(unreachable_pub)]
     #[cfg(any(
         feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes",
@@ -174,7 +174,7 @@ where
     /// the cached prepared statement will be returned, otherwise `prepare_fn`
     /// will be called to create a new prepared statement for this query source.
     /// The first parameter of the callback contains the query string, the second
-    /// paramater indicates if the constructed prepared statement will be cached or not.
+    /// parameter indicates if the constructed prepared statement will be cached or not.
     /// See the [module](self) documentation for details
     /// about which statements are cached and which are not cached.
     #[allow(unreachable_pub)]
diff --git a/diesel/src/connection/transaction_manager.rs b/diesel/src/connection/transaction_manager.rs
index 1e5eb773fe89..cc3c6883c78c 100644
--- a/diesel/src/connection/transaction_manager.rs
+++ b/diesel/src/connection/transaction_manager.rs
@@ -38,11 +38,14 @@ pub trait TransactionManager<Conn: Connection> {
     /// Used to ensure that `begin_test_transaction` is not called when already
     /// inside of a transaction, and that operations are not run in a `InError`
     /// transaction manager.
+    #[diesel_derives::__diesel_public_if(
+        feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
+    )]
     fn transaction_manager_status_mut(conn: &mut Conn) -> &mut TransactionManagerStatus;
 
     /// Executes the given function inside of a database transaction
     ///
-    /// Each implementation of this function needs to fullfill the documented
+    /// Each implementation of this function needs to fulfill the documented
     /// behaviour of [`Connection::transaction`]
     fn transaction<F, R, E>(conn: &mut Conn, callback: F) -> Result<R, E>
     where
@@ -66,17 +69,48 @@ pub trait TransactionManager<Conn: Connection> {
             },
         }
     }
+
+    /// This methods checks if the connection manager is considered to be broken
+    /// by connection pool implementations
+    ///
+    /// A connection manager is considered to be broken by default if it either
+    /// contains an open transaction (because you don't want to have connections
+    /// with open transactions in your pool) or when the transaction manager is
+    /// in an error state.
+    #[diesel_derives::__diesel_public_if(
+        feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
+    )]
+    fn is_broken_transaction_manager(conn: &mut Conn) -> bool {
+        match Self::transaction_manager_status_mut(conn).transaction_state() {
+            // all transactions are closed
+            // so we don't consider this connection broken
+            Ok(ValidTransactionManagerStatus {
+                in_transaction: None,
+            }) => false,
+            // The transaction manager is in an error state
+            // Therefore we consider this connection broken
+            Err(_) => true,
+            // The transaction manager contains a open transaction
+            // we do consider this connection broken
+            // if that transaction was not opened by `begin_test_transaction`
+            Ok(ValidTransactionManagerStatus {
+                in_transaction: Some(s),
+            }) => !s.test_transaction,
+        }
+    }
 }
 
 /// An implementation of `TransactionManager` which can be used for backends
 /// which use ANSI standard syntax for savepoints such as SQLite and PostgreSQL.
-#[allow(missing_debug_implementations, missing_copy_implementations)]
-#[derive(Default)]
+#[derive(Default, Debug)]
 pub struct AnsiTransactionManager {
     pub(crate) status: TransactionManagerStatus,
 }
 
 /// Status of the transaction manager
+#[diesel_derives::__diesel_public_if(
+    feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
+)]
 #[derive(Debug)]
 pub enum TransactionManagerStatus {
     /// Valid status, the manager can run operations
@@ -157,6 +191,15 @@ impl TransactionManagerStatus {
             TransactionManagerStatus::InError => Err(Error::BrokenTransactionManager),
         }
     }
+
+    pub(crate) fn set_test_transaction_flag(&mut self) {
+        if let TransactionManagerStatus::Valid(ValidTransactionManagerStatus {
+            in_transaction: Some(s),
+        }) = self
+        {
+            s.test_transaction = true;
+        }
+    }
 }
 
 /// Valid transaction status for the manager. Can return the current transaction depth
@@ -171,6 +214,7 @@ pub struct ValidTransactionManagerStatus {
 struct InTransactionStatus {
     transaction_depth: NonZeroU32,
     top_level_transaction_requires_rollback: bool,
+    test_transaction: bool,
 }
 
 impl ValidTransactionManagerStatus {
@@ -209,6 +253,7 @@ impl ValidTransactionManagerStatus {
                 self.in_transaction = Some(InTransactionStatus {
                     transaction_depth: NonZeroU32::new(1).expect("1 is non-zero"),
                     top_level_transaction_requires_rollback: false,
+                    test_transaction: false,
                 });
                 Ok(())
             }
@@ -331,6 +376,7 @@ where
                             Some(InTransactionStatus {
                                 transaction_depth,
                                 top_level_transaction_requires_rollback,
+                                ..
                             }),
                     }) if transaction_depth.get() > 1
                         && !*top_level_transaction_requires_rollback =>
@@ -376,6 +422,7 @@ where
                         Some(InTransactionStatus {
                             ref mut transaction_depth,
                             top_level_transaction_requires_rollback: true,
+                            ..
                         }),
                 }) = conn.transaction_state().status
                 {
@@ -793,14 +840,14 @@ mod test {
                     assert_eq!(None, <AnsiTransactionManager as TransactionManager<MysqlConnection>>::transaction_manager_status_mut(conn).transaction_depth().expect("Transaction depth"));
 
                     let second_trans_result = conn.transaction(|conn| crate::sql_query("SELECT 1").execute(conn));
-                    assert!(second_trans_result.is_ok(), "Expected the thread connections to have been rolled back or commited, but second transaction exited with {:?}", second_trans_result);
+                    assert!(second_trans_result.is_ok(), "Expected the thread connections to have been rolled back or committed, but second transaction exited with {:?}", second_trans_result);
                     result
                 })
             })
             .collect::<Vec<_>>();
         let second_trans_result =
             conn.transaction(|conn| crate::sql_query("SELECT 1").execute(conn));
-        assert!(second_trans_result.is_ok(), "Expected the main connection to have been rolled back or commited, but second transaction exited with {:?}", second_trans_result);
+        assert!(second_trans_result.is_ok(), "Expected the main connection to have been rolled back or committed, but second transaction exited with {:?}", second_trans_result);
 
         let mut results = threads
             .into_iter()
@@ -902,14 +949,14 @@ mod test {
                     assert_eq!(None, <AnsiTransactionManager as TransactionManager<MysqlConnection>>::transaction_manager_status_mut(conn).transaction_depth().expect("Transaction depth"));
 
                     let second_trans_result = conn.transaction(|conn| crate::sql_query("SELECT 1").execute(conn));
-                    assert!(second_trans_result.is_ok(), "Expected the thread connections to have been rolled back or commited, but second transaction exited with {:?}", second_trans_result);
+                    assert!(second_trans_result.is_ok(), "Expected the thread connections to have been rolled back or committed, but second transaction exited with {:?}", second_trans_result);
                     result
                 })
             })
             .collect::<Vec<_>>();
         let second_trans_result =
             conn.transaction(|conn| crate::sql_query("SELECT 1").execute(conn));
-        assert!(second_trans_result.is_ok(), "Expected the main connection to have been rolled back or commited, but second transaction exited with {:?}", second_trans_result);
+        assert!(second_trans_result.is_ok(), "Expected the main connection to have been rolled back or committed, but second transaction exited with {:?}", second_trans_result);
 
         let mut results = threads
             .into_iter()
diff --git a/diesel/src/deserialize.rs b/diesel/src/deserialize.rs
index 5301b534e609..2ac1e0d4a806 100644
--- a/diesel/src/deserialize.rs
+++ b/diesel/src/deserialize.rs
@@ -435,6 +435,14 @@ pub trait FromSql<A, DB: Backend>: Sized {
 /// that implement one of the following traits:
 ///    * [`Queryable`]
 ///    * [`QueryableByName`]
+#[cfg_attr(
+    feature = "nightly-error-messages",
+    rustc_on_unimplemented(on(
+        ST = "diesel::sql_types::Untyped",
+        note = "`diesel::sql_query` requires the loading target to column names for loading values.\n\
+                 You need to provide a type that explicitly derives `diesel::deserialize::QueryableByName`",
+    ))
+)]
 pub trait FromSqlRow<ST, DB: Backend>: Sized {
     /// See the trait documentation.
     fn build_from_row<'a>(row: &impl Row<'a, DB>) -> Result<Self>;
@@ -466,8 +474,8 @@ where
 
 /// A helper trait to deserialize a statically sized row into an tuple
 ///
-/// **If you see an error message mentioning this trait you likly
-///   trying to map the result of an query to an struct with missmatching
+/// **If you see an error message mentioning this trait you likely
+///   trying to map the result of an query to an struct with mismatching
 ///   field types. Recheck your field order and the concrete field types**
 ///
 /// You should not need to implement this trait directly.
@@ -530,7 +538,7 @@ where
 // then complains in third party crates that
 // diesel may implement `SingleValue` for tuples
 // in the future. While that is theoretically true,
-// that will likly not happen in practice.
+// that will likely not happen in practice.
 // If we get negative trait impls at some point in time
 // it should be possible to make this work.
 /*impl<T, ST, DB> Queryable<ST, DB> for T
diff --git a/diesel/src/expression/mod.rs b/diesel/src/expression/mod.rs
index 0f6fefc6f953..470b4ebc040f 100644
--- a/diesel/src/expression/mod.rs
+++ b/diesel/src/expression/mod.rs
@@ -40,6 +40,9 @@ pub(crate) mod select_by;
 mod sql_literal;
 pub(crate) mod subselect;
 
+#[cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes")]
+pub use self::operators::Concat;
+
 // we allow unreachable_pub here
 // as rustc otherwise shows false positives
 // for every item in this module. We reexport
@@ -305,6 +308,13 @@ where
 /// Notably, columns will not implement this trait for the right side of a left
 /// join. To select a column or expression using a column from the right side of
 /// a left join, you must call `.nullable()` on it.
+#[cfg_attr(
+    feature = "nightly-error-messages",
+    rustc_on_unimplemented(
+        message = "Cannot select `{Self}` from `{QS}`",
+        note = "`{Self}` is no valid selection for `{QS}`"
+    )
+)]
 pub trait SelectableExpression<QS: ?Sized>: AppearsOnTable<QS> {}
 
 impl<T: ?Sized, QS> SelectableExpression<QS> for Box<T>
@@ -446,7 +456,7 @@ where
 /// Implementations of this trait must ensure that aggregate expressions are
 /// not mixed with non-aggregate expressions.
 ///
-/// For generic types, you can determine if your sub-expresssions can appear
+/// For generic types, you can determine if your sub-expressions can appear
 /// together using the [`MixedAggregates`] trait.
 ///
 /// `GroupByClause` will be a tuple containing the set of expressions appearing
diff --git a/diesel/src/expression/operators.rs b/diesel/src/expression/operators.rs
index 96ff8406c30d..55b1372c4e0a 100644
--- a/diesel/src/expression/operators.rs
+++ b/diesel/src/expression/operators.rs
@@ -552,7 +552,7 @@ postfix_operator!(
 
 prefix_operator!(Not, " NOT ");
 
-use crate::backend::Backend;
+use crate::backend::{sql_dialect, Backend, SqlDialect};
 use crate::expression::{TypedExpressionType, ValidGrouping};
 use crate::insertable::{ColumnInsertValue, Insertable};
 use crate::query_builder::{QueryFragment, QueryId, ValuesClause};
@@ -582,9 +582,16 @@ where
     }
 }
 
+/// This type represents a string concat operator
+#[diesel_derives::__diesel_public_if(
+    feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes",
+    public_fields(left, right)
+)]
 #[derive(Debug, Clone, Copy, QueryId, DieselNumericOps, ValidGrouping)]
 pub struct Concat<L, R> {
+    /// The left side expression of the operator
     pub(crate) left: L,
+    /// The right side expression of the operator
     pub(crate) right: R,
 }
 
@@ -606,17 +613,30 @@ where
 impl_selectable_expression!(Concat<L, R>);
 
 impl<L, R, DB> QueryFragment<DB> for Concat<L, R>
+where
+    DB: Backend,
+    Self: QueryFragment<DB, DB::ConcatClause>,
+{
+    fn walk_ast<'b>(
+        &'b self,
+        pass: crate::query_builder::AstPass<'_, 'b, DB>,
+    ) -> crate::result::QueryResult<()> {
+        <Self as QueryFragment<DB, DB::ConcatClause>>::walk_ast(self, pass)
+    }
+}
+
+impl<L, R, DB> QueryFragment<DB, sql_dialect::concat_clause::ConcatWithPipesClause> for Concat<L, R>
 where
     L: QueryFragment<DB>,
     R: QueryFragment<DB>,
-    DB: Backend,
+    DB: Backend + SqlDialect<ConcatClause = sql_dialect::concat_clause::ConcatWithPipesClause>,
 {
     fn walk_ast<'b>(
         &'b self,
         mut out: crate::query_builder::AstPass<'_, 'b, DB>,
     ) -> crate::result::QueryResult<()> {
-        // Those brackets are required because mysql is broken
-        // https://github.com/diesel-rs/diesel/issues/2133#issuecomment-517432317
+        // Since popular MySQL scalability layer Vitess does not support pipes in query parsing
+        // CONCAT has been implemented separately for MySQL (see MysqlConcatClause)
         out.push_sql("(");
         self.left.walk_ast(out.reborrow())?;
         out.push_sql(" || ");
diff --git a/diesel/src/lib.rs b/diesel/src/lib.rs
index fd4a1a784e90..041655a563dc 100644
--- a/diesel/src/lib.rs
+++ b/diesel/src/lib.rs
@@ -155,12 +155,17 @@
 //! explicitly opts out the stability guarantee given by diesel. This feature overrides the `with-deprecated`.
 //! Note that this may also remove items that are not shown as `#[deprecated]` in our documentation, due to
 //! various bugs in rustdoc. It can be used to check if you depend on any such hidden `#[deprecated]` item.
+//! - `nightly-error-messages`: This feature enables the generation of improved compiler error messages for
+//! common mistakes using diesel. This feature requires a nightly rust compiler and is considered to be unstable.
+//! We might remove it in future diesel versions without replacement or deprecation.
+//!
 //!
 //! By default the following features are enabled:
 //!
 //! - `with-deprecated`
 //! - `32-column-tables`
 
+#![cfg_attr(feature = "nightly-error-messages", feature(rustc_attrs))]
 #![cfg_attr(feature = "unstable", feature(trait_alias))]
 #![cfg_attr(doc_cfg, feature(doc_cfg, doc_auto_cfg))]
 #![cfg_attr(feature = "128-column-tables", recursion_limit = "256")]
diff --git a/diesel/src/mysql/backend.rs b/diesel/src/mysql/backend.rs
index e04537e4efe8..01cb3ed7dfa6 100644
--- a/diesel/src/mysql/backend.rs
+++ b/diesel/src/mysql/backend.rs
@@ -87,9 +87,12 @@ impl SqlDialect for Mysql {
     type DefaultValueClauseForInsert = MysqlStyleDefaultValueClause;
 
     type EmptyFromClauseSyntax = sql_dialect::from_clause_syntax::AnsiSqlFromClauseSyntax;
-    type ExistsSyntax = sql_dialect::exists_syntax::AnsiSqlExistsSyntax;
+    type SelectStatementSyntax = sql_dialect::select_statement_syntax::AnsiSqlSelectStatement;
 
+    type ExistsSyntax = sql_dialect::exists_syntax::AnsiSqlExistsSyntax;
     type ArrayComparison = sql_dialect::array_comparison::AnsiSqlArrayComparison;
+
+    type ConcatClause = MysqlConcatClause;
 }
 
 impl DieselReserveSpecialization for Mysql {}
@@ -97,3 +100,6 @@ impl TrustedBackend for Mysql {}
 
 #[derive(Debug, Clone, Copy)]
 pub struct MysqlStyleDefaultValueClause;
+
+#[derive(Debug, Clone, Copy)]
+pub struct MysqlConcatClause;
diff --git a/diesel/src/mysql/connection/bind.rs b/diesel/src/mysql/connection/bind.rs
index 7ae8bd54dddd..dfdb7676ef72 100644
--- a/diesel/src/mysql/connection/bind.rs
+++ b/diesel/src/mysql/connection/bind.rs
@@ -206,9 +206,9 @@ impl Drop for BindData {
             std::mem::drop(unsafe {
                 // We know that this buffer was allocated by a vector, so constructing a vector from it is fine
                 // We know the correct capacity here
-                // We use 0 as lenght to prevent situations where the lenght is already updated but
+                // We use 0 as length to prevent situations where the length is already updated but
                 // no date are already written as we could touch uninitialized memory otherwise
-                // Using 0 as lenght is fine as we don't need to call drop for `u8`
+                // Using 0 as length is fine as we don't need to call drop for `u8`
                 // (as there is no drop impl for primitive types)
                 Vec::from_raw_parts(bytes.as_ptr(), 0, self.capacity)
             });
@@ -501,7 +501,7 @@ impl BindData {
                 Some((bind, offset))
             } else {
                 // offset is zero here as we don't have a buffer yet
-                // we know the requested lenght here so we can just request
+                // we know the requested length here so we can just request
                 // the correct size
                 let mut vec = vec![0_u8; self.length as usize];
                 self.capacity = vec.capacity();
diff --git a/diesel/src/mysql/connection/mod.rs b/diesel/src/mysql/connection/mod.rs
index 93f510d95632..00cec1d77f78 100644
--- a/diesel/src/mysql/connection/mod.rs
+++ b/diesel/src/mysql/connection/mod.rs
@@ -205,15 +205,7 @@ impl crate::r2d2::R2D2Connection for MysqlConnection {
     }
 
     fn is_broken(&mut self) -> bool {
-        match self.transaction_state.status.transaction_depth() {
-            // all transactions are closed
-            // so we don't consider this connection broken
-            Ok(None) => false,
-            // The transaction manager is in an error state
-            // or contains an open transaction
-            // Therefore we consider this connection broken
-            Err(_) | Ok(Some(_)) => true,
-        }
+        AnsiTransactionManager::is_broken_transaction_manager(self)
     }
 }
 
@@ -236,8 +228,6 @@ fn prepared_query<'a, T: QueryFragment<Mysql> + QueryId>(
 
 impl MysqlConnection {
     fn set_config_options(&mut self) -> QueryResult<()> {
-        crate::sql_query("SET sql_mode=(SELECT CONCAT(@@sql_mode, ',PIPES_AS_CONCAT'))")
-            .execute(self)?;
         crate::sql_query("SET time_zone = '+00:00';").execute(self)?;
         crate::sql_query("SET character_set_client = 'utf8mb4'").execute(self)?;
         crate::sql_query("SET character_set_connection = 'utf8mb4'").execute(self)?;
diff --git a/diesel/src/mysql/connection/stmt/iterator.rs b/diesel/src/mysql/connection/stmt/iterator.rs
index cb307d3d8b97..078fa54d0375 100644
--- a/diesel/src/mysql/connection/stmt/iterator.rs
+++ b/diesel/src/mysql/connection/stmt/iterator.rs
@@ -225,6 +225,7 @@ impl<'a> Field<'a, Mysql> for MysqlField<'a> {
 }
 
 #[test]
+#[allow(clippy::drop_non_drop)] // we want to explicitly extend lifetimes here
 fn fun_with_row_iters() {
     crate::table! {
         #[allow(unused_parens)]
diff --git a/diesel/src/mysql/mod.rs b/diesel/src/mysql/mod.rs
index 916dfbc4f75c..97d512aa2486 100644
--- a/diesel/src/mysql/mod.rs
+++ b/diesel/src/mysql/mod.rs
@@ -18,7 +18,7 @@ pub use self::connection::MysqlConnection;
 pub use self::query_builder::MysqlQueryBuilder;
 pub use self::value::{MysqlValue, NumericRepresentation};
 
-/// Data structures for MysqSQL types which have no corresponding Rust type
+/// Data structures for MySQL types which have no corresponding Rust type
 ///
 /// Most of these types are used to implement `ToSql` and `FromSql` for higher
 /// level types.
diff --git a/diesel/src/mysql/query_builder/query_fragment_impls.rs b/diesel/src/mysql/query_builder/query_fragment_impls.rs
index 5ad794ffca0b..1afc3a9910cf 100644
--- a/diesel/src/mysql/query_builder/query_fragment_impls.rs
+++ b/diesel/src/mysql/query_builder/query_fragment_impls.rs
@@ -1,3 +1,4 @@
+use crate::expression::operators::Concat;
 use crate::mysql::Mysql;
 use crate::query_builder::insert_statement::DefaultValues;
 use crate::query_builder::locking_clause::{ForShare, ForUpdate, NoModifier, NoWait, SkipLocked};
@@ -44,3 +45,21 @@ impl QueryFragment<Mysql, crate::mysql::backend::MysqlStyleDefaultValueClause> f
         Ok(())
     }
 }
+
+impl<L, R> QueryFragment<Mysql, crate::mysql::backend::MysqlConcatClause> for Concat<L, R>
+where
+    L: QueryFragment<Mysql>,
+    R: QueryFragment<Mysql>,
+{
+    fn walk_ast<'b>(
+        &'b self,
+        mut out: crate::query_builder::AstPass<'_, 'b, Mysql>,
+    ) -> crate::result::QueryResult<()> {
+        out.push_sql("CONCAT(");
+        self.left.walk_ast(out.reborrow())?;
+        out.push_sql(",");
+        self.right.walk_ast(out.reborrow())?;
+        out.push_sql(")");
+        Ok(())
+    }
+}
diff --git a/diesel/src/mysql/types/date_and_time.rs b/diesel/src/mysql/types/date_and_time/chrono.rs
similarity index 59%
rename from diesel/src/mysql/types/date_and_time.rs
rename to diesel/src/mysql/types/date_and_time/chrono.rs
index 7479a689a41e..e87e62cceb40 100644
--- a/diesel/src/mysql/types/date_and_time.rs
+++ b/diesel/src/mysql/types/date_and_time/chrono.rs
@@ -1,140 +1,12 @@
-#[cfg(feature = "chrono")]
-use chrono::*;
-use std::io::Write;
+use chrono::{Datelike, NaiveDate, NaiveDateTime, NaiveTime, Timelike};
 use std::os::raw as libc;
-use std::{mem, slice};
 
-use crate::deserialize::{self, FromSql, FromSqlRow};
-use crate::expression::AsExpression;
+use crate::deserialize::{self, FromSql};
 use crate::mysql::{Mysql, MysqlValue};
-use crate::serialize::{self, IsNull, Output, ToSql};
+use crate::serialize::{self, Output, ToSql};
 use crate::sql_types::{Date, Datetime, Time, Timestamp};
 
-// This is a type from libmysqlclient
-// we have our own copy here to not break the
-// public API as soon as this type changes
-// in the mysqlclient-sys dependency
-/// Corresponding rust representation of the
-/// [MYSQL_TIME](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html)
-/// struct from libmysqlclient
-#[repr(C)]
-#[derive(Debug, Clone, Copy, AsExpression, FromSqlRow)]
-#[non_exhaustive]
-#[diesel(sql_type = Timestamp)]
-#[diesel(sql_type = Time)]
-#[diesel(sql_type = Date)]
-#[diesel(sql_type = Datetime)]
-pub struct MysqlTime {
-    /// [Year field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#af585231d3ed0bc2fa389856e61e15d4e)
-    pub year: libc::c_uint,
-    /// [Month field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#ad3e92bddbd9ccf2e50117bdd51c235a2)
-    pub month: libc::c_uint,
-    /// [Day field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#ad51088bd5ab4ddc02e62d778d71ed808)
-    pub day: libc::c_uint,
-    /// [Hour field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#a7717a9c4de23a22863fe9c20b0706274)
-    pub hour: libc::c_uint,
-    /// [Minute field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#acfad0dafd22da03a527c58fdebfa9d14)
-    pub minute: libc::c_uint,
-    /// [Second field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#a4cceb29d1a457f2ea961ce0d893814da)
-    pub second: libc::c_uint,
-    /// [Microseconds](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#a2e0fddb071af25ff478d16dc5514ba71)
-    pub second_part: libc::c_ulong,
-    /// [Is this a negative timestamp](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#af13161fbff85e4fe0ec9cd49b6eac1b8)
-    pub neg: bool,
-    /// [Timestamp type](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#a5331236f9b527a6e6b5f23d7c8058665)
-    pub time_type: MysqlTimestampType,
-    /// [Time zone displacement specified is seconds](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#a07f3c8e1989c9805ba919d2120c8fed4)
-    pub time_zone_displacement: libc::c_int,
-}
-
-impl MysqlTime {
-    /// Construct a new instance of [MysqlTime]
-    #[allow(clippy::too_many_arguments)]
-    pub fn new(
-        year: libc::c_uint,
-        month: libc::c_uint,
-        day: libc::c_uint,
-        hour: libc::c_uint,
-        minute: libc::c_uint,
-        second: libc::c_uint,
-        second_part: libc::c_ulong,
-        neg: bool,
-        time_type: MysqlTimestampType,
-        time_zone_displacement: libc::c_int,
-    ) -> Self {
-        Self {
-            year,
-            month,
-            day,
-            hour,
-            minute,
-            second,
-            second_part,
-            neg,
-            time_type,
-            time_zone_displacement,
-        }
-    }
-}
-
-// This is a type from libmysqlclient
-// we have our own copy here to not break the
-// public API as soon as this type changes
-// in the mysqlclient-sys dependency
-/// Rust representation of
-/// [enum_mysql_timestamp_type](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73)
-#[derive(PartialEq, Debug, Copy, Clone)]
-#[repr(transparent)]
-pub struct MysqlTimestampType(libc::c_int);
-
-impl MysqlTimestampType {
-    /// Rust representation of
-    /// [MYSQL_TIMESTAMP_NONE](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73ace26c6b7d67a27c905dbcd130b3bd807)
-    pub const MYSQL_TIMESTAMP_NONE: MysqlTimestampType = MysqlTimestampType(-2);
-    /// Rust representation of
-    /// [MYSQL_TIMESTAMP_ERROR](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73a3518624dcc1eaca8d816c52aa7528f72)
-    pub const MYSQL_TIMESTAMP_ERROR: MysqlTimestampType = MysqlTimestampType(-1);
-    /// Rust representation of
-    /// [MYSQL_TIMESTAMP_DATE](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73a9e0845dc169b1f0056d2ffa3780c3f4e)
-    pub const MYSQL_TIMESTAMP_DATE: MysqlTimestampType = MysqlTimestampType(0);
-    /// Rust representation of
-    /// [MYSQL_TIMESTAMP_DATETIME](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73a8f6d8f066ea6ea77280c6a0baf063ce1)
-    pub const MYSQL_TIMESTAMP_DATETIME: MysqlTimestampType = MysqlTimestampType(1);
-    /// Rust representation of
-    /// [MYSQL_TIMESTAMP_TIME](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73a283c50fa3c62a2e17ad5173442edbbb9)
-    pub const MYSQL_TIMESTAMP_TIME: MysqlTimestampType = MysqlTimestampType(2);
-    /// Rust representation of
-    /// [MYSQL_TIMESTAMP_DATETIME_TZ](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73a7afc91f565961eb5f3beebfebe7243a2)
-    pub const MYSQL_TIMESTAMP_DATETIME_TZ: MysqlTimestampType = MysqlTimestampType(3);
-}
-
-macro_rules! mysql_time_impls {
-    ($ty:ty) => {
-        #[cfg(feature = "mysql_backend")]
-        impl ToSql<$ty, Mysql> for MysqlTime {
-            fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> serialize::Result {
-                let bytes = unsafe {
-                    let bytes_ptr = self as *const MysqlTime as *const u8;
-                    slice::from_raw_parts(bytes_ptr, mem::size_of::<MysqlTime>())
-                };
-                out.write_all(bytes)?;
-                Ok(IsNull::No)
-            }
-        }
-
-        #[cfg(feature = "mysql_backend")]
-        impl FromSql<$ty, Mysql> for MysqlTime {
-            fn from_sql(value: MysqlValue<'_>) -> deserialize::Result<Self> {
-                value.time_value()
-            }
-        }
-    };
-}
-
-mysql_time_impls!(Datetime);
-mysql_time_impls!(Timestamp);
-mysql_time_impls!(Time);
-mysql_time_impls!(Date);
+use super::{MysqlTime, MysqlTimestampType};
 
 #[cfg(all(feature = "chrono", feature = "mysql_backend"))]
 impl ToSql<Datetime, Mysql> for NaiveDateTime {
@@ -258,7 +130,7 @@ impl FromSql<Date, Mysql> for NaiveDate {
     }
 }
 
-#[cfg(all(test, feature = "chrono"))]
+#[cfg(test)]
 mod tests {
     extern crate chrono;
     extern crate dotenvy;
diff --git a/diesel/src/mysql/types/date_and_time/mod.rs b/diesel/src/mysql/types/date_and_time/mod.rs
new file mode 100644
index 000000000000..645a1cac93cf
--- /dev/null
+++ b/diesel/src/mysql/types/date_and_time/mod.rs
@@ -0,0 +1,140 @@
+use std::io::Write;
+use std::os::raw as libc;
+use std::{mem, slice};
+
+use crate::deserialize::{self, FromSql, FromSqlRow};
+use crate::expression::AsExpression;
+use crate::mysql::{Mysql, MysqlValue};
+use crate::serialize::{self, IsNull, Output, ToSql};
+use crate::sql_types::{Date, Datetime, Time, Timestamp};
+
+#[cfg(feature = "chrono")]
+mod chrono;
+#[cfg(feature = "time")]
+mod time;
+
+// This is a type from libmysqlclient
+// we have our own copy here to not break the
+// public API as soon as this type changes
+// in the mysqlclient-sys dependency
+/// Corresponding rust representation of the
+/// [MYSQL_TIME](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html)
+/// struct from libmysqlclient
+#[repr(C)]
+#[derive(Debug, Clone, Copy, AsExpression, FromSqlRow)]
+#[non_exhaustive]
+#[diesel(sql_type = Timestamp)]
+#[diesel(sql_type = Time)]
+#[diesel(sql_type = Date)]
+#[diesel(sql_type = Datetime)]
+pub struct MysqlTime {
+    /// [Year field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#af585231d3ed0bc2fa389856e61e15d4e)
+    pub year: libc::c_uint,
+    /// [Month field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#ad3e92bddbd9ccf2e50117bdd51c235a2)
+    pub month: libc::c_uint,
+    /// [Day field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#ad51088bd5ab4ddc02e62d778d71ed808)
+    pub day: libc::c_uint,
+    /// [Hour field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#a7717a9c4de23a22863fe9c20b0706274)
+    pub hour: libc::c_uint,
+    /// [Minute field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#acfad0dafd22da03a527c58fdebfa9d14)
+    pub minute: libc::c_uint,
+    /// [Second field](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#a4cceb29d1a457f2ea961ce0d893814da)
+    pub second: libc::c_uint,
+    /// [Microseconds](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#a2e0fddb071af25ff478d16dc5514ba71)
+    pub second_part: libc::c_ulong,
+    /// [Is this a negative timestamp](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#af13161fbff85e4fe0ec9cd49b6eac1b8)
+    pub neg: bool,
+    /// [Timestamp type](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#a5331236f9b527a6e6b5f23d7c8058665)
+    pub time_type: MysqlTimestampType,
+    /// [Time zone displacement specified is seconds](https://dev.mysql.com/doc/dev/mysql-server/latest/structMYSQL__TIME.html#a07f3c8e1989c9805ba919d2120c8fed4)
+    pub time_zone_displacement: libc::c_int,
+}
+
+impl MysqlTime {
+    /// Construct a new instance of [MysqlTime]
+    #[allow(clippy::too_many_arguments)]
+    pub fn new(
+        year: libc::c_uint,
+        month: libc::c_uint,
+        day: libc::c_uint,
+        hour: libc::c_uint,
+        minute: libc::c_uint,
+        second: libc::c_uint,
+        second_part: libc::c_ulong,
+        neg: bool,
+        time_type: MysqlTimestampType,
+        time_zone_displacement: libc::c_int,
+    ) -> Self {
+        Self {
+            year,
+            month,
+            day,
+            hour,
+            minute,
+            second,
+            second_part,
+            neg,
+            time_type,
+            time_zone_displacement,
+        }
+    }
+}
+
+// This is a type from libmysqlclient
+// we have our own copy here to not break the
+// public API as soon as this type changes
+// in the mysqlclient-sys dependency
+/// Rust representation of
+/// [enum_mysql_timestamp_type](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73)
+#[derive(PartialEq, Debug, Copy, Clone, Eq)]
+#[repr(transparent)]
+pub struct MysqlTimestampType(libc::c_int);
+
+impl MysqlTimestampType {
+    /// Rust representation of
+    /// [MYSQL_TIMESTAMP_NONE](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73ace26c6b7d67a27c905dbcd130b3bd807)
+    pub const MYSQL_TIMESTAMP_NONE: MysqlTimestampType = MysqlTimestampType(-2);
+    /// Rust representation of
+    /// [MYSQL_TIMESTAMP_ERROR](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73a3518624dcc1eaca8d816c52aa7528f72)
+    pub const MYSQL_TIMESTAMP_ERROR: MysqlTimestampType = MysqlTimestampType(-1);
+    /// Rust representation of
+    /// [MYSQL_TIMESTAMP_DATE](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73a9e0845dc169b1f0056d2ffa3780c3f4e)
+    pub const MYSQL_TIMESTAMP_DATE: MysqlTimestampType = MysqlTimestampType(0);
+    /// Rust representation of
+    /// [MYSQL_TIMESTAMP_DATETIME](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73a8f6d8f066ea6ea77280c6a0baf063ce1)
+    pub const MYSQL_TIMESTAMP_DATETIME: MysqlTimestampType = MysqlTimestampType(1);
+    /// Rust representation of
+    /// [MYSQL_TIMESTAMP_TIME](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73a283c50fa3c62a2e17ad5173442edbbb9)
+    pub const MYSQL_TIMESTAMP_TIME: MysqlTimestampType = MysqlTimestampType(2);
+    /// Rust representation of
+    /// [MYSQL_TIMESTAMP_DATETIME_TZ](https://dev.mysql.com/doc/dev/mysql-server/latest/mysql__time_8h.html#aa633db8da896a5a0cc00ffcfb7477e73a7afc91f565961eb5f3beebfebe7243a2)
+    pub const MYSQL_TIMESTAMP_DATETIME_TZ: MysqlTimestampType = MysqlTimestampType(3);
+}
+
+macro_rules! mysql_time_impls {
+    ($ty:ty) => {
+        #[cfg(feature = "mysql_backend")]
+        impl ToSql<$ty, Mysql> for MysqlTime {
+            fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> serialize::Result {
+                let bytes = unsafe {
+                    let bytes_ptr = self as *const MysqlTime as *const u8;
+                    slice::from_raw_parts(bytes_ptr, mem::size_of::<MysqlTime>())
+                };
+                out.write_all(bytes)?;
+                Ok(IsNull::No)
+            }
+        }
+
+        #[cfg(feature = "mysql_backend")]
+        impl FromSql<$ty, Mysql> for MysqlTime {
+            fn from_sql(value: MysqlValue<'_>) -> deserialize::Result<Self> {
+                value.time_value()
+            }
+        }
+    };
+}
+
+mysql_time_impls!(Datetime);
+mysql_time_impls!(Timestamp);
+mysql_time_impls!(Time);
+mysql_time_impls!(Date);
diff --git a/diesel/src/mysql/types/date_and_time/time.rs b/diesel/src/mysql/types/date_and_time/time.rs
new file mode 100644
index 000000000000..f670c14de271
--- /dev/null
+++ b/diesel/src/mysql/types/date_and_time/time.rs
@@ -0,0 +1,332 @@
+use std::convert::TryInto;
+use std::os::raw as libc;
+use time::{
+    Date as NaiveDate, Month, OffsetDateTime, PrimitiveDateTime, Time as NaiveTime, UtcOffset,
+};
+
+use crate::deserialize::{self, FromSql};
+use crate::mysql::{Mysql, MysqlValue};
+use crate::serialize::{self, Output, ToSql};
+use crate::sql_types::{Date, Datetime, Time, Timestamp};
+
+use super::{MysqlTime, MysqlTimestampType};
+
+fn to_time(dt: MysqlTime) -> Result<NaiveTime, Box<dyn std::error::Error>> {
+    for (name, field) in [
+        ("year", dt.year),
+        ("month", dt.month),
+        ("day", dt.day),
+        ("offset", dt.time_zone_displacement as u32),
+    ] {
+        if field != 0 {
+            return Err(format!("Unable to convert {:?} to time: {} must be 0", dt, name).into());
+        }
+    }
+
+    let hour: u8 = dt.hour.try_into()?;
+    let minute: u8 = dt.minute.try_into()?;
+    let second: u8 = dt.second.try_into()?;
+    let microsecond: u32 = dt.second_part.try_into()?;
+
+    Ok(NaiveTime::from_hms_micro(
+        hour,
+        minute,
+        second,
+        microsecond,
+    )?)
+}
+
+fn to_datetime(dt: MysqlTime) -> Result<OffsetDateTime, Box<dyn std::error::Error>> {
+    let year: i32 = dt.year.try_into()?;
+    let month: u8 = dt.month.try_into()?;
+    let month: Month = month.try_into()?;
+    let day: u8 = dt.day.try_into()?;
+    let hour: u8 = dt.hour.try_into()?;
+    let minute: u8 = dt.minute.try_into()?;
+    let second: u8 = dt.second.try_into()?;
+    let microsecond: u32 = dt.second_part.try_into()?;
+    let offset = UtcOffset::from_whole_seconds(dt.time_zone_displacement)?;
+
+    Ok(PrimitiveDateTime::new(
+        NaiveDate::from_calendar_date(year, month, day)?,
+        NaiveTime::from_hms_micro(hour, minute, second, microsecond)?,
+    )
+    .assume_offset(offset))
+}
+
+fn to_primitive_datetime(dt: OffsetDateTime) -> PrimitiveDateTime {
+    let dt = dt.to_offset(UtcOffset::UTC);
+    PrimitiveDateTime::new(dt.date(), dt.time())
+}
+
+// Mysql datetime column has a wider range than timestamp column, so let's implement the fundamental operations in terms of datetime.
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl ToSql<Datetime, Mysql> for PrimitiveDateTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> serialize::Result {
+        let mysql_time = MysqlTime {
+            year: self.year() as libc::c_uint,
+            month: self.month() as libc::c_uint,
+            day: self.day() as libc::c_uint,
+            hour: self.hour() as libc::c_uint,
+            minute: self.minute() as libc::c_uint,
+            second: self.second() as libc::c_uint,
+            second_part: libc::c_ulong::from(self.microsecond()),
+            neg: false,
+            time_type: MysqlTimestampType::MYSQL_TIMESTAMP_DATETIME,
+            time_zone_displacement: 0,
+        };
+
+        <MysqlTime as ToSql<Timestamp, Mysql>>::to_sql(&mysql_time, &mut out.reborrow())
+    }
+}
+
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl FromSql<Datetime, Mysql> for PrimitiveDateTime {
+    fn from_sql(bytes: MysqlValue<'_>) -> deserialize::Result<Self> {
+        let mysql_time = <MysqlTime as FromSql<Timestamp, Mysql>>::from_sql(bytes)?;
+
+        to_datetime(mysql_time)
+            .map(to_primitive_datetime)
+            .map_err(|err| format!("Cannot parse this date: {:?}: {}", mysql_time, err).into())
+    }
+}
+
+// We can implement timestamps in terms of datetimes
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl ToSql<Timestamp, Mysql> for PrimitiveDateTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> serialize::Result {
+        <PrimitiveDateTime as ToSql<Datetime, Mysql>>::to_sql(self, out)
+    }
+}
+
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl FromSql<Timestamp, Mysql> for PrimitiveDateTime {
+    fn from_sql(bytes: MysqlValue<'_>) -> deserialize::Result<Self> {
+        <PrimitiveDateTime as FromSql<Datetime, Mysql>>::from_sql(bytes)
+    }
+}
+
+// Delegate offset datetimes in terms of UTC primitive datetimes; this stores everything in the DB as UTC
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl ToSql<Datetime, Mysql> for OffsetDateTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> serialize::Result {
+        let prim = to_primitive_datetime(*self);
+        <PrimitiveDateTime as ToSql<Datetime, Mysql>>::to_sql(&prim, &mut out.reborrow())
+    }
+}
+
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl FromSql<Datetime, Mysql> for OffsetDateTime {
+    fn from_sql(bytes: MysqlValue<'_>) -> deserialize::Result<Self> {
+        let prim = <PrimitiveDateTime as FromSql<Datetime, Mysql>>::from_sql(bytes)?;
+        Ok(prim.assume_offset(UtcOffset::UTC))
+    }
+}
+
+// delegate timestamp column to datetime colum for offset datetimes
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl ToSql<Timestamp, Mysql> for OffsetDateTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> serialize::Result {
+        <OffsetDateTime as ToSql<Datetime, Mysql>>::to_sql(self, out)
+    }
+}
+
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl FromSql<Timestamp, Mysql> for OffsetDateTime {
+    fn from_sql(bytes: MysqlValue<'_>) -> deserialize::Result<Self> {
+        <OffsetDateTime as FromSql<Datetime, Mysql>>::from_sql(bytes)
+    }
+}
+
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl ToSql<Time, Mysql> for NaiveTime {
+    fn to_sql<'b>(&'b self, out: &mut serialize::Output<'b, '_, Mysql>) -> serialize::Result {
+        let mysql_time = MysqlTime {
+            hour: self.hour() as libc::c_uint,
+            minute: self.minute() as libc::c_uint,
+            second: self.second() as libc::c_uint,
+            day: 0,
+            month: 0,
+            second_part: 0,
+            year: 0,
+            neg: false,
+            time_type: MysqlTimestampType::MYSQL_TIMESTAMP_TIME,
+            time_zone_displacement: 0,
+        };
+
+        <MysqlTime as ToSql<Time, Mysql>>::to_sql(&mysql_time, &mut out.reborrow())
+    }
+}
+
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl FromSql<Time, Mysql> for NaiveTime {
+    fn from_sql(bytes: MysqlValue<'_>) -> deserialize::Result<Self> {
+        let mysql_time = <MysqlTime as FromSql<Time, Mysql>>::from_sql(bytes)?;
+
+        to_time(mysql_time)
+            .map_err(|err| format!("Unable to convert {:?} to time: {}", mysql_time, err).into())
+    }
+}
+
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl ToSql<Date, Mysql> for NaiveDate {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> serialize::Result {
+        let mysql_time = MysqlTime {
+            year: self.year() as libc::c_uint,
+            month: self.month() as libc::c_uint,
+            day: self.day() as libc::c_uint,
+            hour: 0,
+            minute: 0,
+            second: 0,
+            second_part: 0,
+            neg: false,
+            time_type: MysqlTimestampType::MYSQL_TIMESTAMP_DATE,
+            time_zone_displacement: 0,
+        };
+
+        <MysqlTime as ToSql<Date, Mysql>>::to_sql(&mysql_time, &mut out.reborrow())
+    }
+}
+
+#[cfg(all(feature = "time", feature = "mysql_backend"))]
+impl FromSql<Date, Mysql> for NaiveDate {
+    fn from_sql(bytes: MysqlValue<'_>) -> deserialize::Result<Self> {
+        let mysql_time = <MysqlTime as FromSql<Date, Mysql>>::from_sql(bytes)?;
+
+        to_datetime(mysql_time)
+            .map_err(|err| format!("Unable to convert {:?} to time: {}", mysql_time, err).into())
+            .and_then(|dt| {
+                let prim = to_primitive_datetime(dt);
+                if prim.time() == NaiveTime::MIDNIGHT {
+                    Ok(prim.date())
+                } else {
+                    Err(format!("Unable to convert {:?} to date: non-0 time part", prim).into())
+                }
+            })
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    extern crate dotenvy;
+    extern crate time;
+
+    use time::{
+        macros::{date, datetime, time},
+        Date as NaiveDate, Duration, OffsetDateTime, Time as NaiveTime,
+    };
+
+    use super::to_primitive_datetime;
+
+    use crate::dsl::{now, sql};
+    use crate::prelude::*;
+    use crate::select;
+    use crate::sql_types::{Date, Datetime, Time, Timestamp};
+    use crate::test_helpers::connection;
+
+    #[test]
+    fn unix_epoch_encodes_correctly() {
+        let connection = &mut connection();
+        let time = datetime!(1970-1-1 0:0:0);
+        let query = select(sql::<Timestamp>("CAST('1970-01-01' AS DATETIME)").eq(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+        let query = select(sql::<Datetime>("CAST('1970-01-01' AS DATETIME)").eq(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn unix_epoch_decodes_correctly() {
+        let connection = &mut connection();
+        let time = datetime!(1970-1-1 0:0:0);
+        let epoch_from_sql =
+            select(sql::<Timestamp>("CAST('1970-01-01' AS DATETIME)")).get_result(connection);
+        assert_eq!(Ok(time), epoch_from_sql);
+        let epoch_from_sql =
+            select(sql::<Datetime>("CAST('1970-01-01' AS DATETIME)")).get_result(connection);
+        assert_eq!(Ok(time), epoch_from_sql);
+    }
+
+    #[test]
+    fn times_relative_to_now_encode_correctly() {
+        let connection = &mut connection();
+        let time = to_primitive_datetime(OffsetDateTime::now_utc()) + Duration::days(1);
+        let query = select(now.lt(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let time = to_primitive_datetime(OffsetDateTime::now_utc()) - Duration::days(1);
+        let query = select(now.gt(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn times_of_day_encode_correctly() {
+        let connection = &mut connection();
+
+        let midnight = time!(0:0:0);
+        let query = select(sql::<Time>("CAST('00:00:00' AS TIME)").eq(midnight));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let noon = time!(12:0:0);
+        let query = select(sql::<Time>("CAST('12:00:00' AS TIME)").eq(noon));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let roughly_half_past_eleven = time!(23:37:4);
+        let query = select(sql::<Time>("CAST('23:37:04' AS TIME)").eq(roughly_half_past_eleven));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn times_of_day_decode_correctly() {
+        let connection = &mut connection();
+        let midnight = time!(0:0:0);
+        let query = select(sql::<Time>("CAST('00:00:00' AS TIME)"));
+        assert_eq!(Ok(midnight), query.get_result::<NaiveTime>(connection));
+
+        let noon = time!(12:0:0);
+        let query = select(sql::<Time>("CAST('12:00:00' AS TIME)"));
+        assert_eq!(Ok(noon), query.get_result::<NaiveTime>(connection));
+
+        let roughly_half_past_eleven = time!(23:37:4);
+        let query = select(sql::<Time>("CAST('23:37:04' AS TIME)"));
+        assert_eq!(
+            Ok(roughly_half_past_eleven),
+            query.get_result::<NaiveTime>(connection)
+        );
+    }
+
+    #[test]
+    fn dates_encode_correctly() {
+        let connection = &mut connection();
+        let january_first_2000 = date!(2000 - 1 - 1);
+        let query = select(sql::<Date>("CAST('2000-1-1' AS DATE)").eq(january_first_2000));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let january_first_2018 = date!(2018 - 1 - 1);
+        let query = select(sql::<Date>("CAST('2018-1-1' AS DATE)").eq(january_first_2018));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn dates_decode_correctly() {
+        let connection = &mut connection();
+        let january_first_2000 = date!(2000 - 1 - 1);
+        let query = select(sql::<Date>("CAST('2000-1-1' AS DATE)"));
+        assert_eq!(
+            Ok(january_first_2000),
+            query.get_result::<NaiveDate>(connection)
+        );
+
+        let january_first_2018 = date!(2018 - 1 - 1);
+        let query = select(sql::<Date>("CAST('2018-1-1' AS DATE)"));
+        assert_eq!(
+            Ok(january_first_2018),
+            query.get_result::<NaiveDate>(connection)
+        );
+
+        crate::sql_query("SET sql_mode = (SELECT REPLACE(@@sql_mode, 'NO_ZERO_DATE,', ''))")
+            .execute(connection)
+            .unwrap();
+        let query = select(sql::<Date>("CAST('0000-00-00' AS DATE)"));
+        assert!(query.get_result::<NaiveDate>(connection).is_err());
+    }
+}
diff --git a/diesel/src/mysql/types/mod.rs b/diesel/src/mysql/types/mod.rs
index 1e6ef65addec..c60a8fc0e53b 100644
--- a/diesel/src/mysql/types/mod.rs
+++ b/diesel/src/mysql/types/mod.rs
@@ -219,10 +219,14 @@ impl HasSqlType<Unsigned<BigInt>> for Mysql {
 /// ### [`ToSql`] impls
 ///
 /// - [`chrono::NaiveDateTime`] with `feature = "chrono"`
+/// - [`time::PrimitiveDateTime`] with `feature = "time"`
+/// - [`time::OffsetDateTime`] with `feature = "time"`
 ///
 /// ### [`FromSql`] impls
 ///
 /// - [`chrono::NaiveDateTime`] with `feature = "chrono"`
+/// - [`time::PrimitiveDateTime`] with `feature = "time"`
+/// - [`time::OffsetDateTime`] with `feature = "time"`
 ///
 /// [`ToSql`]: crate::serialize::ToSql
 /// [`FromSql`]: crate::deserialize::FromSql
@@ -234,6 +238,22 @@ impl HasSqlType<Unsigned<BigInt>> for Mysql {
     not(feature = "chrono"),
     doc = " [`chrono::NaiveDateTime`]: https://docs.rs/chrono/0.4.19/chrono/naive/struct.NaiveDateTime.html"
 )]
+#[cfg_attr(
+    feature = "time",
+    doc = " [`time::PrimitiveDateTime`]: time::PrimitiveDateTime"
+)]
+#[cfg_attr(
+    not(feature = "time"),
+    doc = " [`time::PrimitiveDateTime`]: https://docs.rs/time/0.3.9/time/struct.PrimitiveDateTime.html"
+)]
+#[cfg_attr(
+    feature = "time",
+    doc = " [`time::OffsetDateTime`]: time::OffsetDateTime"
+)]
+#[cfg_attr(
+    not(feature = "time"),
+    doc = " [`time::OffsetDateTime`]: https://docs.rs/time/0.3.9/time/struct.OffsetDateTime.html"
+)]
 #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)]
 #[diesel(mysql_type(name = "DateTime"))]
 #[cfg(feature = "mysql_backend")]
diff --git a/diesel/src/mysql/types/primitives.rs b/diesel/src/mysql/types/primitives.rs
index 21d9e85b9a29..d79246b4c82b 100644
--- a/diesel/src/mysql/types/primitives.rs
+++ b/diesel/src/mysql/types/primitives.rs
@@ -153,16 +153,27 @@ impl FromSql<Double, Mysql> for f64 {
     }
 }
 
+/// The returned pointer is *only* valid for the lifetime to the argument of
+/// `from_sql`. This impl is intended for uses where you want to write a new
+/// impl in terms of `String`, but don't want to allocate. We have to return a
+/// raw pointer instead of a reference with a lifetime due to the structure of
+/// `FromSql`
 #[cfg(feature = "mysql_backend")]
-impl FromSql<Text, Mysql> for String {
+impl FromSql<Text, Mysql> for *const str {
     fn from_sql(value: MysqlValue<'_>) -> deserialize::Result<Self> {
-        String::from_utf8(value.as_bytes().into()).map_err(Into::into)
+        let string = str::from_utf8(value.as_bytes())?;
+        Ok(string as *const str)
     }
 }
 
+/// The returned pointer is *only* valid for the lifetime to the argument of
+/// `from_sql`. This impl is intended for uses where you want to write a new
+/// impl in terms of `Vec<u8>`, but don't want to allocate. We have to return a
+/// raw pointer instead of a reference with a lifetime due to the structure of
+/// `FromSql`
 #[cfg(feature = "mysql_backend")]
-impl FromSql<Binary, Mysql> for Vec<u8> {
+impl FromSql<Binary, Mysql> for *const [u8] {
     fn from_sql(value: MysqlValue<'_>) -> deserialize::Result<Self> {
-        Ok(value.as_bytes().into())
+        Ok(value.as_bytes() as *const [u8])
     }
 }
diff --git a/diesel/src/pg/backend.rs b/diesel/src/pg/backend.rs
index ec56e04a76ec..140564c221f1 100644
--- a/diesel/src/pg/backend.rs
+++ b/diesel/src/pg/backend.rs
@@ -87,7 +87,7 @@ impl PgTypeMetadata {
 
     /// Create a new instance of this type based on dynamically lookup informations
     ///
-    /// This function is usfull for third party crates that may implement a custom
+    /// This function is useful for third party crates that may implement a custom
     /// postgres connection type and want to bring their own lookup mechanism.
     ///
     /// Otherwise refer to [PgMetadataLookup] for a way to automatically
@@ -136,9 +136,13 @@ impl SqlDialect for Pg {
 
     type InsertWithDefaultKeyword = sql_dialect::default_keyword_for_insert::IsoSqlDefaultKeyword;
     type BatchInsertSupport = sql_dialect::batch_insert_support::PostgresLikeBatchInsertSupport;
+    type ConcatClause = sql_dialect::concat_clause::ConcatWithPipesClause;
+
     type DefaultValueClauseForInsert = sql_dialect::default_value_clause::AnsiDefaultValueClause;
 
     type EmptyFromClauseSyntax = sql_dialect::from_clause_syntax::AnsiSqlFromClauseSyntax;
+    type SelectStatementSyntax = sql_dialect::select_statement_syntax::AnsiSqlSelectStatement;
+
     type ExistsSyntax = sql_dialect::exists_syntax::AnsiSqlExistsSyntax;
     type ArrayComparison = PgStyleArrayComparision;
 }
diff --git a/diesel/src/pg/connection/mod.rs b/diesel/src/pg/connection/mod.rs
index 90a4fc57ba89..fd2130da9aff 100644
--- a/diesel/src/pg/connection/mod.rs
+++ b/diesel/src/pg/connection/mod.rs
@@ -280,20 +280,7 @@ impl crate::r2d2::R2D2Connection for PgConnection {
     }
 
     fn is_broken(&mut self) -> bool {
-        match self
-            .connection_and_transaction_manager
-            .transaction_state
-            .status
-            .transaction_depth()
-        {
-            // all transactions are closed
-            // so we don't consider this connection broken
-            Ok(None) => false,
-            // The transaction manager is in an error state
-            // or contains an open transaction
-            // Therefore we consider this connection broken
-            Err(_) | Ok(Some(_)) => true,
-        }
+        AnsiTransactionManager::is_broken_transaction_manager(self)
     }
 }
 
diff --git a/diesel/src/pg/transaction.rs b/diesel/src/pg/transaction.rs
index d679416484f4..bf590cee8051 100644
--- a/diesel/src/pg/transaction.rs
+++ b/diesel/src/pg/transaction.rs
@@ -264,7 +264,7 @@ where
     ///
     /// This function executes the provided closure `f` inside a database
     /// transaction. If there is already an open transaction for the current
-    /// connection it will return an error. The connection is commited if
+    /// connection it will return an error. The connection is committed if
     /// the closure returns `Ok(_)`, it will be rolled back if it returns `Err(_)`.
     /// For both cases the original result value will be returned from this function.
     ///
diff --git a/diesel/src/pg/types/array.rs b/diesel/src/pg/types/array.rs
index e80eb3216810..63a210ca1dc3 100644
--- a/diesel/src/pg/types/array.rs
+++ b/diesel/src/pg/types/array.rs
@@ -112,8 +112,7 @@ where
         for elem in self.iter() {
             let is_null = {
                 let mut temp_buffer = Output::new(ByteWrapper(&mut buffer), out.metadata_lookup());
-                let is_null = elem.to_sql(&mut temp_buffer)?;
-                is_null
+                elem.to_sql(&mut temp_buffer)?
             };
 
             if let IsNull::No = is_null {
diff --git a/diesel/src/pg/types/date_and_time/chrono.rs b/diesel/src/pg/types/date_and_time/chrono.rs
index d1498aba01b0..48e523432521 100644
--- a/diesel/src/pg/types/date_and_time/chrono.rs
+++ b/diesel/src/pg/types/date_and_time/chrono.rs
@@ -2,8 +2,6 @@
 //! and `Timestamp` fields. It is enabled with the `chrono` feature.
 
 extern crate chrono;
-
-use self::chrono::naive::MAX_DATE;
 use self::chrono::{DateTime, Duration, Local, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc};
 
 use super::{PgDate, PgTime, PgTimestamp};
@@ -126,7 +124,10 @@ impl FromSql<Date, Pg> for NaiveDate {
         match pg_epoch_date().checked_add_signed(Duration::days(i64::from(offset))) {
             Some(date) => Ok(date),
             None => {
-                let error_message = format!("Chrono can only represent dates up to {:?}", MAX_DATE);
+                let error_message = format!(
+                    "Chrono can only represent dates up to {:?}",
+                    chrono::Date::<Utc>::MAX_UTC
+                );
                 Err(error_message.into())
             }
         }
@@ -138,7 +139,6 @@ mod tests {
     extern crate chrono;
     extern crate dotenvy;
 
-    use self::chrono::naive::MAX_DATE;
     use self::chrono::{Duration, FixedOffset, NaiveDate, NaiveTime, TimeZone, Utc};
 
     use crate::dsl::{now, sql};
@@ -261,7 +261,7 @@ mod tests {
         let query = select(sql::<Date>("'J0'::date").eq(julian_epoch));
         assert!(query.get_result::<bool>(connection).unwrap());
 
-        let max_date = MAX_DATE;
+        let max_date = NaiveDate::MAX;
         let query = select(sql::<Date>("'262143-12-31'::date").eq(max_date));
         assert!(query.get_result::<bool>(connection).unwrap());
 
@@ -292,7 +292,7 @@ mod tests {
         let query = select(sql::<Date>("'J0'::date"));
         assert_eq!(Ok(julian_epoch), query.get_result::<NaiveDate>(connection));
 
-        let max_date = MAX_DATE;
+        let max_date = NaiveDate::MAX;
         let query = select(sql::<Date>("'262143-12-31'::date"));
         assert_eq!(Ok(max_date), query.get_result::<NaiveDate>(connection));
 
diff --git a/diesel/src/pg/types/date_and_time/mod.rs b/diesel/src/pg/types/date_and_time/mod.rs
index abc8d5ec99fc..ef87d78eea6c 100644
--- a/diesel/src/pg/types/date_and_time/mod.rs
+++ b/diesel/src/pg/types/date_and_time/mod.rs
@@ -11,6 +11,8 @@ mod chrono;
 #[cfg(feature = "quickcheck")]
 mod quickcheck_impls;
 mod std_time;
+#[cfg(feature = "time")]
+mod time;
 
 #[cfg(feature = "postgres_backend")]
 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, AsExpression, FromSqlRow)]
diff --git a/diesel/src/pg/types/date_and_time/time.rs b/diesel/src/pg/types/date_and_time/time.rs
new file mode 100644
index 000000000000..f75b56978026
--- /dev/null
+++ b/diesel/src/pg/types/date_and_time/time.rs
@@ -0,0 +1,305 @@
+//! This module makes it possible to map `time` date and time values to postgres `Date`
+//! and `Timestamp` fields. It is enabled with the `time` feature.
+
+extern crate time;
+
+use self::time::{
+    macros::{date, datetime},
+    Date as NaiveDate, Duration, OffsetDateTime, PrimitiveDateTime, Time as NaiveTime, UtcOffset,
+};
+
+use super::{PgDate, PgTime, PgTimestamp};
+use crate::deserialize::{self, FromSql};
+use crate::pg::{Pg, PgValue};
+use crate::serialize::{self, Output, ToSql};
+use crate::sql_types::{Date, Time, Timestamp, Timestamptz};
+
+// Postgres timestamps start from January 1st 2000.
+const PG_EPOCH: PrimitiveDateTime = datetime!(2000-1-1 0:00:00);
+
+#[cfg(all(feature = "time", feature = "postgres_backend"))]
+impl FromSql<Timestamp, Pg> for PrimitiveDateTime {
+    fn from_sql(bytes: PgValue<'_>) -> deserialize::Result<Self> {
+        let PgTimestamp(offset) = FromSql::<Timestamp, Pg>::from_sql(bytes)?;
+        match PG_EPOCH.checked_add(Duration::microseconds(offset)) {
+            Some(v) => Ok(v),
+            None => {
+                let message = "Tried to deserialize a timestamp that is too large for Time";
+                Err(message.into())
+            }
+        }
+    }
+}
+
+#[cfg(all(feature = "time", feature = "postgres_backend"))]
+impl ToSql<Timestamp, Pg> for PrimitiveDateTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> serialize::Result {
+        let micros = (*self - PG_EPOCH).whole_microseconds();
+        if micros > (i64::MAX as i128) {
+            let error_message = format!("{:?} as microseconds is too large to fit in an i64", self);
+            return Err(error_message.into());
+        }
+        let micros = micros as i64;
+        ToSql::<Timestamp, Pg>::to_sql(&PgTimestamp(micros), &mut out.reborrow())
+    }
+}
+
+#[cfg(all(feature = "time", feature = "postgres_backend"))]
+impl FromSql<Timestamptz, Pg> for PrimitiveDateTime {
+    fn from_sql(bytes: PgValue<'_>) -> deserialize::Result<Self> {
+        FromSql::<Timestamp, Pg>::from_sql(bytes)
+    }
+}
+
+#[cfg(all(feature = "time", feature = "postgres_backend"))]
+impl ToSql<Timestamptz, Pg> for PrimitiveDateTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> serialize::Result {
+        ToSql::<Timestamp, Pg>::to_sql(self, out)
+    }
+}
+
+#[cfg(all(feature = "time", feature = "postgres_backend"))]
+impl FromSql<Timestamptz, Pg> for OffsetDateTime {
+    fn from_sql(bytes: PgValue<'_>) -> deserialize::Result<Self> {
+        let primitive_date_time = <PrimitiveDateTime as FromSql<Timestamptz, Pg>>::from_sql(bytes)?;
+        Ok(primitive_date_time.assume_utc())
+    }
+}
+
+#[cfg(all(feature = "time", feature = "postgres_backend"))]
+impl ToSql<Timestamptz, Pg> for OffsetDateTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> serialize::Result {
+        let as_utc = self.to_offset(UtcOffset::UTC);
+        let primitive_date_time = PrimitiveDateTime::new(as_utc.date(), as_utc.time());
+        ToSql::<Timestamptz, Pg>::to_sql(&primitive_date_time, &mut out.reborrow())
+    }
+}
+
+#[cfg(all(feature = "time", feature = "postgres_backend"))]
+impl ToSql<Time, Pg> for NaiveTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> serialize::Result {
+        let duration = *self - NaiveTime::MIDNIGHT;
+        // microseconds in a day cannot overflow i64
+        let micros = duration.whole_microseconds() as i64;
+        ToSql::<Time, Pg>::to_sql(&PgTime(micros), &mut out.reborrow())
+    }
+}
+
+#[cfg(all(feature = "time", feature = "postgres_backend"))]
+impl FromSql<Time, Pg> for NaiveTime {
+    fn from_sql(bytes: PgValue<'_>) -> deserialize::Result<Self> {
+        let PgTime(offset) = FromSql::<Time, Pg>::from_sql(bytes)?;
+        let duration = Duration::microseconds(offset);
+        Ok(NaiveTime::MIDNIGHT + duration)
+    }
+}
+
+const PG_EPOCH_DATE: NaiveDate = date!(2000 - 1 - 1);
+
+#[cfg(all(feature = "time", feature = "postgres_backend"))]
+impl ToSql<Date, Pg> for NaiveDate {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> serialize::Result {
+        let days_since_epoch = (*self - PG_EPOCH_DATE).whole_days();
+        ToSql::<Date, Pg>::to_sql(&PgDate(days_since_epoch as i32), &mut out.reborrow())
+    }
+}
+
+#[cfg(all(feature = "time", feature = "postgres_backend"))]
+impl FromSql<Date, Pg> for NaiveDate {
+    fn from_sql(bytes: PgValue<'_>) -> deserialize::Result<Self> {
+        let PgDate(offset) = FromSql::<Date, Pg>::from_sql(bytes)?;
+        match PG_EPOCH_DATE.checked_add(Duration::days(i64::from(offset))) {
+            Some(date) => Ok(date),
+            None => {
+                let error_message =
+                    format!("Time can only represent dates up to {:?}", NaiveDate::MAX);
+                Err(error_message.into())
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    extern crate dotenvy;
+
+    use crate::dsl::{now, sql};
+    use crate::prelude::*;
+    use crate::select;
+    use crate::sql_types::{Date, Time, Timestamp, Timestamptz};
+    use crate::test_helpers::connection;
+
+    use time::{
+        macros::{date, datetime},
+        Date as NaiveDate, Duration, OffsetDateTime, PrimitiveDateTime, Time as NaiveTime,
+    };
+
+    fn naive_now() -> PrimitiveDateTime {
+        let offset_now = OffsetDateTime::now_utc();
+        PrimitiveDateTime::new(offset_now.date(), offset_now.time())
+    }
+
+    #[test]
+    fn unix_epoch_encodes_correctly() {
+        let connection = &mut connection();
+        let time = datetime!(1970-1-1 0:00:00);
+        let query = select(sql::<Timestamp>("'1970-01-01'").eq(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn unix_epoch_encodes_correctly_with_utc_timezone() {
+        let connection = &mut connection();
+        let time = datetime!(1970-1-1 0:00:00 utc);
+        let query = select(sql::<Timestamptz>("'1970-01-01Z'::timestamptz").eq(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn unix_epoch_encodes_correctly_with_timezone() {
+        let connection = &mut connection();
+        let time = datetime!(1970-1-1 0:00:00 -1:00);
+        let query = select(sql::<Timestamptz>("'1970-01-01 01:00:00Z'::timestamptz").eq(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn unix_epoch_decodes_correctly() {
+        let connection = &mut connection();
+        let time = datetime!(1970-1-1 0:0:0);
+        let epoch_from_sql =
+            select(sql::<Timestamp>("'1970-01-01'::timestamp")).get_result(connection);
+        assert_eq!(Ok(time), epoch_from_sql);
+    }
+
+    #[test]
+    fn unix_epoch_decodes_correctly_with_timezone() {
+        let connection = &mut connection();
+        let time = datetime!(1970-1-1 0:00:00 utc);
+        let epoch_from_sql =
+            select(sql::<Timestamptz>("'1970-01-01Z'::timestamptz")).get_result(connection);
+        assert_eq!(Ok(time), epoch_from_sql);
+    }
+
+    #[test]
+    fn times_relative_to_now_encode_correctly() {
+        let connection = &mut connection();
+        let time = naive_now() + Duration::seconds(60);
+        let query = select(now.at_time_zone("utc").lt(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let time = naive_now() - Duration::seconds(60);
+        let query = select(now.at_time_zone("utc").gt(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn times_with_timezones_round_trip_after_conversion() {
+        let connection = &mut connection();
+        let time = datetime!(2016-1-2 1:00:00 +1);
+        let expected = datetime!(2016-1-1 20:0:0);
+        let query = select(time.into_sql::<Timestamptz>().at_time_zone("EDT"));
+        assert_eq!(Ok(expected), query.get_result(connection));
+    }
+
+    #[test]
+    fn times_of_day_encode_correctly() {
+        let connection = &mut connection();
+
+        let query = select(sql::<Time>("'00:00:00'::time").eq(NaiveTime::MIDNIGHT));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let noon = NaiveTime::from_hms(12, 0, 0).expect("noon is a legal time");
+        let query = select(sql::<Time>("'12:00:00'::time").eq(noon));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let roughly_half_past_eleven =
+            NaiveTime::from_hms_micro(23, 37, 4, 2200).expect("this is also a legal time");
+        let query = select(sql::<Time>("'23:37:04.002200'::time").eq(roughly_half_past_eleven));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn times_of_day_decode_correctly() {
+        let connection = &mut connection();
+        let query = select(sql::<Time>("'00:00:00'::time"));
+        let result: Result<NaiveTime, _> = query.get_result(connection);
+        assert_eq!(Ok(NaiveTime::MIDNIGHT), result);
+
+        let noon = NaiveTime::from_hms(12, 0, 0).expect("this time is legal");
+        let query = select(sql::<Time>("'12:00:00'::time"));
+        let result: Result<NaiveTime, _> = query.get_result(connection);
+        assert_eq!(Ok(noon), result);
+
+        let roughly_half_past_eleven =
+            NaiveTime::from_hms_micro(23, 37, 4, 2200).expect("this time is legal");
+        let query = select(sql::<Time>("'23:37:04.002200'::time"));
+        let result: Result<NaiveTime, _> = query.get_result(connection);
+        assert_eq!(Ok(roughly_half_past_eleven), result);
+    }
+
+    #[test]
+    fn dates_encode_correctly() {
+        let connection = &mut connection();
+        let january_first_2000 = date!(2000 - 1 - 1);
+        let query = select(sql::<Date>("'2000-1-1'").eq(january_first_2000));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let distant_past = date!(-398 - 4 - 11); // year 0 is 1 BC in this function
+        let query = select(sql::<Date>("'399-4-11 BC'").eq(distant_past));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let julian_epoch = date!(-4713 - 11 - 24);
+        let query = select(sql::<Date>("'J0'::date").eq(julian_epoch));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let max_date = NaiveDate::MAX;
+        let query = select(sql::<Date>("'9999-12-31'::date").eq(max_date));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let january_first_2018 = date!(2018 - 1 - 1);
+        let query = select(sql::<Date>("'2018-1-1'::date").eq(january_first_2018));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let distant_future = date!(9999 - 1 - 8);
+        let query = select(sql::<Date>("'9999-1-8'::date").eq(distant_future));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn dates_decode_correctly() {
+        let connection = &mut connection();
+        let january_first_2000 = date!(2000 - 1 - 1);
+        let query = select(sql::<Date>("'2000-1-1'::date"));
+        assert_eq!(
+            Ok(january_first_2000),
+            query.get_result::<NaiveDate>(connection)
+        );
+
+        let distant_past = date!(-398 - 4 - 11);
+        let query = select(sql::<Date>("'399-4-11 BC'::date"));
+        assert_eq!(Ok(distant_past), query.get_result::<NaiveDate>(connection));
+
+        let julian_epoch = date!(-4713 - 11 - 24);
+        let query = select(sql::<Date>("'J0'::date"));
+        assert_eq!(Ok(julian_epoch), query.get_result::<NaiveDate>(connection));
+
+        let max_date = NaiveDate::MAX;
+        let query = select(sql::<Date>("'9999-12-31'::date"));
+        assert_eq!(Ok(max_date), query.get_result::<NaiveDate>(connection));
+
+        let january_first_2018 = date!(2018 - 1 - 1);
+        let query = select(sql::<Date>("'2018-1-1'::date"));
+        assert_eq!(
+            Ok(january_first_2018),
+            query.get_result::<NaiveDate>(connection)
+        );
+
+        let distant_future = date!(9999 - 1 - 8);
+        let query = select(sql::<Date>("'9999-1-8'::date"));
+        assert_eq!(
+            Ok(distant_future),
+            query.get_result::<NaiveDate>(connection)
+        );
+    }
+}
diff --git a/diesel/src/pg/types/mod.rs b/diesel/src/pg/types/mod.rs
index 4e0632e0487e..e00522ad681e 100644
--- a/diesel/src/pg/types/mod.rs
+++ b/diesel/src/pg/types/mod.rs
@@ -56,12 +56,16 @@ pub mod sql_types {
     /// - [`PgTimestamp`]
     /// - [`chrono::NaiveDateTime`] with `feature = "chrono"`
     /// - [`chrono::DateTime`] with `feature = "chrono"`
+    /// - [`time::PrimitiveDateTime`] with `feature = "time"`
+    /// - [`time::OffsetDateTime`] with `feature = "time"`
     ///
     /// ### [`FromSql`] impls
     ///
     /// - [`PgTimestamp`]
     /// - [`chrono::NaiveDateTime`] with `feature = "chrono"`
     /// - [`chrono::DateTime`] with `feature = "chrono"`
+    /// - [`time::PrimitiveDateTime`] with `feature = "time"`
+    /// - [`time::OffsetDateTime`] with `feature = "time"`
     ///
     /// [`ToSql`]: crate::serialize::ToSql
     /// [`FromSql`]: crate::deserialize::FromSql
@@ -80,6 +84,22 @@ pub mod sql_types {
         not(feature = "chrono"),
         doc = " [`chrono::DateTime`]: https://docs.rs/chrono/0.4.19/chrono/struct.DateTime.html"
     )]
+    #[cfg_attr(
+        feature = "time",
+        doc = " [`time::PrimitiveDateTime`]: time::PrimitiveDateTime"
+    )]
+    #[cfg_attr(
+        not(feature = "time"),
+        doc = " [`time::PrimitiveDateTime`]: https://docs.rs/time/0.3.9/time/struct.PrimitiveDateTime.html"
+    )]
+    #[cfg_attr(
+        feature = "time",
+        doc = " [`time::OffsetDateTime`]: time::OffsetDateTime"
+    )]
+    #[cfg_attr(
+        not(feature = "time"),
+        doc = " [`time::OffsetDateTime`]: https://docs.rs/time/0.3.9/time/struct.OffsetDateTime.html"
+    )]
     #[cfg(feature = "postgres_backend")]
     #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)]
     #[diesel(postgres_type(oid = 1184, array_oid = 1185))]
diff --git a/diesel/src/pg/types/record.rs b/diesel/src/pg/types/record.rs
index 37fb5d3b7f50..9118c686d698 100644
--- a/diesel/src/pg/types/record.rs
+++ b/diesel/src/pg/types/record.rs
@@ -28,7 +28,7 @@ macro_rules! tuple_impls {
             // Yes, we're relying on the order of evaluation of subexpressions
             // but the only other option would be to use `mem::uninitialized`
             // and `ptr::write`.
-            #[allow(clippy::eval_order_dependence)]
+            #[allow(clippy::mixed_read_write_in_expression)]
             fn from_sql(value: PgValue<'_>) -> deserialize::Result<Self> {
                 let mut bytes = value.as_bytes();
                 let num_elements = bytes.read_i32::<NetworkEndian>()?;
diff --git a/diesel/src/query_builder/mod.rs b/diesel/src/query_builder/mod.rs
index 456e3fe279c3..29569359035c 100644
--- a/diesel/src/query_builder/mod.rs
+++ b/diesel/src/query_builder/mod.rs
@@ -103,11 +103,20 @@ pub(crate) use self::select_clause::SelectClauseExpression;
     feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
 )]
 pub(crate) use self::from_clause::{FromClause, NoFromClause};
-
-pub(crate) use self::insert_statement::ColumnList;
+#[diesel_derives::__diesel_public_if(
+    feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
+)]
+#[doc(inline)]
 pub(crate) use self::select_statement::BoxedSelectStatement;
+
+#[diesel_derives::__diesel_public_if(
+    feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
+)]
+#[doc(inline)]
 pub(crate) use self::select_statement::SelectStatement;
 
+pub(crate) use self::insert_statement::ColumnList;
+
 #[cfg(feature = "postgres_backend")]
 pub use crate::pg::query_builder::only::Only;
 
diff --git a/diesel/src/query_builder/select_statement/boxed.rs b/diesel/src/query_builder/select_statement/boxed.rs
index 5fd9740cbe46..5dc2835d6385 100644
--- a/diesel/src/query_builder/select_statement/boxed.rs
+++ b/diesel/src/query_builder/select_statement/boxed.rs
@@ -1,6 +1,6 @@
 use std::marker::PhantomData;
 
-use crate::backend::{Backend, DieselReserveSpecialization};
+use crate::backend::{sql_dialect, Backend, DieselReserveSpecialization};
 use crate::dsl::AsExprOf;
 use crate::expression::subselect::ValidSubselect;
 use crate::expression::*;
@@ -25,16 +25,40 @@ use crate::result::QueryResult;
 use crate::sql_types::{BigInt, BoolOrNullableBool, IntoNullable};
 
 // This is used by the table macro internally
-#[doc(hidden)]
+/// This type represents a boxed select query
+///
+/// Using this type directly is only meaningful for custom backends
+/// that need to provide a custom [`QueryFragment`] implementation
 #[allow(missing_debug_implementations)]
+#[diesel_derives::__diesel_public_if(
+    feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes",
+    public_fields(
+        select,
+        from,
+        distinct,
+        where_clause,
+        order,
+        limit_offset,
+        group_by,
+        having
+    )
+)]
 pub struct BoxedSelectStatement<'a, ST, QS, DB, GB = ()> {
+    /// The select clause of the query
     select: Box<dyn QueryFragment<DB> + Send + 'a>,
+    /// The from clause of the query
     from: QS,
+    /// The distinct clause of the query
     distinct: Box<dyn QueryFragment<DB> + Send + 'a>,
+    /// The where clause of the query
     where_clause: BoxedWhereClause<'a, DB>,
+    /// The order clause of the query
     order: Option<Box<dyn QueryFragment<DB> + Send + 'a>>,
+    /// The combined limit/offset clause of the query
     limit_offset: BoxedLimitOffsetClause<'a, DB>,
+    /// The group by clause of the query
     group_by: Box<dyn QueryFragment<DB> + Send + 'a>,
+    /// The having clause of the query
     having: Box<dyn QueryFragment<DB> + Send + 'a>,
     _marker: PhantomData<(ST, GB)>,
 }
@@ -162,7 +186,21 @@ impl<'a, ST, QS, QS2, DB, GB> ValidSubselect<QS2> for BoxedSelectStatement<'a, S
 
 impl<'a, ST, QS, DB, GB> QueryFragment<DB> for BoxedSelectStatement<'a, ST, QS, DB, GB>
 where
-    DB: Backend + DieselReserveSpecialization,
+    DB: Backend,
+    Self: QueryFragment<DB, DB::SelectStatementSyntax>,
+{
+    fn walk_ast<'b>(&'b self, pass: AstPass<'_, 'b, DB>) -> QueryResult<()> {
+        <Self as QueryFragment<DB, DB::SelectStatementSyntax>>::walk_ast(self, pass)
+    }
+}
+
+impl<'a, ST, QS, DB, GB>
+    QueryFragment<DB, sql_dialect::select_statement_syntax::AnsiSqlSelectStatement>
+    for BoxedSelectStatement<'a, ST, QS, DB, GB>
+where
+    DB: Backend<
+            SelectStatementSyntax = sql_dialect::select_statement_syntax::AnsiSqlSelectStatement,
+        > + DieselReserveSpecialization,
     QS: QueryFragment<DB>,
     BoxedLimitOffsetClause<'a, DB>: QueryFragment<DB>,
 {
diff --git a/diesel/src/query_builder/select_statement/mod.rs b/diesel/src/query_builder/select_statement/mod.rs
index 605842f9108f..05715c0c0784 100644
--- a/diesel/src/query_builder/select_statement/mod.rs
+++ b/diesel/src/query_builder/select_statement/mod.rs
@@ -13,6 +13,9 @@
 
 pub(crate) mod boxed;
 mod dsl_impls;
+#[diesel_derives::__diesel_public_if(
+    feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
+)]
 pub(crate) use self::boxed::BoxedSelectStatement;
 
 use super::distinct_clause::NoDistinctClause;
@@ -27,8 +30,7 @@ use super::select_clause::*;
 use super::where_clause::*;
 use super::NoFromClause;
 use super::{AstPass, Query, QueryFragment};
-use crate::backend::Backend;
-use crate::backend::DieselReserveSpecialization;
+use crate::backend::{sql_dialect, Backend};
 use crate::expression::subselect::ValidSubselect;
 use crate::expression::*;
 use crate::query_builder::having_clause::NoHavingClause;
@@ -39,8 +41,25 @@ use crate::query_source::joins::{AppendSelection, Inner, Join};
 use crate::query_source::*;
 use crate::result::QueryResult;
 
+/// This type represents a select query
+///
+/// Using this type directly is only meaningful for custom backends
+/// that need to provide a custom [`QueryFragment`] implementation
+#[diesel_derives::__diesel_public_if(
+    feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes",
+    public_fields(
+        select,
+        from,
+        distinct,
+        where_clause,
+        order,
+        limit_offset,
+        group_by,
+        having,
+        locking
+    )
+)]
 #[derive(Debug, Clone, Copy, QueryId)]
-#[doc(hidden)]
 #[must_use = "Queries are only executed when calling `load`, `get_result` or similar."]
 pub struct SelectStatement<
     From,
@@ -53,14 +72,23 @@ pub struct SelectStatement<
     Having = NoHavingClause,
     Locking = NoLockingClause,
 > {
+    /// The select clause of the query
     pub(crate) select: Select,
+    /// The from clause of the query
     pub(crate) from: From,
+    /// The distinct clause of the query
     pub(crate) distinct: Distinct,
+    /// The where clause of the query
     pub(crate) where_clause: Where,
+    /// The order clause of the query
     pub(crate) order: Order,
+    /// The combined limit/offset clause of the query
     pub(crate) limit_offset: LimitOffset,
+    /// The group by clause of the query
     pub(crate) group_by: GroupBy,
+    /// The having clause of the query
     pub(crate) having: Having,
+    /// The locking clauise of the query
     pub(crate) locking: Locking,
 }
 
@@ -134,7 +162,21 @@ where
 impl<F, S, D, W, O, LOf, G, H, LC, DB> QueryFragment<DB>
     for SelectStatement<F, S, D, W, O, LOf, G, H, LC>
 where
-    DB: Backend + DieselReserveSpecialization,
+    DB: Backend,
+    Self: QueryFragment<DB, DB::SelectStatementSyntax>,
+{
+    fn walk_ast<'b>(&'b self, pass: AstPass<'_, 'b, DB>) -> QueryResult<()> {
+        <Self as QueryFragment<DB, DB::SelectStatementSyntax>>::walk_ast(self, pass)
+    }
+}
+
+impl<F, S, D, W, O, LOf, G, H, LC, DB>
+    QueryFragment<DB, sql_dialect::select_statement_syntax::AnsiSqlSelectStatement>
+    for SelectStatement<F, S, D, W, O, LOf, G, H, LC>
+where
+    DB: Backend<
+        SelectStatementSyntax = sql_dialect::select_statement_syntax::AnsiSqlSelectStatement,
+    >,
     S: QueryFragment<DB>,
     F: QueryFragment<DB>,
     D: QueryFragment<DB>,
diff --git a/diesel/src/query_builder/sql_query.rs b/diesel/src/query_builder/sql_query.rs
index 4fcc40b7bebc..69477eb05332 100644
--- a/diesel/src/query_builder/sql_query.rs
+++ b/diesel/src/query_builder/sql_query.rs
@@ -259,7 +259,7 @@ impl<Conn, Query, Value, ST> RunQueryDsl<Conn> for UncheckedBind<Query, Value, S
 pub struct BoxedSqlQuery<'f, DB: Backend, Query> {
     query: Query,
     sql: String,
-    binds: Vec<Box<dyn QueryFragment<DB> + 'f>>,
+    binds: Vec<Box<dyn QueryFragment<DB> + Send + 'f>>,
 }
 
 struct RawBind<ST, U> {
@@ -292,8 +292,8 @@ impl<'f, DB: Backend, Query> BoxedSqlQuery<'f, DB, Query> {
     pub fn bind<BindSt, Value>(mut self, b: Value) -> Self
     where
         DB: HasSqlType<BindSt>,
-        Value: ToSql<BindSt, DB> + 'f,
-        BindSt: 'f,
+        Value: ToSql<BindSt, DB> + Send + 'f,
+        BindSt: Send + 'f,
     {
         self.binds.push(Box::new(RawBind {
             value: b,
@@ -362,3 +362,17 @@ mod private {
         }
     }
 }
+
+#[cfg(test)]
+mod tests {
+    fn assert_send<S: Send>(_: S) {}
+
+    #[test]
+    fn check_boxed_sql_query_is_send() {
+        let query = crate::sql_query("SELECT 1")
+            .into_boxed::<<crate::test_helpers::TestConnection as crate::Connection>::Backend>(
+        );
+
+        assert_send(query);
+    }
+}
diff --git a/diesel/src/query_source/joins.rs b/diesel/src/query_source/joins.rs
index ee0b8d6d1536..0d0cf7495d1f 100644
--- a/diesel/src/query_source/joins.rs
+++ b/diesel/src/query_source/joins.rs
@@ -106,20 +106,29 @@ impl<Left, Right> QuerySource for Join<Left, Right, Inner>
 where
     Left: QuerySource + AppendSelection<Right::DefaultSelection>,
     Right: QuerySource,
-    Left::Output: SelectableExpression<Self>,
+    Left::Output: AppearsOnTable<Self>,
     Self: Clone,
 {
     type FromClause = Self;
-    type DefaultSelection = Left::Output;
+    // combining two valid selectable expressions for both tables will always yield a
+    // valid selectable expressions for the whole join, so no need to check that here
+    // again. These checked turned out to be quite expensive in terms of compile time
+    // so we use a wrapper type to just skip the check and forward other more relevant
+    // trait implementations to the inner type
+    //
+    // See https://github.com/diesel-rs/diesel/issues/3223 for details
+    type DefaultSelection = self::private::SkipSelectableExpressionBoundCheckWrapper<Left::Output>;
 
     fn from_clause(&self) -> Self::FromClause {
         self.clone()
     }
 
     fn default_selection(&self) -> Self::DefaultSelection {
-        self.left
-            .source
-            .append_selection(self.right.source.default_selection())
+        self::private::SkipSelectableExpressionBoundCheckWrapper(
+            self.left
+                .source
+                .append_selection(self.right.source.default_selection()),
+        )
     }
 }
 
@@ -127,20 +136,29 @@ impl<Left, Right> QuerySource for Join<Left, Right, LeftOuter>
 where
     Left: QuerySource + AppendSelection<Nullable<Right::DefaultSelection>>,
     Right: QuerySource,
-    Left::Output: SelectableExpression<Self>,
+    Left::Output: AppearsOnTable<Self>,
     Self: Clone,
 {
     type FromClause = Self;
-    type DefaultSelection = Left::Output;
+    // combining two valid selectable expressions for both tables will always yield a
+    // valid selectable expressions for the whole join, so no need to check that here
+    // again. These checked turned out to be quite expensive in terms of compile time
+    // so we use a wrapper type to just skip the check and forward other more relevant
+    // trait implementations to the inner type
+    //
+    // See https://github.com/diesel-rs/diesel/issues/3223 for details
+    type DefaultSelection = self::private::SkipSelectableExpressionBoundCheckWrapper<Left::Output>;
 
     fn from_clause(&self) -> Self::FromClause {
         self.clone()
     }
 
     fn default_selection(&self) -> Self::DefaultSelection {
-        self.left
-            .source
-            .append_selection(self.right.source.default_selection().nullable())
+        self::private::SkipSelectableExpressionBoundCheckWrapper(
+            self.left
+                .source
+                .append_selection(self.right.source.default_selection().nullable()),
+        )
     }
 }
 
@@ -422,3 +440,75 @@ where
 impl<T: Table> ToInnerJoin for T {
     type InnerJoin = T;
 }
+
+mod private {
+    use crate::backend::Backend;
+    use crate::expression::{Expression, ValidGrouping};
+    use crate::query_builder::{AstPass, QueryFragment, SelectClauseExpression};
+    use crate::{AppearsOnTable, QueryResult, SelectableExpression};
+
+    #[derive(Debug, crate::query_builder::QueryId, Copy, Clone)]
+    pub struct SkipSelectableExpressionBoundCheckWrapper<T>(pub(super) T);
+
+    impl<DB, T> QueryFragment<DB> for SkipSelectableExpressionBoundCheckWrapper<T>
+    where
+        T: QueryFragment<DB>,
+        DB: Backend,
+    {
+        fn walk_ast<'b>(&'b self, pass: AstPass<'_, 'b, DB>) -> QueryResult<()> {
+            self.0.walk_ast(pass)
+        }
+    }
+
+    // The default select clause is only valid for no group by clause
+    // anyway so we can just skip the recursive check here
+    impl<T> ValidGrouping<()> for SkipSelectableExpressionBoundCheckWrapper<T> {
+        type IsAggregate = crate::expression::is_aggregate::No;
+    }
+
+    // This needs to use the expression impl
+    impl<QS, T> SelectClauseExpression<QS> for SkipSelectableExpressionBoundCheckWrapper<T>
+    where
+        T: SelectClauseExpression<QS>,
+    {
+        type Selection = T::Selection;
+
+        type SelectClauseSqlType = T::SelectClauseSqlType;
+    }
+
+    // The default select clause for joins is always valid assuming that
+    // the default select clause of all involved query sources is
+    // valid too. We can skip the recursive check here.
+    // This is the main optimization.
+    impl<QS, T> SelectableExpression<QS> for SkipSelectableExpressionBoundCheckWrapper<T> where
+        Self: AppearsOnTable<QS>
+    {
+    }
+
+    impl<QS, T> AppearsOnTable<QS> for SkipSelectableExpressionBoundCheckWrapper<T> where
+        Self: Expression
+    {
+    }
+
+    // Expression must recurse the whole expression
+    // as this is required for the return type of the query
+    impl<T> Expression for SkipSelectableExpressionBoundCheckWrapper<T>
+    where
+        T: Expression,
+    {
+        type SqlType = T::SqlType;
+    }
+
+    impl<T, Selection> crate::util::TupleAppend<Selection>
+        for SkipSelectableExpressionBoundCheckWrapper<T>
+    where
+        T: crate::util::TupleAppend<Selection>,
+    {
+        // We're re-wrapping after anyway
+        type Output = T::Output;
+
+        fn tuple_append(self, right: Selection) -> Self::Output {
+            self.0.tuple_append(right)
+        }
+    }
+}
diff --git a/diesel/src/r2d2.rs b/diesel/src/r2d2.rs
index 1256832d0a83..2a6f21de2a0a 100644
--- a/diesel/src/r2d2.rs
+++ b/diesel/src/r2d2.rs
@@ -528,4 +528,57 @@ mod tests {
         assert_eq!(checkin_count.load(Ordering::Relaxed), 3);
         assert_eq!(checkout_count.load(Ordering::Relaxed), 3);
     }
+
+    #[cfg(feature = "postgres")]
+    #[test]
+    fn verify_that_begin_test_transaction_works_with_pools() {
+        use crate::prelude::*;
+        use crate::r2d2::*;
+
+        table! {
+            users {
+                id -> Integer,
+                name -> Text,
+            }
+        }
+
+        #[derive(Debug)]
+        struct TestConnectionCustomizer;
+
+        impl<E> CustomizeConnection<PgConnection, E> for TestConnectionCustomizer {
+            fn on_acquire(&self, conn: &mut PgConnection) -> Result<(), E> {
+                conn.begin_test_transaction()
+                    .expect("Failed to start test transaction");
+
+                Ok(())
+            }
+        }
+
+        let manager = ConnectionManager::<PgConnection>::new(database_url());
+        let pool = Pool::builder()
+            .max_size(1)
+            .connection_customizer(Box::new(TestConnectionCustomizer))
+            .build(manager)
+            .unwrap();
+
+        let mut conn = pool.get().unwrap();
+
+        crate::sql_query(
+            "CREATE TABLE IF NOT EXISTS users (id SERIAL PRIMARY KEY, name TEXT NOT NULL)",
+        )
+        .execute(&mut conn)
+        .unwrap();
+
+        crate::insert_into(users::table)
+            .values(users::name.eq("John"))
+            .execute(&mut conn)
+            .unwrap();
+
+        std::mem::drop(conn);
+
+        let mut conn2 = pool.get().unwrap();
+
+        let user_count = users::table.count().get_result::<i64>(&mut conn2).unwrap();
+        assert_eq!(user_count, 1);
+    }
 }
diff --git a/diesel/src/result.rs b/diesel/src/result.rs
index f864fb136365..ce8b1ad00f9b 100644
--- a/diesel/src/result.rs
+++ b/diesel/src/result.rs
@@ -65,13 +65,13 @@ pub enum Error {
     /// An error occurred when attempting rollback of a transaction subsequently to a failed
     /// commit attempt.
     ///
-    /// When a commit attempt fails and Diesel beleives that it can attempt a rollback to return
+    /// When a commit attempt fails and Diesel believes that it can attempt a rollback to return
     /// the connection back in a usable state (out of that transaction), it attempts it then
     /// returns the original error.
     ///
     /// If that fails, you get this.
     RollbackErrorOnCommit {
-        /// The error that was encoutered when attempting the rollback
+        /// The error that was encountered when attempting the rollback
         rollback_error: Box<Error>,
         /// If the rollback attempt resulted from a failed attempt to commit the transaction,
         /// you will find the related error here.
@@ -406,7 +406,7 @@ impl fmt::Display for UnexpectedNullError {
 
 impl StdError for UnexpectedNullError {}
 
-/// Expected more fields then present in the current row while deserialising results
+/// Expected more fields then present in the current row while deserializing results
 #[derive(Debug, Clone, Copy)]
 pub struct UnexpectedEndOfRow;
 
diff --git a/diesel/src/row.rs b/diesel/src/row.rs
index a0b3fe35ed96..89bfb40cdfd8 100644
--- a/diesel/src/row.rs
+++ b/diesel/src/row.rs
@@ -16,7 +16,7 @@ pub(crate) use self::private::{PartialRow, RowGatWorkaround};
 ///
 /// * Crates using existing backends should use existing implementations of
 ///   this traits. Diesel provides `RowIndex<usize>` and `RowIndex<&str>` for
-///   all bulit-in backends
+///   all built-in backends
 ///
 /// * Crates implementing custom backends need to provide `RowIndex<usize>` and
 ///   `RowIndex<&str>` impls for their [`Row`] type.
diff --git a/diesel/src/sql_types/mod.rs b/diesel/src/sql_types/mod.rs
index 5dd33aaaa474..e8f7b666648a 100644
--- a/diesel/src/sql_types/mod.rs
+++ b/diesel/src/sql_types/mod.rs
@@ -272,12 +272,15 @@ pub type Bit = Binary;
 /// ### [`ToSql`](crate::serialize::ToSql) impls
 ///
 /// - [`chrono::NaiveDate`][NaiveDate] with `feature = "chrono"`
+/// - [`time::Date`][Date] with `feature = "time"`
 ///
 /// ### [`FromSql`](crate::deserialize::FromSql) impls
 ///
 /// - [`chrono::NaiveDate`][NaiveDate] with `feature = "chrono"`
+/// - [`time::Date`][Date] with `feature = "time"`
 ///
 /// [NaiveDate]: https://docs.rs/chrono/*/chrono/naive/struct.NaiveDate.html
+/// [Date]: https://docs.rs/time/0.3.9/time/struct.Date.html
 #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)]
 #[diesel(postgres_type(oid = 1082, array_oid = 1182))]
 #[diesel(sqlite_type(name = "Text"))]
@@ -307,12 +310,15 @@ pub struct Interval;
 /// ### [`ToSql`](crate::serialize::ToSql) impls
 ///
 /// - [`chrono::NaiveTime`][NaiveTime] with `feature = "chrono"`
+/// - [`time::Time`][Time] with `feature = "time"`
 ///
 /// ### [`FromSql`](crate::deserialize::FromSql) impls
 ///
 /// - [`chrono::NaiveTime`][NaiveTime] with `feature = "chrono"`
+/// - [`time::Time`][Time] with `feature = "time"`
 ///
 /// [NaiveTime]: /chrono/naive/time/struct.NaiveTime.html
+/// [Time]: /time/struct.Time.html
 #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)]
 #[diesel(postgres_type(oid = 1083, array_oid = 1183))]
 #[diesel(sqlite_type(name = "Text"))]
@@ -325,13 +331,15 @@ pub struct Time;
 ///
 /// - [`std::time::SystemTime`][SystemTime] (PG only)
 /// - [`chrono::NaiveDateTime`][NaiveDateTime] with `feature = "chrono"`
-/// - [`time::Timespec`][Timespec] with `feature = "deprecated-time"` (PG only)
+/// - [`time::PrimitiveDateTime`] with `feature = "time"`
+/// - [`time::OffsetDateTime`] with `feature = "time"`
 ///
 /// ### [`FromSql`](crate::deserialize::FromSql) impls
 ///
 /// - [`std::time::SystemTime`][SystemTime] (PG only)
 /// - [`chrono::NaiveDateTime`][NaiveDateTime] with `feature = "chrono"`
-/// - [`time::Timespec`][Timespec] with `feature = "deprecated-time"` (PG only)
+/// - [`time::PrimitiveDateTime`] with `feature = "time"`
+/// - [`time::OffsetDateTime`] with `feature = "time"`
 ///
 /// [SystemTime]: std::time::SystemTime
 #[cfg_attr(
@@ -342,6 +350,22 @@ pub struct Time;
     not(feature = "chrono"),
     doc = " [NaiveDateTime]: https://docs.rs/chrono/*/chrono/naive/struct.NaiveDateTime.html"
 )]
+#[cfg_attr(
+    feature = "time",
+    doc = " [`time::PrimitiveDateTime`]: time::PrimitiveDateTime"
+)]
+#[cfg_attr(
+    not(feature = "time"),
+    doc = " [`time::PrimitiveDateTime`]: https://docs.rs/time/0.3.9/time/struct.PrimitiveDateTime.html"
+)]
+#[cfg_attr(
+    feature = "time",
+    doc = " [`time::OffsetDateTime`]: time::OffsetDateTime"
+)]
+#[cfg_attr(
+    not(feature = "time"),
+    doc = " [`time::OffsetDateTime`]: https://docs.rs/time/0.3.9/time/struct.OffsetDateTime.html"
+)]
 /// [Timespec]: /time/struct.Timespec.html
 #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)]
 #[diesel(postgres_type(oid = 1114, array_oid = 1115))]
diff --git a/diesel/src/sqlite/backend.rs b/diesel/src/sqlite/backend.rs
index f2550de61aae..d6c756952d7a 100644
--- a/diesel/src/sqlite/backend.rs
+++ b/diesel/src/sqlite/backend.rs
@@ -64,9 +64,12 @@ impl SqlDialect for Sqlite {
     type InsertWithDefaultKeyword =
         sql_dialect::default_keyword_for_insert::DoesNotSupportDefaultKeyword;
     type BatchInsertSupport = SqliteBatchInsert;
+    type ConcatClause = sql_dialect::concat_clause::ConcatWithPipesClause;
     type DefaultValueClauseForInsert = sql_dialect::default_value_clause::AnsiDefaultValueClause;
 
     type EmptyFromClauseSyntax = sql_dialect::from_clause_syntax::AnsiSqlFromClauseSyntax;
+    type SelectStatementSyntax = sql_dialect::select_statement_syntax::AnsiSqlSelectStatement;
+
     type ExistsSyntax = sql_dialect::exists_syntax::AnsiSqlExistsSyntax;
     type ArrayComparison = sql_dialect::array_comparison::AnsiSqlArrayComparison;
 }
diff --git a/diesel/src/sqlite/connection/functions.rs b/diesel/src/sqlite/connection/functions.rs
index 1fdf00043a77..7089888eea3d 100644
--- a/diesel/src/sqlite/connection/functions.rs
+++ b/diesel/src/sqlite/connection/functions.rs
@@ -146,7 +146,7 @@ impl<'a> Drop for FunctionRow<'a> {
 
 impl<'a> FunctionRow<'a> {
     fn new(args: &mut [*mut ffi::sqlite3_value]) -> Self {
-        let lenghts = args.len();
+        let lengths = args.len();
         let args = unsafe {
             Vec::from_raw_parts(
                 // This cast is safe because:
@@ -166,17 +166,17 @@ impl<'a> FunctionRow<'a> {
                 // Into `ManualDrop` to prevent the dropping
                 args as *mut [*mut ffi::sqlite3_value] as *mut ffi::sqlite3_value
                     as *mut Option<OwnedSqliteValue>,
-                lenghts,
-                lenghts,
+                lengths,
+                lengths,
             )
         };
 
         Self {
-            field_count: lenghts,
+            field_count: lengths,
             args: Rc::new(RefCell::new(ManuallyDrop::new(
                 PrivateSqliteRow::Duplicated {
                     values: args,
-                    column_names: Rc::from(vec![None; lenghts]),
+                    column_names: Rc::from(vec![None; lengths]),
                 },
             ))),
             marker: PhantomData,
diff --git a/diesel/src/sqlite/connection/mod.rs b/diesel/src/sqlite/connection/mod.rs
index 509e463fb6f6..4665ea032420 100644
--- a/diesel/src/sqlite/connection/mod.rs
+++ b/diesel/src/sqlite/connection/mod.rs
@@ -204,15 +204,7 @@ impl crate::r2d2::R2D2Connection for crate::sqlite::SqliteConnection {
     }
 
     fn is_broken(&mut self) -> bool {
-        match self.transaction_state.status.transaction_depth() {
-            // all transactions are closed
-            // so we don't consider this connection broken
-            Ok(None) => false,
-            // The transaction manager is in an error state
-            // or contains an open transaction
-            // Therefore we consider this connection broken
-            Err(_) | Ok(Some(_)) => true,
-        }
+        AnsiTransactionManager::is_broken_transaction_manager(self)
     }
 }
 
diff --git a/diesel/src/sqlite/connection/raw.rs b/diesel/src/sqlite/connection/raw.rs
index 247f65abaa73..ab5ef0a448e5 100644
--- a/diesel/src/sqlite/connection/raw.rs
+++ b/diesel/src/sqlite/connection/raw.rs
@@ -356,7 +356,7 @@ extern "C" fn run_aggregator_step_function<ArgsSqlType, RetSqlType, Args, Ret, A
     .unwrap_or_else(|e| {
         Err(SqliteCallbackError::Panic(
             e,
-            format!("{}::step() paniced", std::any::type_name::<A>()),
+            format!("{}::step() panicked", std::any::type_name::<A>()),
         ))
     });
 
@@ -470,7 +470,7 @@ extern "C" fn run_aggregator_final_function<ArgsSqlType, RetSqlType, Args, Ret,
     .unwrap_or_else(|e| {
         Err(SqliteCallbackError::Panic(
             e,
-            format!("{}::finalize() paniced", std::any::type_name::<A>()),
+            format!("{}::finalize() panicked", std::any::type_name::<A>()),
         ))
     });
     if let Err(e) = result {
@@ -573,7 +573,7 @@ where
             std::process::abort()
         }
         Err(SqliteCallbackError::Panic(_, msg)) => {
-            eprintln!("Collation function {} paniced", msg);
+            eprintln!("Collation function {} panicked", msg);
             std::process::abort()
         }
     }
diff --git a/diesel/src/sqlite/connection/sqlite_value.rs b/diesel/src/sqlite/connection/sqlite_value.rs
index fad277eb1118..5a03e9178545 100644
--- a/diesel/src/sqlite/connection/sqlite_value.rs
+++ b/diesel/src/sqlite/connection/sqlite_value.rs
@@ -20,7 +20,7 @@ pub struct SqliteValue<'row, 'stmt, 'query> {
     _row: Ref<'row, PrivateSqliteRow<'stmt, 'query>>,
     // we extract the raw value pointer as part of the constructor
     // to safe the match statements for each method
-    // Acconding to benchmarks this leads to a ~20-30% speedup
+    // According to benchmarks this leads to a ~20-30% speedup
     //
     // This is sound as long as nobody calls `stmt.step()`
     // while holding this value. We ensure this by including
diff --git a/diesel/src/sqlite/connection/statement_iterator.rs b/diesel/src/sqlite/connection/statement_iterator.rs
index 8d3ad709da13..45251eaed9e0 100644
--- a/diesel/src/sqlite/connection/statement_iterator.rs
+++ b/diesel/src/sqlite/connection/statement_iterator.rs
@@ -19,7 +19,7 @@ impl<'stmt, 'query> StatementIterator<'stmt, 'query> {
         column_names: &mut Option<Rc<[Option<String>]>>,
         field_count: usize,
     ) -> Option<QueryResult<SqliteRow<'stmt, 'query>>> {
-        // We don't own the statement. There is another existing reference, likly because
+        // We don't own the statement. There is another existing reference, likely because
         // a user stored the row in some long time container before calling next another time
         // In this case we copy out the current values into a temporary store and advance
         // the statement iterator internally afterwards
diff --git a/diesel/src/sqlite/connection/stmt.rs b/diesel/src/sqlite/connection/stmt.rs
index 414fa283c634..905d47d7bf4f 100644
--- a/diesel/src/sqlite/connection/stmt.rs
+++ b/diesel/src/sqlite/connection/stmt.rs
@@ -75,7 +75,7 @@ impl Statement {
             }
             (SqliteType::Binary, InternalSqliteBindValue::Binary(mut bytes)) => {
                 let len = bytes.len();
-                // We need a seperate pointer here to pass it to sqlite
+                // We need a separate pointer here to pass it to sqlite
                 // as the returned pointer is a pointer to a dyn sized **slice**
                 // and not the pointer to the first element of the slice
                 let ptr;
@@ -106,7 +106,7 @@ impl Statement {
             (SqliteType::Text, InternalSqliteBindValue::String(bytes)) => {
                 let mut bytes = Box::<[u8]>::from(bytes);
                 let len = bytes.len();
-                // We need a seperate pointer here to pass it to sqlite
+                // We need a separate pointer here to pass it to sqlite
                 // as the returned pointer is a pointer to a dyn sized **slice**
                 // and not the pointer to the first element of the slice
                 let ptr;
@@ -225,7 +225,7 @@ impl Drop for Statement {
     }
 }
 
-// A warning for future editiors:
+// A warning for future editors:
 // Changing this code to something "simplier" may
 // introduce undefined behaviour. Make sure you read
 // the following discussions for details about
@@ -242,7 +242,7 @@ struct BoundStatement<'stmt, 'query> {
     // generic type, we use NonNull to communicate
     // that this is a shared buffer
     query: Option<NonNull<dyn QueryFragment<Sqlite> + 'query>>,
-    // we need to store any owned bind values speratly, as they are not
+    // we need to store any owned bind values separately, as they are not
     // contained in the query itself. We use NonNull to
     // communicate that this is a shared buffer
     binds_to_free: Vec<(i32, Option<NonNull<[u8]>>)>,
@@ -280,8 +280,8 @@ impl<'stmt, 'query> BoundStatement<'stmt, 'query> {
         Ok(ret)
     }
 
-    // This is a seperate function so that
-    // not the whole construtor is generic over the query type T.
+    // This is a separated function so that
+    // not the whole constructor is generic over the query type T.
     // This hopefully prevents binary bloat.
     fn bind_buffers(
         &mut self,
@@ -352,7 +352,7 @@ impl<'stmt, 'query> Drop for BoundStatement<'stmt, 'query> {
             if let Some(buffer) = buffer {
                 unsafe {
                     // Constructing the `Box` here is safe as we
-                    // got the pointer from a box + it is guarenteed to be not null.
+                    // got the pointer from a box + it is guaranteed to be not null.
                     std::mem::drop(Box::from_raw(buffer.as_ptr()));
                 }
             }
@@ -361,7 +361,7 @@ impl<'stmt, 'query> Drop for BoundStatement<'stmt, 'query> {
         if let Some(query) = self.query {
             unsafe {
                 // Constructing the `Box` here is safe as we
-                // got the pointer from a box + it is guarenteed to be not null.
+                // got the pointer from a box + it is guaranteed to be not null.
                 std::mem::drop(Box::from_raw(query.as_ptr()));
             }
             self.query = None;
@@ -393,7 +393,7 @@ impl<'stmt, 'query> StatementUse<'stmt, 'query> {
         unsafe {
             // This is safe as we pass `first_step = true`
             // and we consume the statement so nobody could
-            // access the columnns later on anyway.
+            // access the columns later on anyway.
             self.step(true).map(|_| ())
         }
     }
@@ -441,7 +441,7 @@ impl<'stmt, 'query> StatementUse<'stmt, 'query> {
         name.to_str().expect(
             "The Sqlite documentation states that this is UTF8. \
              If you see this error message something has gone \
-             horribliy wrong. Please open an issue at the \
+             horribly wrong. Please open an issue at the \
              diesel repository.",
         ) as *const str
     }
diff --git a/diesel/src/sqlite/types/date_and_time/chrono.rs b/diesel/src/sqlite/types/date_and_time/chrono.rs
index 5cbfab562d73..48a5f6e29dac 100644
--- a/diesel/src/sqlite/types/date_and_time/chrono.rs
+++ b/diesel/src/sqlite/types/date_and_time/chrono.rs
@@ -571,6 +571,11 @@ mod tests {
         let time: DateTime<Utc> = Utc.ymd(1970, 1, 1).and_hms_milli(0, 0, 0, 1);
         let query = select(sql::<TimestamptzSqlite>("'1970-01-01 00:00:00.001+00:00'").eq(time));
         assert!(query.get_result::<bool>(connection).unwrap());
+
+        // and without millisecond
+        let time: DateTime<Utc> = Utc.ymd(1970, 1, 1).and_hms_milli(0, 0, 0, 0);
+        let query = select(sql::<TimestamptzSqlite>("'1970-01-01 00:00:00+00:00'").eq(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
     }
 
     #[test]
diff --git a/diesel/src/sqlite/types/date_and_time/mod.rs b/diesel/src/sqlite/types/date_and_time/mod.rs
index b52f87b8431a..98facfd4387c 100644
--- a/diesel/src/sqlite/types/date_and_time/mod.rs
+++ b/diesel/src/sqlite/types/date_and_time/mod.rs
@@ -6,6 +6,8 @@ use crate::sqlite::Sqlite;
 
 #[cfg(feature = "chrono")]
 mod chrono;
+#[cfg(feature = "time")]
+mod time;
 
 #[cfg(feature = "sqlite")]
 impl FromSql<sql_types::Date, Sqlite> for String {
diff --git a/diesel/src/sqlite/types/date_and_time/time.rs b/diesel/src/sqlite/types/date_and_time/time.rs
new file mode 100644
index 000000000000..872d9a1b6dd8
--- /dev/null
+++ b/diesel/src/sqlite/types/date_and_time/time.rs
@@ -0,0 +1,661 @@
+//! This module makes it possible to map `time` date and time values to sqlite `NUMERIC`
+//! fields. It is enabled with the `time` feature.
+
+extern crate time;
+
+use self::time::{
+    error::ComponentRange, format_description::FormatItem, macros::format_description,
+    Date as NaiveDate, OffsetDateTime, PrimitiveDateTime, Time as NaiveTime, UtcOffset,
+};
+
+use crate::backend;
+use crate::deserialize::{self, FromSql};
+use crate::serialize::{self, IsNull, Output, ToSql};
+use crate::sql_types::{Date, Time, Timestamp, TimestamptzSqlite};
+use crate::sqlite::Sqlite;
+
+const DATE_FORMAT: &[FormatItem<'_>] = format_description!("[year]-[month]-[day]");
+const ENCODE_TIME_FORMAT_WHOLE_SECOND: &[FormatItem<'_>] =
+    format_description!("[hour]:[minute]:[second]");
+const ENCODE_TIME_FORMAT_SUBSECOND: &[FormatItem<'_>] =
+    format_description!("[hour]:[minute]:[second].[subsecond digits:6]");
+
+const TIME_FORMATS: [&[FormatItem<'_>]; 9] = [
+    // Most likely
+    format_description!("[hour]:[minute]:[second].[subsecond]"),
+    // All other valid formats in order of increasing specificity
+    format_description!("[hour]:[minute]"),
+    format_description!("[hour]:[minute]Z"),
+    format_description!("[hour]:[minute][offset_hour sign:mandatory]:[offset_minute]"),
+    format_description!("[hour]:[minute]:[second]"),
+    format_description!("[hour]:[minute]:[second]Z"),
+    format_description!("[hour]:[minute]:[second][offset_hour sign:mandatory]:[offset_minute]"),
+    // here is where the most likely format would go according to the pattern
+    format_description!("[hour]:[minute]:[second].[subsecond]Z"),
+    format_description!(
+        "[hour]:[minute]:[second].[subsecond][offset_hour sign:mandatory]:[offset_minute]"
+    ),
+];
+
+const ENCODE_PRIMITIVE_DATETIME_FORMAT_WHOLE_SECOND: &[FormatItem<'_>] =
+    format_description!("[year]-[month]-[day] [hour]:[minute]:[second]");
+const ENCODE_PRIMITIVE_DATETIME_FORMAT_SUBSECOND: &[FormatItem<'_>] =
+    format_description!("[year]-[month]-[day] [hour]:[minute]:[second].[subsecond digits:6]");
+
+const ENCODE_DATETIME_FORMAT_WHOLE_SECOND: &[FormatItem<'_>] = format_description!(
+    "[year]-[month]-[day] [hour]:[minute]:[second][offset_hour sign:mandatory]:[offset_minute]"
+);
+const ENCODE_DATETIME_FORMAT_SUBSECOND: &[FormatItem<'_>] =
+    format_description!("[year]-[month]-[day] [hour]:[minute]:[second].[subsecond digits:3][offset_hour sign:mandatory]:[offset_minute]");
+
+const DATETIME_FORMATS: [&[FormatItem<'_>]; 18] = [
+    // Most likely format
+    format_description!("[year]-[month]-[day] [hour]:[minute]:[second].[subsecond]"),
+    // Other formats in order of increasing specificity
+    format_description!("[year]-[month]-[day] [hour]:[minute]"),
+    format_description!("[year]-[month]-[day] [hour]:[minute]Z"),
+    format_description!("[year]-[month]-[day] [hour]:[minute][offset_hour sign:mandatory]:[offset_minute]"),
+    format_description!("[year]-[month]-[day] [hour]:[minute]:[second]"),
+    format_description!("[year]-[month]-[day] [hour]:[minute]:[second]Z"),
+    format_description!("[year]-[month]-[day] [hour]:[minute]:[second][offset_hour sign:mandatory]:[offset_minute]"),
+    // here is where the most likely format would go according to the pattern
+    format_description!("[year]-[month]-[day] [hour]:[minute]:[second].[subsecond]Z"),
+    format_description!("[year]-[month]-[day] [hour]:[minute]:[second].[subsecond][offset_hour sign:mandatory]:[offset_minute]"),
+    // now the same thing, with T
+    format_description!("[year]-[month]-[day]T[hour]:[minute]"),
+    format_description!("[year]-[month]-[day]T[hour]:[minute]Z"),
+    format_description!("[year]-[month]-[day]T[hour]:[minute][offset_hour sign:mandatory]:[offset_minute]"),
+    format_description!("[year]-[month]-[day]T[hour]:[minute]:[second]"),
+    format_description!("[year]-[month]-[day]T[hour]:[minute]:[second]Z"),
+    format_description!("[year]-[month]-[day]T[hour]:[minute]:[second][offset_hour sign:mandatory]:[offset_minute]"),
+    format_description!("[year]-[month]-[day]T[hour]:[minute]:[second].[subsecond]"),
+    format_description!("[year]-[month]-[day]T[hour]:[minute]:[second].[subsecond]Z"),
+    format_description!("[year]-[month]-[day]T[hour]:[minute]:[second].[subsecond][offset_hour sign:mandatory]:[offset_minute]"),
+];
+
+fn naive_utc(dt: OffsetDateTime) -> PrimitiveDateTime {
+    let dt = dt.to_offset(UtcOffset::UTC);
+    PrimitiveDateTime::new(dt.date(), dt.time())
+}
+
+fn parse_julian(julian_days: f64) -> Result<PrimitiveDateTime, ComponentRange> {
+    const EPOCH_IN_JULIAN_DAYS: f64 = 2_440_587.5;
+    const SECONDS_IN_DAY: f64 = 86400.0;
+    let timestamp = (julian_days - EPOCH_IN_JULIAN_DAYS) * SECONDS_IN_DAY;
+    OffsetDateTime::from_unix_timestamp_nanos((timestamp * 1E9) as i128)
+        .map(|timestamp| naive_utc(timestamp))
+}
+
+#[cfg(all(feature = "sqlite", feature = "time"))]
+impl FromSql<Date, Sqlite> for NaiveDate {
+    fn from_sql(value: backend::RawValue<'_, Sqlite>) -> deserialize::Result<Self> {
+        value
+            .parse_string(|s| Self::parse(s, DATE_FORMAT))
+            .map_err(Into::into)
+    }
+}
+
+#[cfg(all(feature = "sqlite", feature = "time"))]
+impl ToSql<Date, Sqlite> for NaiveDate {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> serialize::Result {
+        out.set_value(self.format(DATE_FORMAT).map_err(|err| err.to_string())?);
+        Ok(IsNull::No)
+    }
+}
+
+#[cfg(all(feature = "sqlite", feature = "time"))]
+impl FromSql<Time, Sqlite> for NaiveTime {
+    fn from_sql(value: backend::RawValue<'_, Sqlite>) -> deserialize::Result<Self> {
+        value.parse_string(|text| {
+            for format in TIME_FORMATS {
+                if let Ok(time) = Self::parse(text, format) {
+                    return Ok(time);
+                }
+            }
+
+            Err(format!("Invalid time {}", text).into())
+        })
+    }
+}
+
+#[cfg(all(feature = "sqlite", feature = "time"))]
+impl ToSql<Time, Sqlite> for NaiveTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> serialize::Result {
+        let format = if self.microsecond() == 0 {
+            ENCODE_TIME_FORMAT_WHOLE_SECOND
+        } else {
+            ENCODE_TIME_FORMAT_SUBSECOND
+        };
+        out.set_value(self.format(format).map_err(|err| err.to_string())?);
+        Ok(IsNull::No)
+    }
+}
+
+#[cfg(all(feature = "sqlite", feature = "time"))]
+impl FromSql<Timestamp, Sqlite> for PrimitiveDateTime {
+    fn from_sql(value: backend::RawValue<'_, Sqlite>) -> deserialize::Result<Self> {
+        value.parse_string(|text| {
+            for format in DATETIME_FORMATS {
+                if let Ok(dt) = Self::parse(text, format) {
+                    return Ok(dt);
+                }
+            }
+
+            if let Ok(julian_days) = text.parse::<f64>() {
+                if let Ok(timestamp) = parse_julian(julian_days) {
+                    return Ok(timestamp);
+                }
+            }
+
+            Err(format!("Invalid datetime {}", text).into())
+        })
+    }
+}
+
+#[cfg(all(feature = "sqlite", feature = "time"))]
+impl ToSql<Timestamp, Sqlite> for PrimitiveDateTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> serialize::Result {
+        let format = if self.microsecond() == 0 {
+            ENCODE_PRIMITIVE_DATETIME_FORMAT_WHOLE_SECOND
+        } else {
+            ENCODE_PRIMITIVE_DATETIME_FORMAT_SUBSECOND
+        };
+        out.set_value(self.format(format).map_err(|err| err.to_string())?);
+        Ok(IsNull::No)
+    }
+}
+
+#[cfg(all(feature = "sqlite", feature = "time"))]
+impl FromSql<TimestamptzSqlite, Sqlite> for PrimitiveDateTime {
+    fn from_sql(value: backend::RawValue<'_, Sqlite>) -> deserialize::Result<Self> {
+        value.parse_string(|text| {
+            for format in DATETIME_FORMATS {
+                if let Ok(dt) = Self::parse(text, format) {
+                    return Ok(dt);
+                }
+            }
+
+            if let Ok(julian_days) = text.parse::<f64>() {
+                if let Ok(timestamp) = parse_julian(julian_days) {
+                    return Ok(timestamp);
+                }
+            }
+
+            Err(format!("Invalid datetime {}", text).into())
+        })
+    }
+}
+
+#[cfg(all(feature = "sqlite", feature = "time"))]
+impl ToSql<TimestamptzSqlite, Sqlite> for PrimitiveDateTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> serialize::Result {
+        let format = if self.microsecond() == 0 {
+            ENCODE_PRIMITIVE_DATETIME_FORMAT_WHOLE_SECOND
+        } else {
+            ENCODE_PRIMITIVE_DATETIME_FORMAT_SUBSECOND
+        };
+        out.set_value(self.format(format).map_err(|err| err.to_string())?);
+        Ok(IsNull::No)
+    }
+}
+
+#[cfg(all(feature = "sqlite", feature = "time"))]
+impl FromSql<TimestamptzSqlite, Sqlite> for OffsetDateTime {
+    fn from_sql(value: backend::RawValue<'_, Sqlite>) -> deserialize::Result<Self> {
+        let primitive_date_time =
+            <PrimitiveDateTime as FromSql<TimestamptzSqlite, Sqlite>>::from_sql(value)?;
+        Ok(primitive_date_time.assume_utc())
+    }
+}
+
+#[cfg(all(feature = "sqlite", feature = "time"))]
+impl ToSql<TimestamptzSqlite, Sqlite> for OffsetDateTime {
+    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> serialize::Result {
+        let dt_utc = self.to_offset(UtcOffset::UTC);
+        let format = if self.millisecond() == 0 {
+            ENCODE_DATETIME_FORMAT_WHOLE_SECOND
+        } else {
+            ENCODE_DATETIME_FORMAT_SUBSECOND
+        };
+        out.set_value(dt_utc.format(format).map_err(|err| err.to_string())?);
+        Ok(IsNull::No)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    extern crate dotenvy;
+
+    use super::time::{
+        macros::{date, datetime},
+        Date as NaiveDate, Duration, OffsetDateTime, PrimitiveDateTime, Time as NaiveTime,
+    };
+
+    use super::naive_utc;
+
+    use crate::dsl::{now, sql};
+    use crate::prelude::*;
+    use crate::select;
+    use crate::sql_types::{Text, Time, Timestamp, TimestamptzSqlite};
+    use crate::test_helpers::connection;
+
+    sql_function!(fn datetime(x: Text) -> Timestamp);
+    sql_function!(fn time(x: Text) -> Time);
+    sql_function!(fn date(x: Text) -> Date);
+
+    #[test]
+    fn unix_epoch_encodes_correctly() {
+        let connection = &mut connection();
+        let time = datetime!(1970-1-1 0:0:0);
+        let query = select(datetime("1970-01-01 00:00:00.000000").eq(time));
+        assert_eq!(Ok(true), query.get_result(connection));
+    }
+
+    #[test]
+    fn unix_epoch_decodes_correctly_in_all_possible_formats() {
+        let connection = &mut connection();
+        let time = datetime!(1970-1-1 0:0:0);
+        let valid_epoch_formats = vec![
+            "1970-01-01 00:00",
+            "1970-01-01 00:00:00",
+            "1970-01-01 00:00:00.000",
+            "1970-01-01 00:00:00.000000",
+            "1970-01-01T00:00",
+            "1970-01-01T00:00:00",
+            "1970-01-01T00:00:00.000",
+            "1970-01-01T00:00:00.000000",
+            "1970-01-01 00:00Z",
+            "1970-01-01 00:00:00Z",
+            "1970-01-01 00:00:00.000Z",
+            "1970-01-01 00:00:00.000000Z",
+            "1970-01-01T00:00Z",
+            "1970-01-01T00:00:00Z",
+            "1970-01-01T00:00:00.000Z",
+            "1970-01-01T00:00:00.000000Z",
+            "1970-01-01 00:00+00:00",
+            "1970-01-01 00:00:00+00:00",
+            "1970-01-01 00:00:00.000+00:00",
+            "1970-01-01 00:00:00.000000+00:00",
+            "1970-01-01T00:00+00:00",
+            "1970-01-01T00:00:00+00:00",
+            "1970-01-01T00:00:00.000+00:00",
+            "1970-01-01T00:00:00.000000+00:00",
+            "1970-01-01 00:00+01:00",
+            "1970-01-01 00:00:00+01:00",
+            "1970-01-01 00:00:00.000+01:00",
+            "1970-01-01 00:00:00.000000+01:00",
+            "1970-01-01T00:00+01:00",
+            "1970-01-01T00:00:00+01:00",
+            "1970-01-01T00:00:00.000+01:00",
+            "1970-01-01T00:00:00.000000+01:00",
+            "1970-01-01T00:00-01:00",
+            "1970-01-01T00:00:00-01:00",
+            "1970-01-01T00:00:00.000-01:00",
+            "1970-01-01T00:00:00.000000-01:00",
+            "1970-01-01T00:00-01:00",
+            "1970-01-01T00:00:00-01:00",
+            "1970-01-01T00:00:00.000-01:00",
+            "1970-01-01T00:00:00.000000-01:00",
+            "2440587.5",
+        ];
+
+        for s in valid_epoch_formats {
+            let epoch_from_sql =
+                select(sql::<Timestamp>(&format!("'{}'", s))).get_result(connection);
+            assert_eq!(Ok(time), epoch_from_sql, "format {} failed", s);
+        }
+    }
+
+    #[test]
+    fn times_relative_to_now_encode_correctly() {
+        let connection = &mut connection();
+        let time = naive_utc(OffsetDateTime::now_utc()) + Duration::seconds(60);
+        let query = select(now.lt(time));
+        assert_eq!(Ok(true), query.get_result(connection));
+
+        let time = naive_utc(OffsetDateTime::now_utc()) - Duration::seconds(600);
+        let query = select(now.gt(time));
+        assert_eq!(Ok(true), query.get_result(connection));
+    }
+
+    #[test]
+    fn times_of_day_encode_correctly() {
+        let connection = &mut connection();
+
+        let midnight = NaiveTime::from_hms(0, 0, 0).unwrap();
+        let query = select(time("00:00:00.000000").eq(midnight));
+        assert_eq!(query.get_result::<bool>(connection).unwrap(), true);
+
+        let noon = NaiveTime::from_hms(12, 0, 0).unwrap();
+        let query = select(time("12:00:00.000000").eq(noon));
+        assert_eq!(query.get_result::<bool>(connection).unwrap(), true);
+
+        let roughly_half_past_eleven = NaiveTime::from_hms_micro(23, 37, 4, 2200).unwrap();
+        let query = select(sql::<Time>("'23:37:04.002200'").eq(roughly_half_past_eleven));
+        assert_eq!(query.get_result::<bool>(connection).unwrap(), true);
+    }
+
+    #[test]
+    fn times_of_day_decode_correctly() {
+        let connection = &mut connection();
+        let midnight = NaiveTime::from_hms(0, 0, 0).unwrap();
+        let valid_midnight_formats = &[
+            "00:00",
+            "00:00:00",
+            "00:00:00.000",
+            "00:00:00.000000",
+            "00:00Z",
+            "00:00:00Z",
+            "00:00:00.000Z",
+            "00:00:00.000000Z",
+            "00:00+00:00",
+            "00:00:00+00:00",
+            "00:00:00.000+00:00",
+            "00:00:00.000000+00:00",
+            "00:00+01:00",
+            "00:00:00+01:00",
+            "00:00:00.000+01:00",
+            "00:00:00.000000+01:00",
+            "00:00-01:00",
+            "00:00:00-01:00",
+            "00:00:00.000-01:00",
+            "00:00:00.000000-01:00",
+        ];
+        for format in valid_midnight_formats {
+            let query = select(sql::<Time>(&format!("'{}'", format)));
+            assert_eq!(
+                Ok(midnight),
+                query.get_result::<NaiveTime>(connection),
+                "format {} failed",
+                format
+            );
+        }
+
+        let noon = NaiveTime::from_hms(12, 0, 0).unwrap();
+        let query = select(sql::<Time>("'12:00:00'"));
+        assert_eq!(Ok(noon), query.get_result::<NaiveTime>(connection));
+
+        let roughly_half_past_eleven = NaiveTime::from_hms_micro(23, 37, 4, 2200).unwrap();
+        let query = select(sql::<Time>("'23:37:04.002200'"));
+        assert_eq!(
+            Ok(roughly_half_past_eleven),
+            query.get_result::<NaiveTime>(connection)
+        );
+    }
+
+    #[test]
+    fn dates_encode_correctly() {
+        let connection = &mut connection();
+        let january_first_2000 = date!(2000 - 1 - 1);
+        let query = select(date("2000-01-01").eq(january_first_2000));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let distant_past = date!(0 - 4 - 11);
+        let query = select(date("0000-04-11").eq(distant_past));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let january_first_2018 = date!(2018 - 1 - 1);
+        let query = select(date("2018-01-01").eq(january_first_2018));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let distant_future = date!(9999 - 1 - 8);
+        let query = select(date("9999-01-08").eq(distant_future));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn dates_decode_correctly() {
+        let connection = &mut connection();
+        let january_first_2000 = date!(2000 - 1 - 1);
+        let query = select(date("2000-01-01"));
+        assert_eq!(
+            Ok(january_first_2000),
+            query.get_result::<NaiveDate>(connection)
+        );
+
+        let distant_past = date!(0 - 4 - 11);
+        let query = select(date("0000-04-11"));
+        assert_eq!(Ok(distant_past), query.get_result::<NaiveDate>(connection));
+
+        let january_first_2018 = date!(2018 - 1 - 1);
+        let query = select(date("2018-01-01"));
+        assert_eq!(
+            Ok(january_first_2018),
+            query.get_result::<NaiveDate>(connection)
+        );
+
+        let distant_future = date!(9999 - 1 - 8);
+        let query = select(date("9999-01-08"));
+        assert_eq!(
+            Ok(distant_future),
+            query.get_result::<NaiveDate>(connection)
+        );
+    }
+
+    #[test]
+    fn datetimes_decode_correctly() {
+        let connection = &mut connection();
+        let january_first_2000 = datetime!(2000-1-1 1:1:1);
+        let query = select(datetime("2000-01-01 01:01:01.000000"));
+        assert_eq!(
+            Ok(january_first_2000),
+            query.get_result::<PrimitiveDateTime>(connection)
+        );
+
+        let distant_past = datetime!(0-4-11 2:2:2);
+        let query = select(datetime("0000-04-11 02:02:02.000000"));
+        assert_eq!(
+            Ok(distant_past),
+            query.get_result::<PrimitiveDateTime>(connection)
+        );
+
+        let january_first_2018 = date!(2018 - 1 - 1);
+        let query = select(date("2018-01-01"));
+        assert_eq!(
+            Ok(january_first_2018),
+            query.get_result::<NaiveDate>(connection)
+        );
+
+        let distant_future = datetime!(9999 - 1 - 8 23:59:59.0001);
+        let query = select(sql::<Timestamp>("'9999-01-08 23:59:59.000100'"));
+        assert_eq!(
+            Ok(distant_future),
+            query.get_result::<PrimitiveDateTime>(connection)
+        );
+    }
+
+    #[test]
+    fn datetimes_encode_correctly() {
+        let connection = &mut connection();
+        let january_first_2000 = datetime!(2000-1-1 0:0:0);
+        let query = select(datetime("2000-01-01 00:00:00.000000").eq(january_first_2000));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let distant_past = datetime!(0-4-11 20:00:20);
+        let query = select(datetime("0000-04-11 20:00:20.000000").eq(distant_past));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let january_first_2018 = datetime!(2018 - 1 - 1 12:00:00.0005);
+        let query = select(sql::<Timestamp>("'2018-01-01 12:00:00.000500'").eq(january_first_2018));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        let distant_future = datetime!(9999-1-8 0:0:0);
+        let query = select(datetime("9999-01-08 00:00:00.000000").eq(distant_future));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn insert_timestamptz_into_table_as_text() {
+        crate::table! {
+            #[allow(unused_parens)]
+            test_insert_timestamptz_into_table_as_text(id) {
+                id -> Integer,
+                timestamp_with_tz -> TimestamptzSqlite,
+            }
+        }
+        let conn = &mut connection();
+        crate::sql_query(
+            "CREATE TABLE test_insert_timestamptz_into_table_as_text(id INTEGER PRIMARY KEY, timestamp_with_tz TEXT);",
+        )
+        .execute(conn)
+        .unwrap();
+
+        let time: OffsetDateTime = datetime!(1970-1-1 0:0:0.0 utc);
+
+        crate::insert_into(test_insert_timestamptz_into_table_as_text::table)
+            .values(vec![(
+                test_insert_timestamptz_into_table_as_text::id.eq(1),
+                test_insert_timestamptz_into_table_as_text::timestamp_with_tz.eq(sql::<
+                    TimestamptzSqlite,
+                >(
+                    "'1970-01-01 00:00:00.000000+00:00'",
+                )),
+            )])
+            .execute(conn)
+            .unwrap();
+
+        let result = test_insert_timestamptz_into_table_as_text::table
+            .select(test_insert_timestamptz_into_table_as_text::timestamp_with_tz)
+            .get_result::<OffsetDateTime>(conn)
+            .unwrap();
+        assert_eq!(result, time);
+    }
+
+    #[test]
+    fn can_query_timestamptz_column_with_between() {
+        crate::table! {
+            #[allow(unused_parens)]
+            test_query_timestamptz_column_with_between(id) {
+                id -> Integer,
+                timestamp_with_tz -> TimestamptzSqlite,
+            }
+        }
+        let conn = &mut connection();
+        crate::sql_query(
+            "CREATE TABLE test_query_timestamptz_column_with_between(id INTEGER PRIMARY KEY, timestamp_with_tz TEXT);",
+        )
+        .execute(conn)
+        .unwrap();
+
+        crate::insert_into(test_query_timestamptz_column_with_between::table)
+            .values(vec![
+                (
+                    test_query_timestamptz_column_with_between::id.eq(1),
+                    test_query_timestamptz_column_with_between::timestamp_with_tz.eq(sql::<
+                        TimestamptzSqlite,
+                    >(
+                        "'1970-01-01 00:00:01.000000+00:00'",
+                    )),
+                ),
+                (
+                    test_query_timestamptz_column_with_between::id.eq(2),
+                    test_query_timestamptz_column_with_between::timestamp_with_tz.eq(sql::<
+                        TimestamptzSqlite,
+                    >(
+                        "'1970-01-01 00:00:02.000000+00:00'",
+                    )),
+                ),
+                (
+                    test_query_timestamptz_column_with_between::id.eq(3),
+                    test_query_timestamptz_column_with_between::timestamp_with_tz.eq(sql::<
+                        TimestamptzSqlite,
+                    >(
+                        "'1970-01-01 00:00:03.000000+00:00'",
+                    )),
+                ),
+                (
+                    test_query_timestamptz_column_with_between::id.eq(4),
+                    test_query_timestamptz_column_with_between::timestamp_with_tz.eq(sql::<
+                        TimestamptzSqlite,
+                    >(
+                        "'1970-01-01 00:00:04.000000+00:00'",
+                    )),
+                ),
+            ])
+            .execute(conn)
+            .unwrap();
+
+        let result = test_query_timestamptz_column_with_between::table
+            .select(test_query_timestamptz_column_with_between::timestamp_with_tz)
+            .filter(
+                test_query_timestamptz_column_with_between::timestamp_with_tz
+                    .gt(datetime!(1970-1-1 0:0:0.0 utc)),
+            )
+            .filter(
+                test_query_timestamptz_column_with_between::timestamp_with_tz
+                    .lt(datetime!(1970-1-1 0:0:4.0 utc)),
+            )
+            .count()
+            .get_result::<_>(conn);
+        assert_eq!(result, Ok(3));
+    }
+
+    #[test]
+    fn unix_epoch_encodes_correctly_with_timezone() {
+        let connection = &mut connection();
+        // West one hour is negative offset
+        let time = datetime!(1970-1-1 0:00:00.001 -1:00);
+        let query = select(sql::<TimestamptzSqlite>("'1970-01-01 01:00:00.001+00:00'").eq(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn unix_epoch_encodes_correctly_with_utc_timezone() {
+        let connection = &mut connection();
+        let time: OffsetDateTime = datetime!(1970-1-1 0:0:0.001 utc);
+        let query = select(sql::<TimestamptzSqlite>("'1970-01-01 00:00:00.001+00:00'").eq(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+
+        // and without millisecond
+        let time: OffsetDateTime = datetime!(1970-1-1 0:0:0 utc);
+        let query = select(sql::<TimestamptzSqlite>("'1970-01-01 00:00:00+00:00'").eq(time));
+        assert!(query.get_result::<bool>(connection).unwrap());
+    }
+
+    #[test]
+    fn unix_epoch_decodes_correctly_with_utc_timezone_in_all_possible_formats() {
+        let connection = &mut connection();
+        let time: OffsetDateTime = datetime!(1970-1-1 0:0:0 utc);
+        let valid_epoch_formats = vec![
+            "1970-01-01 00:00Z",
+            "1970-01-01 00:00:00Z",
+            "1970-01-01 00:00:00.000Z",
+            "1970-01-01 00:00:00.000000Z",
+            "1970-01-01T00:00Z",
+            "1970-01-01T00:00:00Z",
+            "1970-01-01T00:00:00.000Z",
+            "1970-01-01T00:00:00.000000Z",
+            "1970-01-01 00:00+00:00",
+            "1970-01-01 00:00:00+00:00",
+            "1970-01-01 00:00:00.000+00:00",
+            "1970-01-01 00:00:00.000000+00:00",
+            "1970-01-01T00:00+00:00",
+            "1970-01-01T00:00:00+00:00",
+            "1970-01-01T00:00:00.000+00:00",
+            "1970-01-01T00:00:00.000000+00:00",
+            "1970-01-01 00:00+01:00",
+            "1970-01-01 00:00:00+01:00",
+            "1970-01-01 00:00:00.000+01:00",
+            "1970-01-01 00:00:00.000000+01:00",
+            "1970-01-01T00:00+01:00",
+            "1970-01-01T00:00:00+01:00",
+            "1970-01-01T00:00:00.000+01:00",
+            "1970-01-01T00:00:00.000000+01:00",
+            "1970-01-01T00:00-01:00",
+            "1970-01-01T00:00:00-01:00",
+            "1970-01-01T00:00:00.000-01:00",
+            "1970-01-01T00:00:00.000000-01:00",
+            "1970-01-01T00:00-01:00",
+            "1970-01-01T00:00:00-01:00",
+            "1970-01-01T00:00:00.000-01:00",
+            "1970-01-01T00:00:00.000000-01:00",
+            "2440587.5",
+        ];
+
+        for s in valid_epoch_formats {
+            let epoch_from_sql =
+                select(sql::<TimestamptzSqlite>(&format!("'{}'", s))).get_result(connection);
+            assert_eq!(Ok(time), epoch_from_sql, "format {} failed", s);
+        }
+    }
+}
diff --git a/diesel/src/sqlite/types/mod.rs b/diesel/src/sqlite/types/mod.rs
index 28c7c68c09dd..c6214d44daae 100644
--- a/diesel/src/sqlite/types/mod.rs
+++ b/diesel/src/sqlite/types/mod.rs
@@ -147,11 +147,15 @@ impl ToSql<sql_types::Double, Sqlite> for f64 {
 ///
 /// - [`chrono::NaiveDateTime`] with `feature = "chrono"`
 /// - [`chrono::DateTime`] with `feature = "chrono"`
+/// - [`time::PrimitiveDateTime`] with `feature = "time"`
+/// - [`time::OffsetDateTime`] with `feature = "time"`
 ///
 /// ### [`FromSql`] impls
 ///
 /// - [`chrono::NaiveDateTime`] with `feature = "chrono"`
 /// - [`chrono::DateTime`] with `feature = "chrono"`
+/// - [`time::PrimitiveDateTime`] with `feature = "time"`
+/// - [`time::OffsetDateTime`] with `feature = "time"`
 ///
 /// [`ToSql`]: crate::serialize::ToSql
 /// [`FromSql`]: crate::deserialize::FromSql
@@ -168,6 +172,22 @@ impl ToSql<sql_types::Double, Sqlite> for f64 {
     not(feature = "chrono"),
     doc = " [`chrono::DateTime`]: https://docs.rs/chrono/0.4.19/chrono/struct.DateTime.html"
 )]
+#[cfg_attr(
+    feature = "time",
+    doc = " [`time::PrimitiveDateTime`]: time::PrimitiveDateTime"
+)]
+#[cfg_attr(
+    not(feature = "time"),
+    doc = " [`time::PrimitiveDateTime`]: https://docs.rs/time/0.3.9/time/struct.PrimitiveDateTime.html"
+)]
+#[cfg_attr(
+    feature = "time",
+    doc = " [`time::OffsetDateTime`]: time::OffsetDateTime"
+)]
+#[cfg_attr(
+    not(feature = "time"),
+    doc = " [`time::OffsetDateTime`]: https://docs.rs/time/0.3.9/time/struct.OffsetDateTime.html"
+)]
 #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)]
 #[diesel(sqlite_type(name = "Text"))]
 #[cfg(feature = "sqlite")]
diff --git a/diesel/src/type_impls/date_and_time.rs b/diesel/src/type_impls/date_and_time.rs
index e0f31b398d6b..b189fc275e1e 100644
--- a/diesel/src/type_impls/date_and_time.rs
+++ b/diesel/src/type_impls/date_and_time.rs
@@ -50,3 +50,42 @@ mod chrono {
     #[cfg_attr(feature = "sqlite", diesel(sql_type = crate::sql_types::TimestamptzSqlite))]
     struct DateTimeProxy<Tz: TimeZone>(DateTime<Tz>);
 }
+
+#[cfg(feature = "time")]
+mod time {
+    use time::{Date as NaiveDate, OffsetDateTime, PrimitiveDateTime, Time as NaiveTime};
+
+    use crate::deserialize::FromSqlRow;
+    use crate::expression::AsExpression;
+    use crate::sql_types::{Date, Time, Timestamp};
+
+    #[derive(AsExpression, FromSqlRow)]
+    #[diesel(foreign_derive)]
+    #[diesel(sql_type = Date)]
+    struct NaiveDateProxy(NaiveDate);
+
+    #[derive(AsExpression, FromSqlRow)]
+    #[diesel(foreign_derive)]
+    #[diesel(sql_type = Time)]
+    struct NaiveTimeProxy(NaiveTime);
+
+    #[derive(AsExpression, FromSqlRow)]
+    #[diesel(foreign_derive)]
+    #[diesel(sql_type = Timestamp)]
+    #[cfg_attr(
+        feature = "postgres_backend",
+        diesel(sql_type = crate::sql_types::Timestamptz)
+    )]
+    #[cfg_attr(feature = "mysql_backend", diesel(sql_type = crate::sql_types::Datetime))]
+    struct NaiveDateTimeProxy(PrimitiveDateTime);
+
+    #[derive(AsExpression, FromSqlRow)]
+    #[diesel(foreign_derive)]
+    #[cfg_attr(
+        feature = "postgres_backend",
+        diesel(sql_type = crate::sql_types::Timestamptz)
+    )]
+    #[cfg_attr(feature = "sqlite", diesel(sql_type = crate::sql_types::TimestamptzSqlite))]
+    #[cfg_attr(feature = "mysql_backend", diesel(sql_type = crate::sql_types::Datetime))]
+    struct DateTimeProxy(OffsetDateTime);
+}
diff --git a/diesel_bench/Cargo.toml b/diesel_bench/Cargo.toml
index 887f6d38d79a..4dadf4ccdd9f 100644
--- a/diesel_bench/Cargo.toml
+++ b/diesel_bench/Cargo.toml
@@ -11,7 +11,7 @@ autobenches = false
 [dependencies]
 dotenvy = "0.15"
 criterion = "0.3.2"
-sqlx = {version = "0.5.13", features = ["runtime-tokio-rustls"], optional = true}
+sqlx = {version = "0.6", features = ["runtime-tokio-rustls"], optional = true}
 tokio = {version = "1", optional = true}
 rusqlite = {version = "0.27", optional = true}
 rust_postgres = {version = "0.19", optional = true, package = "postgres"}
@@ -20,9 +20,9 @@ rustorm = {version = "0.20", optional = true}
 rustorm_dao = {version = "0.20", optional = true}
 quaint = {version = "=0.2.0-alpha.13", optional = true}
 serde = {version = "1", optional = true, features = ["derive"]}
-sea-orm = {version = "0.7", optional = true, features = ["runtime-tokio-rustls"]}
+sea-orm = {version = "0.9", optional = true, features = ["runtime-tokio-rustls"]}
 futures = {version = "0.3", optional = true}
-#diesel-async = {git = "https://github.com/weiznich/diesel_async", rev = "61183dc252e85935d3605f1e3206cd7065d456de", optional = true, default-features = false}
+#diesel-async = {git = "https://github.com/weiznich/diesel_async", rev = "3ab3cf8", optional = true, default-features = false}
 criterion-perf-events = { version = "0.2", optional = true}
 perfcnt = {version = "0.8", optional = true}
 
@@ -52,6 +52,7 @@ sqlx-bench = ["sqlx", "tokio", "sqlx/runtime-tokio-rustls"]
 instruction_count = ["criterion-perf-events", "perfcnt"]
 fast_run = []
 
-[replace]
-"quaint:0.2.0-alpha.13" = {git = "https://github.com/prisma/quaint", rev = "e077df3"}
-#"https://github.com/diesel-rs/diesel#2.0.0-rc.0" = { path = "../diesel"}
+
+[patch.crates-io]
+quaint = {git = "https://github.com/prisma/quaint", rev = "e077df3"}
+#diesel = { path = "../diesel"}
diff --git a/diesel_cli/Cargo.toml b/diesel_cli/Cargo.toml
index b5edc6196897..5f8555d1d26b 100644
--- a/diesel_cli/Cargo.toml
+++ b/diesel_cli/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "diesel_cli"
-version = "2.0.0-rc.1"
+version = "2.0.0"
 license = "MIT OR Apache-2.0"
 description = "Provides the CLI for the Diesel crate"
 readme = "README.md"
@@ -26,19 +26,19 @@ dotenvy = "0.15"
 heck = "0.4.0"
 serde = { version = "1.0.0", features = ["derive"] }
 toml = "0.5"
-url = { version = "2.1.0", optional = true }
+url = { version = "2.2.2", optional = true }
 libsqlite3-sys = { version = ">=0.17.2, <0.26.0", optional = true }
 diffy = "0.2.0"
 regex = "1.0.6"
 serde_regex = "1.1"
 
 [dependencies.diesel]
-version = "~2.0.0-rc.1"
+version = "~2.0.0"
 path = "../diesel"
 default-features = false
 
 [dependencies.diesel_migrations]
-version = "~2.0.0-rc.1"
+version = "~2.0.0"
 path = "../diesel_migrations/"
 
 [dev-dependencies]
diff --git a/diesel_cli/src/infer_schema_internals/data_structures.rs b/diesel_cli/src/infer_schema_internals/data_structures.rs
index ec06b9c0abc0..6b8dfd040b73 100644
--- a/diesel_cli/src/infer_schema_internals/data_structures.rs
+++ b/diesel_cli/src/infer_schema_internals/data_structures.rs
@@ -16,7 +16,7 @@ pub struct ColumnInformation {
     pub nullable: bool,
 }
 
-#[derive(Debug, PartialEq, Clone)]
+#[derive(Debug, PartialEq, Clone, Eq)]
 pub struct ColumnType {
     pub schema: Option<String>,
     pub rust_name: String,
diff --git a/diesel_cli/src/print_schema.rs b/diesel_cli/src/print_schema.rs
index 0e59f4846069..98239b799758 100644
--- a/diesel_cli/src/print_schema.rs
+++ b/diesel_cli/src/print_schema.rs
@@ -245,6 +245,7 @@ impl CustomTypeList {
     }
 }
 
+#[allow(clippy::print_in_format_impl)]
 impl Display for CustomTypeList {
     fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
         if self.types_sorted.is_empty() {
diff --git a/diesel_derives/Cargo.toml b/diesel_derives/Cargo.toml
index 26d63418a0b5..dce07bc66453 100644
--- a/diesel_derives/Cargo.toml
+++ b/diesel_derives/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "diesel_derives"
-version = "2.0.0-rc.1"
+version = "2.0.0"
 license = "MIT OR Apache-2.0"
 description = "You should not use this crate directly, it is internal to Diesel."
 documentation = "https://diesel.rs/guides/"
@@ -21,7 +21,7 @@ cfg-if = "1"
 dotenvy = "0.15"
 
 [dev-dependencies.diesel]
-version = "~2.0.0-rc.1"
+version = "~2.0.0"
 path = "../diesel"
 
 [lib]
diff --git a/diesel_derives/src/attrs.rs b/diesel_derives/src/attrs.rs
index 4bc7a5b5d7f1..9da55c748dea 100644
--- a/diesel_derives/src/attrs.rs
+++ b/diesel_derives/src/attrs.rs
@@ -8,16 +8,19 @@ use syn::parse::discouraged::Speculative;
 use syn::parse::{Parse, ParseStream, Parser, Result};
 use syn::punctuated::Punctuated;
 use syn::token::Comma;
-use syn::{parenthesized, Attribute, Ident, LitBool, LitStr, Path, TypePath};
+use syn::{parenthesized, Attribute, Ident, LitBool, LitStr, Path, Type, TypePath};
 
 use deprecated::ParseDeprecated;
 use parsers::{BelongsTo, MysqlType, PostgresType, SqliteType};
 use util::{
     parse_eq, parse_paren, unknown_attribute, BELONGS_TO_NOTE, COLUMN_NAME_NOTE,
-    DESERIALIZE_AS_NOTE, MYSQL_TYPE_NOTE, POSTGRES_TYPE_NOTE, SERIALIZE_AS_NOTE, SQLITE_TYPE_NOTE,
-    SQL_TYPE_NOTE, TABLE_NAME_NOTE, TREAT_NONE_AS_DEFAULT_VALUE_NOTE, TREAT_NONE_AS_NULL_NOTE,
+    DESERIALIZE_AS_NOTE, MYSQL_TYPE_NOTE, POSTGRES_TYPE_NOTE, SELECT_EXPRESSION_NOTE,
+    SELECT_EXPRESSION_TYPE_NOTE, SERIALIZE_AS_NOTE, SQLITE_TYPE_NOTE, SQL_TYPE_NOTE,
+    TABLE_NAME_NOTE, TREAT_NONE_AS_DEFAULT_VALUE_NOTE, TREAT_NONE_AS_NULL_NOTE,
 };
 
+use crate::field::SelectExpr;
+
 pub struct AttributeSpanWrapper<T> {
     pub item: T,
     pub attribute_span: Span,
@@ -31,6 +34,8 @@ pub enum FieldAttr {
     SqlType(Ident, TypePath),
     SerializeAs(Ident, TypePath),
     DeserializeAs(Ident, TypePath),
+    SelectExpression(Ident, SelectExpr),
+    SelectExpressionType(Ident, Type),
 }
 
 #[derive(Clone)]
@@ -110,6 +115,14 @@ impl Parse for FieldAttr {
                 name,
                 parse_eq(input, DESERIALIZE_AS_NOTE)?,
             )),
+            "select_expression" => Ok(FieldAttr::SelectExpression(
+                name,
+                parse_eq(input, SELECT_EXPRESSION_NOTE)?,
+            )),
+            "select_expression_type" => Ok(FieldAttr::SelectExpressionType(
+                name,
+                parse_eq(input, SELECT_EXPRESSION_TYPE_NOTE)?,
+            )),
 
             _ => unknown_attribute(
                 &name,
@@ -119,6 +132,8 @@ impl Parse for FieldAttr {
                     "sql_type",
                     "serialize_as",
                     "deserialize_as",
+                    "select_expression",
+                    "select_expression_type",
                 ],
             ),
         }
@@ -132,7 +147,9 @@ impl Spanned for FieldAttr {
             | FieldAttr::ColumnName(ident, _)
             | FieldAttr::SqlType(ident, _)
             | FieldAttr::SerializeAs(ident, _)
-            | FieldAttr::DeserializeAs(ident, _) => ident.span(),
+            | FieldAttr::DeserializeAs(ident, _)
+            | FieldAttr::SelectExpression(ident, _)
+            | FieldAttr::SelectExpressionType(ident, _) => ident.span(),
         }
     }
 }
diff --git a/diesel_derives/src/diesel_public_if.rs b/diesel_derives/src/diesel_public_if.rs
index 8c2c30dc453f..53eaefe00918 100644
--- a/diesel_derives/src/diesel_public_if.rs
+++ b/diesel_derives/src/diesel_public_if.rs
@@ -1,5 +1,69 @@
-pub(crate) fn expand(cfg: syn::Meta, item: EntryWithVisibility) -> proc_macro2::TokenStream {
-    item.hide_for_cfg(cfg)
+use syn::{punctuated::Punctuated, DeriveInput};
+
+pub(crate) fn expand(cfg: CfgInput, item: EntryWithVisibility) -> proc_macro2::TokenStream {
+    item.hide_for_cfg(cfg.cfg, cfg.field_list)
+}
+
+pub struct CfgInput {
+    cfg: syn::Meta,
+    field_list: Vec<syn::Ident>,
+}
+
+impl syn::parse::Parse for CfgInput {
+    fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
+        let mut cfg = Punctuated::<syn::Meta, Token![,]>::parse_terminated(input)?;
+        if cfg.len() == 1 {
+            Ok(Self {
+                cfg: cfg
+                    .pop()
+                    .expect("There is exactly one element")
+                    .into_value(),
+                field_list: Vec::new(),
+            })
+        } else if cfg.len() == 2 {
+            let value_1 = cfg
+                .pop()
+                .expect("There is exactly one element")
+                .into_value();
+            let value_2 = cfg
+                .pop()
+                .expect("There is exactly one element")
+                .into_value();
+            let (cfg, fields) = if matches!(&value_1, syn::Meta::List(v) if v.path.is_ident("public_fields"))
+            {
+                (value_2, value_1)
+            } else if matches!(&value_2, syn::Meta::List(v) if v.path.is_ident("public_fields")) {
+                (value_1, value_2)
+            } else {
+                panic!(
+                    "Incompatible argument list detected. `__diesel_public_if` \
+                     expects a cfg argument and a optional public_fields"
+                )
+            };
+            let field_list = if let syn::Meta::List(v) = fields {
+                v.nested
+                    .into_iter()
+                    .map(|v| {
+                        if let syn::NestedMeta::Meta(syn::Meta::Path(p)) = v {
+                            p.get_ident()
+                                .expect("Field names need to be idents")
+                                .clone()
+                        } else {
+                            panic!("The field name key requires a list of field names as argument")
+                        }
+                    })
+                    .collect()
+            } else {
+                unreachable!()
+            };
+            Ok(Self { cfg, field_list })
+        } else {
+            panic!(
+                "Incompatible argument list detected. `__diesel_public_if` \
+                 expects a cfg argument and a optional public_fields"
+            )
+        }
+    }
 }
 
 #[derive(Clone)]
@@ -13,6 +77,13 @@ pub enum EntryWithVisibility {
         vis: syn::Visibility,
         tail: proc_macro2::TokenStream,
     },
+    Struct {
+        meta: Vec<syn::Attribute>,
+        vis: syn::Visibility,
+        def: syn::DataStruct,
+        ident: syn::Ident,
+        generics: syn::Generics,
+    },
 }
 
 impl syn::parse::Parse for EntryWithVisibility {
@@ -23,22 +94,41 @@ impl syn::parse::Parse for EntryWithVisibility {
             Ok(Self::TraitFunction { meta, tail })
         } else {
             let vis = input.parse()?;
-            let tail = input.parse()?;
-            Ok(Self::Item { meta, vis, tail })
+            if input.peek(Token![struct]) {
+                let s = DeriveInput::parse(input)?;
+                if let syn::Data::Struct(def) = s.data {
+                    Ok(Self::Struct {
+                        meta,
+                        vis,
+                        def,
+                        generics: s.generics,
+                        ident: s.ident,
+                    })
+                } else {
+                    unreachable!()
+                }
+            } else {
+                let tail = input.parse()?;
+                Ok(Self::Item { meta, vis, tail })
+            }
         }
     }
 }
 
 impl EntryWithVisibility {
-    fn hide_for_cfg(&self, cfg: syn::Meta) -> proc_macro2::TokenStream {
+    fn hide_for_cfg(
+        &self,
+        cfg: syn::Meta,
+        field_list: Vec<syn::Ident>,
+    ) -> proc_macro2::TokenStream {
         match self {
-            EntryWithVisibility::TraitFunction { meta, tail } => quote! {
+            EntryWithVisibility::TraitFunction { meta, tail } if field_list.is_empty() => quote! {
                 #(#meta)*
                 #[cfg_attr(not(#cfg), doc(hidden))]
                 #[cfg_attr(doc_cfg, doc(cfg(#cfg)))]
                 #tail
             },
-            EntryWithVisibility::Item { meta, vis, tail } => {
+            EntryWithVisibility::Item { meta, vis, tail } if field_list.is_empty() => {
                 quote! {
                     #(#meta)*
                     #[cfg(not(#cfg))]
@@ -49,6 +139,47 @@ impl EntryWithVisibility {
                     pub #tail
                 }
             }
+            EntryWithVisibility::Struct {
+                meta,
+                vis,
+                def,
+                ident,
+                generics,
+            } => {
+                let fields1 = def.fields.iter();
+                let fields2 = def.fields.iter().map(|f| {
+                    let mut ret = f.clone();
+                    if ret
+                        .ident
+                        .as_ref()
+                        .map(|i| field_list.contains(i))
+                        .unwrap_or(false)
+                    {
+                        ret.vis = syn::Visibility::Public(syn::VisPublic {
+                            pub_token: Default::default(),
+                        });
+                    }
+                    ret
+                });
+
+                quote! {
+                    #(#meta)*
+                    #[cfg(not(#cfg))]
+                    #vis struct #ident #generics {
+                        #(#fields1,)*
+                    }
+
+                    #(#meta)*
+                    #[cfg(#cfg)]
+                    #[non_exhaustive]
+                    pub struct #ident #generics {
+                        #(#fields2,)*
+                    }
+                }
+            }
+            EntryWithVisibility::TraitFunction { .. } | EntryWithVisibility::Item { .. } => {
+                panic!("Public field list is only supported for structs")
+            }
         }
     }
 }
diff --git a/diesel_derives/src/field.rs b/diesel_derives/src/field.rs
index 2e0f31e03672..29ebee65c861 100644
--- a/diesel_derives/src/field.rs
+++ b/diesel_derives/src/field.rs
@@ -1,5 +1,4 @@
 use proc_macro2::{Span, TokenStream};
-use quote::ToTokens;
 use syn::spanned::Spanned;
 use syn::{Field as SynField, Ident, Index, Type};
 
@@ -13,6 +12,8 @@ pub struct Field {
     pub sql_type: Option<AttributeSpanWrapper<Type>>,
     pub serialize_as: Option<AttributeSpanWrapper<Type>>,
     pub deserialize_as: Option<AttributeSpanWrapper<Type>>,
+    pub select_expression: Option<AttributeSpanWrapper<SelectExpr>>,
+    pub select_expression_type: Option<AttributeSpanWrapper<Type>>,
     pub embed: Option<AttributeSpanWrapper<bool>>,
 }
 
@@ -27,6 +28,8 @@ impl Field {
         let mut serialize_as = None;
         let mut deserialize_as = None;
         let mut embed = None;
+        let mut select_expression = None;
+        let mut select_expression_type = None;
 
         for attr in parse_attributes(attrs) {
             let attribute_span = attr.attribute_span;
@@ -60,6 +63,20 @@ impl Field {
                         ident_span,
                     })
                 }
+                FieldAttr::SelectExpression(_, value) => {
+                    select_expression = Some(AttributeSpanWrapper {
+                        item: value,
+                        attribute_span,
+                        ident_span,
+                    })
+                }
+                FieldAttr::SelectExpressionType(_, value) => {
+                    select_expression_type = Some(AttributeSpanWrapper {
+                        item: value,
+                        attribute_span,
+                        ident_span,
+                    })
+                }
                 FieldAttr::Embed(_) => {
                     embed = Some(AttributeSpanWrapper {
                         item: true,
@@ -88,6 +105,8 @@ impl Field {
             sql_type,
             serialize_as,
             deserialize_as,
+            select_expression,
+            select_expression_type,
             embed,
         }
     }
@@ -125,7 +144,7 @@ pub enum FieldName {
     Unnamed(Index),
 }
 
-impl ToTokens for FieldName {
+impl quote::ToTokens for FieldName {
     fn to_tokens(&self, tokens: &mut TokenStream) {
         match *self {
             FieldName::Named(ref x) => x.to_tokens(tokens),
@@ -133,3 +152,45 @@ impl ToTokens for FieldName {
         }
     }
 }
+
+/// We use this instead of directly `syn::Expr` to reduce compilation time
+///
+/// `syn::Expr` does not properly support tuples when `syn/full` feature is
+/// not enabled, and that feature slightly increases compilation time
+#[allow(clippy::large_enum_variant)]
+pub enum SelectExpr {
+    Expr(syn::Expr),
+    Tuple {
+        paren_token: syn::token::Paren,
+        content: proc_macro2::TokenStream,
+    },
+}
+
+impl quote::ToTokens for SelectExpr {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        match self {
+            SelectExpr::Expr(ref e) => e.to_tokens(tokens),
+            SelectExpr::Tuple {
+                ref paren_token,
+                ref content,
+            } => paren_token.surround(tokens, |tokens| content.to_tokens(tokens)),
+        }
+    }
+}
+
+impl syn::parse::Parse for SelectExpr {
+    fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
+        let lookahead = input.lookahead1();
+
+        if lookahead.peek(syn::token::Paren) {
+            let content;
+            let paren_token = syn::parenthesized!(content in input);
+            Ok(Self::Tuple {
+                paren_token,
+                content: content.parse()?,
+            })
+        } else {
+            input.parse::<syn::Expr>().map(Self::Expr)
+        }
+    }
+}
diff --git a/diesel_derives/src/lib.rs b/diesel_derives/src/lib.rs
index 25dc1a06dabb..c245975e2821 100644
--- a/diesel_derives/src/lib.rs
+++ b/diesel_derives/src/lib.rs
@@ -848,6 +848,14 @@ pub fn derive_queryable_by_name(input: TokenStream) -> TokenStream {
 /// * `#[diesel(embed)]`, specifies that the current field maps not only
 ///    single database column, but is a type that implements
 ///    `Selectable` on it's own
+/// * `#[diesel(select_expression = some_custom_select_expression)]`, overrides
+///   the entire select expression for the given field. It may be used to select with
+///   custom tuples, or specify `select_expression = my_table::some_field.is_not_null()`,
+///   or separate tables...
+///   It should be used in conjunction with `select_expression_type` (described below)
+/// * `#[diesel(select_expression_type = the_custom_select_expression_type]`, to be used
+///   in conjunction with `select_expression` (described above).
+///   For example: `#[diesel(select_expression_type = dsl::IsNotNull<my_table::some_field>)]`
 #[proc_macro_error]
 #[proc_macro_derive(Selectable, attributes(diesel))]
 pub fn derive_selectable(input: TokenStream) -> TokenStream {
diff --git a/diesel_derives/src/selectable.rs b/diesel_derives/src/selectable.rs
index 48aebb09e184..52d1ffe15a80 100644
--- a/diesel_derives/src/selectable.rs
+++ b/diesel_derives/src/selectable.rs
@@ -48,7 +48,10 @@ pub fn derive(item: DeriveInput) -> TokenStream {
 }
 
 fn field_column_ty(field: &Field, model: &Model) -> TokenStream {
-    if field.embed() {
+    if let Some(ref select_expression_type) = field.select_expression_type {
+        let ty = &select_expression_type.item;
+        quote!(#ty)
+    } else if field.embed() {
         let embed_ty = &field.ty;
         quote!(<#embed_ty as Selectable<__DB>>::SelectExpression)
     } else {
@@ -59,7 +62,13 @@ fn field_column_ty(field: &Field, model: &Model) -> TokenStream {
 }
 
 fn field_column_inst(field: &Field, model: &Model) -> TokenStream {
-    if field.embed() {
+    use syn::spanned::Spanned;
+
+    if let Some(ref select_expression) = field.select_expression {
+        let expr = &select_expression.item;
+        let span = expr.span();
+        quote::quote_spanned!(span => #expr)
+    } else if field.embed() {
         let embed_ty = &field.ty;
         quote!(<#embed_ty as Selectable<__DB>>::construct_selection())
     } else {
diff --git a/diesel_derives/src/util.rs b/diesel_derives/src/util.rs
index a9141e18ba57..e042f48c1fc7 100644
--- a/diesel_derives/src/util.rs
+++ b/diesel_derives/src/util.rs
@@ -17,6 +17,10 @@ pub const MYSQL_TYPE_NOTE: &str = "mysql_type(name = \"foo\")";
 pub const SQLITE_TYPE_NOTE: &str = "sqlite_type(name = \"foo\")";
 pub const POSTGRES_TYPE_NOTE: &str = "postgres_type(name = \"foo\", schema = \"public\")";
 pub const POSTGRES_TYPE_NOTE_ID: &str = "postgres_type(oid = 37, array_oid = 54)";
+pub const SELECT_EXPRESSION_NOTE: &str =
+    "select_expression = schema::table_name::column_name.is_not_null()";
+pub const SELECT_EXPRESSION_TYPE_NOTE: &str =
+    "select_expression_type = dsl::IsNotNull<schema::table_name::column_name>";
 
 pub fn unknown_attribute(name: &Ident, valid: &[&str]) -> ! {
     let prefix = if valid.len() == 1 { "" } else { " one of" };
diff --git a/diesel_dynamic_schema/Cargo.toml b/diesel_dynamic_schema/Cargo.toml
index 438717eabb70..0bf2131d041b 100644
--- a/diesel_dynamic_schema/Cargo.toml
+++ b/diesel_dynamic_schema/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "diesel-dynamic-schema"
-version = "0.2.0-rc.1"
+version = "0.2.0"
 license = "MIT OR Apache-2.0"
 edition = "2018"
 autotests = false
@@ -14,7 +14,7 @@ include = ["src/**/*", "LICENSE-*", "README.md"]
 rust-version = "1.56.0"
 
 [dependencies.diesel]
-version = "~2.0.0-rc.1"
+version = "~2.0.0"
 path = "../diesel/"
 default-features = false
 
diff --git a/diesel_dynamic_schema/src/dynamic_value.rs b/diesel_dynamic_schema/src/dynamic_value.rs
index db5e9ce0e605..ea3a3d804aa4 100644
--- a/diesel_dynamic_schema/src/dynamic_value.rs
+++ b/diesel_dynamic_schema/src/dynamic_value.rs
@@ -196,7 +196,7 @@ pub struct DynamicRow<I> {
 /// A helper struct used as field type in `DynamicRow`
 /// to also return the name of the field along with the
 /// value
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
 pub struct NamedField<I> {
     /// Name of the field
     pub name: String,
diff --git a/diesel_migrations/Cargo.toml b/diesel_migrations/Cargo.toml
index 9780242dae0f..ffe7535c53fd 100644
--- a/diesel_migrations/Cargo.toml
+++ b/diesel_migrations/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "diesel_migrations"
-version = "2.0.0-rc.1"
+version = "2.0.0"
 license = "MIT OR Apache-2.0"
 description = "Migration management for diesel"
 documentation = "https://docs.rs/crate/diesel_migrations"
@@ -9,11 +9,11 @@ edition = "2018"
 rust-version = "1.56.0"
 
 [dependencies.migrations_internals]
-version = "~2.0.0-rc.1"
+version = "~2.0.0"
 path = "migrations_internals"
 
 [dependencies.migrations_macros]
-version = "~2.0.0-rc.1"
+version = "~2.0.0"
 path = "migrations_macros"
 
 [dev-dependencies]
@@ -22,7 +22,7 @@ cfg-if = "1.0.0"
 tempfile = "3.2"
 
 [dependencies.diesel]
-version = "~2.0.0-rc.1"
+version = "~2.0.0"
 path = "../diesel"
 default-features = false
 
diff --git a/diesel_migrations/migrations_internals/Cargo.toml b/diesel_migrations/migrations_internals/Cargo.toml
index 2a63ad5d1ec1..2f1c67458cfe 100644
--- a/diesel_migrations/migrations_internals/Cargo.toml
+++ b/diesel_migrations/migrations_internals/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "migrations_internals"
-version = "2.0.0-rc.1"
+version = "2.0.0"
 license = "MIT OR Apache-2.0"
 description = "Internal implementation of diesels migration mechanism"
 homepage = "https://diesel.rs"
diff --git a/diesel_migrations/migrations_macros/Cargo.toml b/diesel_migrations/migrations_macros/Cargo.toml
index e3ae76eb2bd0..a300577330aa 100644
--- a/diesel_migrations/migrations_macros/Cargo.toml
+++ b/diesel_migrations/migrations_macros/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "migrations_macros"
-version = "2.0.0-rc.1"
+version = "2.0.0"
 license = "MIT OR Apache-2.0"
 description = "Codegeneration macros for diesels embedded migrations"
 homepage = "https://diesel.rs"
@@ -12,7 +12,7 @@ quote = "1"
 proc-macro2 = "1"
 
 [dependencies.migrations_internals]
-version = "~2.0.0-rc.1"
+version = "~2.0.0"
 path = "../migrations_internals"
 
 [dev-dependencies]
@@ -21,12 +21,12 @@ dotenvy = "0.15"
 cfg-if = "1.0.0"
 
 [dev-dependencies.diesel]
-version = "~2.0.0-rc.1"
+version = "~2.0.0"
 path = "../../diesel"
 default-features = false
 
 [dev-dependencies.diesel_migrations]
-version = "~2.0.0-rc.1"
+version = "~2.0.0"
 path = "../"
 default-features = false
 
diff --git a/diesel_migrations/src/file_based_migrations.rs b/diesel_migrations/src/file_based_migrations.rs
index 2aa5c1df78d6..ae21c82cb385 100644
--- a/diesel_migrations/src/file_based_migrations.rs
+++ b/diesel_migrations/src/file_based_migrations.rs
@@ -202,7 +202,7 @@ impl<DB: Backend> Migration<DB> for SqlFileMigration {
     }
 }
 
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
 pub struct DieselMigrationName {
     name: String,
     version: MigrationVersion<'static>,
diff --git a/examples/mysql/all_about_inserts/Cargo.toml b/examples/mysql/all_about_inserts/Cargo.toml
index 8611e4be8b4e..1f67046a64dd 100644
--- a/examples/mysql/all_about_inserts/Cargo.toml
+++ b/examples/mysql/all_about_inserts/Cargo.toml
@@ -2,9 +2,10 @@
 name = "all_about_inserts_mysql"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["mysql", "chrono"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["mysql", "chrono"] }
 serde = { version = "1.0.130", features = ["derive"] }
 serde_json = "1.0.68"
 chrono = { version = "0.4.19", default-features = false, features = ["clock", "std"] }
diff --git a/examples/mysql/getting_started_step_1/Cargo.toml b/examples/mysql/getting_started_step_1/Cargo.toml
index 63c718d25cf2..0406b4b826c2 100644
--- a/examples/mysql/getting_started_step_1/Cargo.toml
+++ b/examples/mysql/getting_started_step_1/Cargo.toml
@@ -2,9 +2,10 @@
 name = "diesel_demo_step_1_mysql"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["mysql"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["mysql"] }
 dotenvy = "0.15"
 
 [[bin]]
diff --git a/examples/mysql/getting_started_step_2/Cargo.toml b/examples/mysql/getting_started_step_2/Cargo.toml
index bbb3c0934d0f..ff16faed89d9 100644
--- a/examples/mysql/getting_started_step_2/Cargo.toml
+++ b/examples/mysql/getting_started_step_2/Cargo.toml
@@ -2,9 +2,10 @@
 name = "diesel_demo_step_2_mysql"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["mysql"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["mysql"] }
 dotenvy = "0.15"
 
 [[bin]]
diff --git a/examples/mysql/getting_started_step_3/Cargo.toml b/examples/mysql/getting_started_step_3/Cargo.toml
index 9ca8a7ff059c..d3cdaf571b82 100644
--- a/examples/mysql/getting_started_step_3/Cargo.toml
+++ b/examples/mysql/getting_started_step_3/Cargo.toml
@@ -2,9 +2,10 @@
 name = "diesel_demo_step_3_mysql"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["mysql"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["mysql"] }
 dotenvy = "0.15"
 
 [[bin]]
diff --git a/examples/postgres/advanced-blog-cli/Cargo.toml b/examples/postgres/advanced-blog-cli/Cargo.toml
index 13d4810ae164..497bf2c36817 100644
--- a/examples/postgres/advanced-blog-cli/Cargo.toml
+++ b/examples/postgres/advanced-blog-cli/Cargo.toml
@@ -2,18 +2,19 @@
 name = "advanced-blog-cli"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
 bcrypt = "0.10.1"
 chrono = { version = "0.4.19", default-features = false, features = ["clock", "std"] }
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["postgres", "chrono"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["postgres", "chrono"] }
 dotenvy = "0.15"
 structopt = "0.3"
 tempfile = "3.1.0"
 
 [dev-dependencies]
 assert_matches = "1.1"
-diesel_migrations = { version = "2.0.0-rc.1", features = ["postgres"], path = "../../../diesel_migrations" }
+diesel_migrations = { version = "2.0.0", features = ["postgres"], path = "../../../diesel_migrations" }
 lazy_static = "1.0"
 
 [[bin]]
diff --git a/examples/postgres/advanced-blog-cli/src/auth.rs b/examples/postgres/advanced-blog-cli/src/auth.rs
index f31656778674..450e55aa9893 100644
--- a/examples/postgres/advanced-blog-cli/src/auth.rs
+++ b/examples/postgres/advanced-blog-cli/src/auth.rs
@@ -22,7 +22,7 @@ impl From<BcryptError> for AuthenticationError {
 
 pub use self::AuthenticationError::{IncorrectPassword, NoPasswordSet, NoUsernameSet};
 
-#[derive(Queryable, Identifiable, Debug, PartialEq)]
+#[derive(Queryable, Identifiable, Debug, PartialEq, Eq)]
 pub struct User {
     pub id: i32,
     pub username: String,
diff --git a/examples/postgres/all_about_inserts/Cargo.toml b/examples/postgres/all_about_inserts/Cargo.toml
index 2314c79859aa..fe36622e1186 100644
--- a/examples/postgres/all_about_inserts/Cargo.toml
+++ b/examples/postgres/all_about_inserts/Cargo.toml
@@ -2,9 +2,10 @@
 name = "all_about_inserts"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["postgres"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["postgres"] }
 serde = { version = "1.0.130", features = ["derive"] }
 serde_json = "1.0.68"
 
diff --git a/examples/postgres/all_about_updates/Cargo.toml b/examples/postgres/all_about_updates/Cargo.toml
index f48c952f51fb..01107ae7aec0 100644
--- a/examples/postgres/all_about_updates/Cargo.toml
+++ b/examples/postgres/all_about_updates/Cargo.toml
@@ -2,9 +2,10 @@
 name = "all_about_updates"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["postgres"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["postgres"] }
 
 [lib]
 doc = false
diff --git a/examples/postgres/custom_types/Cargo.toml b/examples/postgres/custom_types/Cargo.toml
index ee8a2104711f..acdf825e9d82 100644
--- a/examples/postgres/custom_types/Cargo.toml
+++ b/examples/postgres/custom_types/Cargo.toml
@@ -2,9 +2,10 @@
 name = "custom-types"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { path = "../../../diesel", version = "2.0.0-rc.1", features = ["postgres"] }
+diesel = { path = "../../../diesel", version = "2.0.0", features = ["postgres"] }
 
 [[bin]]
 name = "custom-types"
diff --git a/examples/postgres/getting_started_step_1/Cargo.toml b/examples/postgres/getting_started_step_1/Cargo.toml
index 36ecf2524226..582eba5bbc80 100644
--- a/examples/postgres/getting_started_step_1/Cargo.toml
+++ b/examples/postgres/getting_started_step_1/Cargo.toml
@@ -2,9 +2,10 @@
 name = "diesel_demo_step_1_pg"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["postgres"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["postgres"] }
 dotenvy = "0.15"
 
 [[bin]]
diff --git a/examples/postgres/getting_started_step_2/Cargo.toml b/examples/postgres/getting_started_step_2/Cargo.toml
index 67fb736aee96..bfb0561bfc21 100644
--- a/examples/postgres/getting_started_step_2/Cargo.toml
+++ b/examples/postgres/getting_started_step_2/Cargo.toml
@@ -2,9 +2,10 @@
 name = "diesel_demo_step_2_pg"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["postgres"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["postgres"] }
 dotenvy = "0.15"
 
 [[bin]]
diff --git a/examples/postgres/getting_started_step_3/Cargo.toml b/examples/postgres/getting_started_step_3/Cargo.toml
index d585af312688..4c03c1594bcb 100644
--- a/examples/postgres/getting_started_step_3/Cargo.toml
+++ b/examples/postgres/getting_started_step_3/Cargo.toml
@@ -2,9 +2,10 @@
 name = "diesel_demo_step_3_pg"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["postgres"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["postgres"] }
 dotenvy = "0.15"
 
 [[bin]]
diff --git a/examples/sqlite/all_about_inserts/Cargo.toml b/examples/sqlite/all_about_inserts/Cargo.toml
index 8598b3ae89cc..a4223ac620a8 100644
--- a/examples/sqlite/all_about_inserts/Cargo.toml
+++ b/examples/sqlite/all_about_inserts/Cargo.toml
@@ -2,9 +2,10 @@
 name = "all_about_inserts_sqlite"
 version = "0.1.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["sqlite", "chrono"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["sqlite", "chrono"] }
 serde = { version = "1.0.130", features = ["derive"] }
 serde_json = "1.0.68"
 chrono = { version = "0.4.19", default-features = false, features = ["clock", "std"] }
diff --git a/examples/sqlite/getting_started_step_1/Cargo.toml b/examples/sqlite/getting_started_step_1/Cargo.toml
index 113039dddace..645a763a7a27 100644
--- a/examples/sqlite/getting_started_step_1/Cargo.toml
+++ b/examples/sqlite/getting_started_step_1/Cargo.toml
@@ -4,9 +4,10 @@ version = "0.1.0"
 license = "MIT OR Apache-2.0"
 authors = ["Taryn Hill <taryn@phrohdoh.com>"]
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["sqlite"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["sqlite"] }
 dotenvy = "0.15"
 
 [[bin]]
diff --git a/examples/sqlite/getting_started_step_2/Cargo.toml b/examples/sqlite/getting_started_step_2/Cargo.toml
index 04dd56514893..b14889e24228 100644
--- a/examples/sqlite/getting_started_step_2/Cargo.toml
+++ b/examples/sqlite/getting_started_step_2/Cargo.toml
@@ -3,9 +3,10 @@ name = "diesel_demo_step_2_sqlite"
 version = "0.1.0"
 license = "MIT OR Apache-2.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["sqlite"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["sqlite"] }
 dotenvy = "0.15"
 
 [[bin]]
diff --git a/examples/sqlite/getting_started_step_3/Cargo.toml b/examples/sqlite/getting_started_step_3/Cargo.toml
index 553fa0741cfd..6b0188b6bd3c 100644
--- a/examples/sqlite/getting_started_step_3/Cargo.toml
+++ b/examples/sqlite/getting_started_step_3/Cargo.toml
@@ -3,9 +3,10 @@ name = "diesel_demo_step_3_sqlite"
 version = "0.1.0"
 license = "MIT OR Apache-2.0"
 edition = "2018"
+publish = false
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", path = "../../../diesel", features = ["sqlite"] }
+diesel = { version = "2.0.0", path = "../../../diesel", features = ["sqlite"] }
 dotenvy = "0.15"
 
 [[bin]]
diff --git a/rust-toolchain b/rust-toolchain
index 3ebf789f5a8d..af92bdd9f58d 100644
--- a/rust-toolchain
+++ b/rust-toolchain
@@ -1,1 +1,1 @@
-1.56.0
+1.63.0


Test patch:
diff --git a/bin/test b/bin/test
index 8d0e71c4fbc5..1a05a26fe11b 100755
--- a/bin/test
+++ b/bin/test
@@ -2,51 +2,51 @@
 set -ex
 
 if [ "$1" = "integration" ]; then
-  if [ "$2" ]; then
-    BACKEND="$2"
-    shift 2
-  else
-    BACKEND=postgres
-    shift
-  fi
-  if [ "$BACKEND" = "mysql" ]; then
-    export RUST_TEST_THREADS=1
-  fi
-  (cd diesel_tests && cargo test --features "$BACKEND" --no-default-features $*)
+    if [ "$2" ]; then
+        BACKEND="$2"
+        shift 2
+    else
+        BACKEND=postgres
+        shift
+    fi
+    if [ "$BACKEND" = "mysql" ]; then
+        export RUST_TEST_THREADS=1
+    fi
+    (cd diesel_tests && cargo test --features "$BACKEND" --no-default-features "$*")
 elif [ "$1" = "compile" ]; then
-  shift
-  (cd diesel_compile_tests && cargo test $*)
+    shift
+    (cd diesel_compile_tests && cargo test "$*")
 else
-  (cd diesel && cargo test --no-default-features --features "extras sqlite" $*)
-  (cd diesel && cargo test --no-default-features --features "extras postgres" $*)
-  (cd diesel && cargo test --no-default-features --features "mysql" $* -- --test-threads 1)
+    (cd diesel && cargo test --no-default-features --features "extras sqlite" "$*")
+    (cd diesel && cargo test --no-default-features --features "extras postgres" "$*")
+    (cd diesel && cargo test --no-default-features --features "mysql" "$*" -- --test-threads 1)
 
-  (cd diesel_cli && cargo test --features "sqlite" --no-default-features $*)
-  (cd diesel_migrations && cargo test --features "sqlite diesel/sqlite" $*)
-  (cd diesel_migrations && cargo test --features "sqlite diesel/sqlite" $*)
-  (cd diesel_derives && cargo test --features "diesel/sqlite" $*)
-  (cd diesel_tests && cargo test --features "sqlite" --no-default-features $*)
-  (cd diesel_dynamic_schema && cargo test --features "sqlite diesel/sqlite" $*)
-  (cd diesel_bench && cargo test --features "sqlite" --benches $*)
+    (cd diesel_cli && cargo test --features "sqlite" --no-default-features "$*")
+    (cd diesel_migrations && cargo test --features "sqlite diesel/sqlite" "$*")
+    (cd diesel_migrations && cargo test --features "sqlite diesel/sqlite" "$*")
+    (cd diesel_derives && cargo test --features "diesel/sqlite" "$*")
+    (cd diesel_tests && cargo test --features "sqlite" --no-default-features "$*")
+    (cd diesel_dynamic_schema && cargo test --features "sqlite diesel/sqlite" "$*")
+    (cd diesel_bench && cargo test --features "sqlite" --benches "$*")
 
-  (cd diesel_migrations && cargo test --features "postgres diesel/postgres" $*)
-  (cd diesel_migrations/migrations_macros && cargo test --features "diesel/postgres postgres" $*)
-  (cd diesel_derives && cargo test --features "diesel/postgres" $*)
-  (cd diesel_cli && cargo test --features "postgres" --no-default-features $*)
-  (cd diesel_tests && cargo test --features "postgres" --no-default-features $*)
-  (cd diesel_dynamic_schema && cargo test --features "postgres diesel/postgres" $*)
-  (cd diesel_bench && cargo test --features "postgres" --benches $*)
+    (cd diesel_migrations && cargo test --features "postgres diesel/postgres" "$*")
+    (cd diesel_migrations/migrations_macros && cargo test --features "diesel/postgres postgres" "$*")
+    (cd diesel_derives && cargo test --features "diesel/postgres" "$*")
+    (cd diesel_cli && cargo test --features "postgres" --no-default-features "$*")
+    (cd diesel_tests && cargo test --features "postgres" --no-default-features "$*")
+    (cd diesel_dynamic_schema && cargo test --features "postgres diesel/postgres" "$*")
+    (cd diesel_bench && cargo test --features "postgres" --benches "$*")
 
-  (cd diesel_migrations && cargo test --features "mysql diesel/mysql" $* -- --test-threads 1)
-  (cd diesel_migrations/migrations_macros && cargo test --features "diesel/mysql mysql" $* -- --test-threads 1)
-  (cd diesel_derives && cargo test --features "diesel/mysql" $* -- --test-threads 1)
-  (cd diesel_cli && cargo test --features "mysql" --no-default-features $* -- --test-threads 1)
-  (cd diesel_tests && cargo test --features "mysql" --no-default-features $* -- --test-threads 1)
-  (cd diesel_dynamic_schema && cargo test --features "mysql diesel/mysql" $* -- --test-threads 1)
-  (cd diesel_bench && cargo test --features "mysql" --benches $* -- --test-threads 1)
+    (cd diesel_migrations && cargo test --features "mysql diesel/mysql" "$*" -- --test-threads 1)
+    (cd diesel_migrations/migrations_macros && cargo test --features "diesel/mysql mysql" "$*" -- --test-threads 1)
+    (cd diesel_derives && cargo test --features "diesel/mysql" "$*" -- --test-threads 1)
+    (cd diesel_cli && cargo test --features "mysql" --no-default-features "$*" -- --test-threads 1)
+    (cd diesel_tests && cargo test --features "mysql" --no-default-features "$*" -- --test-threads 1)
+    (cd diesel_dynamic_schema && cargo test --features "mysql diesel/mysql" "$*" -- --test-threads 1)
+    (cd diesel_bench && cargo test --features "mysql" --benches "$*")
 
-  (cd diesel_compile_tests && cargo test $*)
-  (cd diesel_migrations/migrations_internals && cargo test $*)
-  export BACKEND="mysql sqlite postgres"
-  (cd examples && ./test_all $*)
-fi;
+    (cd diesel_compile_tests && cargo test "$*")
+    (cd diesel_migrations/migrations_internals && cargo test "$*")
+    export BACKEND="mysql sqlite postgres"
+    (cd examples && ./test_all "$*")
+fi
diff --git a/diesel_cli/tests/print_schema.rs b/diesel_cli/tests/print_schema.rs
index 0e26ef47574f..0f34ea388aac 100644
--- a/diesel_cli/tests/print_schema.rs
+++ b/diesel_cli/tests/print_schema.rs
@@ -161,7 +161,7 @@ fn print_schema_with_unmappable_names_and_schema_name() {
 }
 
 #[test]
-fn print_schema_with_seperate_unique_constraint_and_foreign_key() {
+fn print_schema_with_separate_unique_constraint_and_foreign_key() {
     test_print_schema("print_schema_regression_test_for_2623", vec![])
 }
 
diff --git a/diesel_compile_tests/Cargo.lock b/diesel_compile_tests/Cargo.lock
index 502c4cfe96a6..437070da3beb 100644
--- a/diesel_compile_tests/Cargo.lock
+++ b/diesel_compile_tests/Cargo.lock
@@ -25,6 +25,12 @@ version = "1.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
 
+[[package]]
+name = "bumpalo"
+version = "3.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3"
+
 [[package]]
 name = "byteorder"
 version = "1.4.3"
@@ -39,19 +45,20 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
 
 [[package]]
 name = "chrono"
-version = "0.4.19"
+version = "0.4.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
+checksum = "6127248204b9aba09a362f6c930ef6a78f2c1b2215f8a7b398c06e1083f17af0"
 dependencies = [
- "libc",
+ "js-sys",
  "num-integer",
  "num-traits",
+ "wasm-bindgen",
  "winapi",
 ]
 
 [[package]]
 name = "diesel"
-version = "2.0.0-rc.0"
+version = "2.0.0-rc.1"
 dependencies = [
  "bigdecimal",
  "bitflags",
@@ -70,6 +77,7 @@ dependencies = [
  "pq-sys",
  "r2d2",
  "serde_json",
+ "time",
  "url",
  "uuid",
 ]
@@ -84,7 +92,7 @@ dependencies = [
 
 [[package]]
 name = "diesel_derives"
-version = "2.0.0-rc.0"
+version = "2.0.0-rc.1"
 dependencies = [
  "proc-macro-error",
  "proc-macro2",
@@ -149,6 +157,15 @@ version = "1.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
 
+[[package]]
+name = "js-sys"
+version = "0.3.59"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2"
+dependencies = [
+ "wasm-bindgen",
+]
+
 [[package]]
 name = "lazy_static"
 version = "1.4.0"
@@ -235,6 +252,21 @@ dependencies = [
  "autocfg",
 ]
 
+[[package]]
+name = "num_threads"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
+
 [[package]]
 name = "parking_lot"
 version = "0.11.2"
@@ -421,6 +453,24 @@ dependencies = [
  "winapi-util",
 ]
 
+[[package]]
+name = "time"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd"
+dependencies = [
+ "itoa 1.0.1",
+ "libc",
+ "num_threads",
+ "time-macros",
+]
+
+[[package]]
+name = "time-macros"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792"
+
 [[package]]
 name = "tinyvec"
 version = "1.5.1"
@@ -510,6 +560,60 @@ version = "0.9.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
 
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.82"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d"
+dependencies = [
+ "cfg-if",
+ "wasm-bindgen-macro",
+]
+
+[[package]]
+name = "wasm-bindgen-backend"
+version = "0.2.82"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f"
+dependencies = [
+ "bumpalo",
+ "log",
+ "once_cell",
+ "proc-macro2",
+ "quote",
+ "syn",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.82"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.82"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+ "wasm-bindgen-backend",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.82"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a"
+
 [[package]]
 name = "winapi"
 version = "0.3.9"
diff --git a/diesel_compile_tests/Cargo.toml b/diesel_compile_tests/Cargo.toml
index 2faaaf407833..581c8bca9883 100644
--- a/diesel_compile_tests/Cargo.toml
+++ b/diesel_compile_tests/Cargo.toml
@@ -3,7 +3,7 @@ name = "diesel_compile_tests"
 version = "0.1.0"
 
 [dependencies]
-diesel = { version = "2.0.0-rc.1", default-features = false, features = ["extras", "sqlite", "postgres", "mysql", "with-deprecated"], path = "../diesel" }
+diesel = { version = "2.0.0", default-features = false, features = ["extras", "sqlite", "postgres", "mysql", "with-deprecated", "nightly-error-messages"], path = "../diesel" }
 trybuild = "1.0.41"
 
 [workspace]
diff --git a/diesel_compile_tests/rust-toolchain b/diesel_compile_tests/rust-toolchain
new file mode 100644
index 000000000000..1f1f6b18d9a3
--- /dev/null
+++ b/diesel_compile_tests/rust-toolchain
@@ -0,0 +1,1 @@
+nightly-2022-08-12
diff --git a/diesel_compile_tests/tests/fail/aggregate_expression_requires_column_from_same_table.stderr b/diesel_compile_tests/tests/fail/aggregate_expression_requires_column_from_same_table.stderr
index dfa8bdcd30b3..8946b490da91 100644
--- a/diesel_compile_tests/tests/fail/aggregate_expression_requires_column_from_same_table.stderr
+++ b/diesel_compile_tests/tests/fail/aggregate_expression_requires_column_from_same_table.stderr
@@ -1,15 +1,17 @@
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:19:38
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+  --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:19:31
    |
 19 |     let source = users::table.select(sum(posts::id));
-   |                                      ^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+   |                               ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::id` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::id as SelectableExpression<Only<posts::table>>>
              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <posts::columns::id as SelectableExpression<posts::table>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
 
@@ -28,11 +30,11 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 14 | |     }
 15 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
   --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:19:31
@@ -40,6 +42,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
 19 |     let source = users::table.select(sum(posts::id));
    |                               ^^^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
   --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:11:1
@@ -50,24 +59,26 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 14 | |     }
 15 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:20:38
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+  --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:20:31
    |
 20 |     let source = users::table.select(avg(posts::id));
-   |                                      ^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+   |                               ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::id` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::id as SelectableExpression<Only<posts::table>>>
              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <posts::columns::id as SelectableExpression<posts::table>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_folding::avg::avg<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_folding::avg::avg<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
 
@@ -86,11 +97,11 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 14 | |     }
 15 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::functions::aggregate_folding::avg::avg<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_folding::avg::avg<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_folding::avg::avg<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
   --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:20:31
@@ -98,6 +109,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
 20 |     let source = users::table.select(avg(posts::id));
    |                               ^^^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
   --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:11:1
@@ -108,24 +126,26 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 14 | |     }
 15 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::functions::aggregate_folding::avg::avg<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_folding::avg::avg<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_folding::avg::avg<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:21:38
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+  --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:21:31
    |
 21 |     let source = users::table.select(max(posts::id));
-   |                                      ^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+   |                               ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::id` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::id as SelectableExpression<Only<posts::table>>>
              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <posts::columns::id as SelectableExpression<posts::table>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
 
@@ -144,11 +164,11 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 14 | |     }
 15 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
   --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:21:31
@@ -156,6 +176,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
 21 |     let source = users::table.select(max(posts::id));
    |                               ^^^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
   --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:11:1
@@ -166,24 +193,26 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 14 | |     }
 15 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:22:38
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+  --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:22:31
    |
 22 |     let source = users::table.select(min(posts::id));
-   |                                      ^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+   |                               ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::id` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::id as SelectableExpression<Only<posts::table>>>
              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <posts::columns::id as SelectableExpression<posts::table>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
 
@@ -202,11 +231,11 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 14 | |     }
 15 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
   --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:22:31
@@ -214,6 +243,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
 22 |     let source = users::table.select(min(posts::id));
    |                               ^^^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
   --> tests/fail/aggregate_expression_requires_column_from_same_table.rs:11:1
@@ -224,8 +260,8 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 14 | |     }
 15 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Integer, posts::columns::id>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Integer, posts::columns::id>>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.stderr b/diesel_compile_tests/tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.stderr
index 19f3aa1e64fe..4b78d67d19ea 100644
--- a/diesel_compile_tests/tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.stderr
+++ b/diesel_compile_tests/tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.stderr
@@ -7,46 +7,63 @@ warning: use of deprecated function `diesel::dsl::any`: Use `ExpressionMethods::
    = note: `#[warn(deprecated)]` on by default
 
 error[E0271]: type mismatch resolving `<stuff::table as AppearsInFromClause<more_stuff::table>>::Count == diesel::query_source::Once`
-  --> tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.rs:31:10
-   |
-31 |         .load(&mut conn);
-   |          ^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-   |
+    --> tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.rs:31:10
+     |
+31   |         .load(&mut conn);
+     |          ^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+     |
 note: required because of the requirements on the impl of `AppearsOnTable<stuff::table>` for `more_stuff::columns::names`
-  --> tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.rs:13:1
-   |
-13 | / table! {
-14 | |     more_stuff (names) {
-15 | |         names -> Array<VarChar>,
-16 | |     }
-17 | | }
-   | |_^
-   = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<stuff::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>`
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<stuff::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<stuff::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<stuff::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, _>` for `SelectStatement<FromClause<stuff::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<stuff::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+    --> tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.rs:13:1
+     |
+13   | / table! {
+14   | |     more_stuff (names) {
+15   | |         names -> Array<VarChar>,
+16   | |     }
+17   | | }
+     | |_^
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<stuff::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<stuff::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<stuff::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<stuff::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, _>` for `SelectStatement<FromClause<stuff::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<stuff::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `stuff::table: TableNotEqual<more_stuff::table>` is not satisfied
-  --> tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.rs:31:10
-   |
-31 |         .load(&mut conn);
-   |          ^^^^ the trait `TableNotEqual<more_stuff::table>` is not implemented for `stuff::table`
-   |
-   = note: required because of the requirements on the impl of `AppearsInFromClause<more_stuff::table>` for `stuff::table`
+    --> tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.rs:31:10
+     |
+31   |         .load(&mut conn);
+     |          ^^^^ the trait `TableNotEqual<more_stuff::table>` is not implemented for `stuff::table`
+     |
+     = help: the following other types implement trait `TableNotEqual<T>`:
+               <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+               <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+               <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+               <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+               <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+               <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+     = note: required because of the requirements on the impl of `AppearsInFromClause<more_stuff::table>` for `stuff::table`
 note: required because of the requirements on the impl of `AppearsOnTable<stuff::table>` for `more_stuff::columns::names`
-  --> tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.rs:13:1
-   |
-13 | / table! {
-14 | |     more_stuff (names) {
-15 | |         names -> Array<VarChar>,
-16 | |     }
-17 | | }
-   | |_^
-   = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<stuff::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>`
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<stuff::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<stuff::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<stuff::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, _>` for `SelectStatement<FromClause<stuff::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<stuff::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+    --> tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.rs:13:1
+     |
+13   | / table! {
+14   | |     more_stuff (names) {
+15   | |         names -> Array<VarChar>,
+16   | |     }
+17   | | }
+     | |_^
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<stuff::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<stuff::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<stuff::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<stuff::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, _>` for `SelectStatement<FromClause<stuff::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<stuff::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/array_expressions_must_be_correct_type.stderr b/diesel_compile_tests/tests/fail/array_expressions_must_be_correct_type.stderr
index 07be69b27394..8907a7b23d27 100644
--- a/diesel_compile_tests/tests/fail/array_expressions_must_be_correct_type.stderr
+++ b/diesel_compile_tests/tests/fail/array_expressions_must_be_correct_type.stderr
@@ -1,11 +1,22 @@
-error[E0277]: the trait bound `f64: SelectableExpression<NoFromClause>` is not satisfied
+error[E0277]: Cannot select `f64` from `NoFromClause`
    --> tests/fail/array_expressions_must_be_correct_type.rs:9:5
     |
 9   |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
     |     ^^^^^^ the trait `SelectableExpression<NoFromClause>` is not implemented for `f64`
     |
+    = note: `f64` is no valid selection for `NoFromClause`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
+              <&'a T as SelectableExpression<QS>>
+              <(T0, T1) as SelectableExpression<QS>>
+              <(T0, T1, T2) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3, T4) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3, T4, T5) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3, T4, T5, T6) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3, T4, T5, T6, T7) as SelectableExpression<QS>>
+            and 155 others
     = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `(f64, f64)`
-    = note: 1 redundant requirements hidden
+    = note: 1 redundant requirement hidden
     = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>`
     = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<NoFromClause>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>`
     = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
@@ -22,8 +33,18 @@ error[E0277]: the trait bound `f64: ValidGrouping<()>` is not satisfied
 9   |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
     |     ^^^^^^ the trait `ValidGrouping<()>` is not implemented for `f64`
     |
+    = help: the following other types implement trait `ValidGrouping<GroupByClause>`:
+              <&'a T as ValidGrouping<GB>>
+              <(T0, T1) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3, T4) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3, T4, T5) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3, T4, T5, T6) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3, T4, T5, T6, T7) as ValidGrouping<__GroupByClause>>
+            and 140 others
     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(f64, f64)`
-    = note: 1 redundant requirements hidden
+    = note: 1 redundant requirement hidden
     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>`
     = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
     = note: required because of the requirements on the impl of `AsQuery` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
@@ -33,52 +54,113 @@ note: required by a bound in `diesel::select`
     |     crate::dsl::BareSelect<T>: AsQuery,
     |                                ^^^^^^^ required by this bound in `diesel::select`
 
-error[E0277]: the trait bound `f64: SelectableExpression<NoFromClause>` is not satisfied
- --> tests/fail/array_expressions_must_be_correct_type.rs:9:33
-  |
-9 |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
-  |                                 ^^^^^^^^^^ the trait `SelectableExpression<NoFromClause>` is not implemented for `f64`
-  |
-  = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `(f64, f64)`
-  = note: 1 redundant requirements hidden
-  = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>`
-  = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<NoFromClause>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>`
-  = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
-  = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
+error[E0277]: Cannot select `f64` from `NoFromClause`
+    --> tests/fail/array_expressions_must_be_correct_type.rs:9:33
+     |
+9    |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
+     |                                 ^^^^^^^^^^ the trait `SelectableExpression<NoFromClause>` is not implemented for `f64`
+     |
+     = note: `f64` is no valid selection for `NoFromClause`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <&'a T as SelectableExpression<QS>>
+               <(T0, T1) as SelectableExpression<QS>>
+               <(T0, T1, T2) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4, T5) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4, T5, T6) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4, T5, T6, T7) as SelectableExpression<QS>>
+             and 155 others
+     = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `(f64, f64)`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<NoFromClause>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `f64: ValidGrouping<()>` is not satisfied
- --> tests/fail/array_expressions_must_be_correct_type.rs:9:33
-  |
-9 |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
-  |                                 ^^^^^^^^^^ the trait `ValidGrouping<()>` is not implemented for `f64`
-  |
-  = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(f64, f64)`
-  = note: 1 redundant requirements hidden
-  = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>`
-  = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
-  = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
-
-error[E0277]: the trait bound `f64: QueryFragment<Pg>` is not satisfied
- --> tests/fail/array_expressions_must_be_correct_type.rs:9:33
-  |
-9 |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
-  |                                 ^^^^^^^^^^ the trait `QueryFragment<Pg>` is not implemented for `f64`
-  |
-  = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `(f64, f64)`
-  = note: 3 redundant requirements hidden
-  = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
-  = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
+    --> tests/fail/array_expressions_must_be_correct_type.rs:9:33
+     |
+9    |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
+     |                                 ^^^^^^^^^^ the trait `ValidGrouping<()>` is not implemented for `f64`
+     |
+     = help: the following other types implement trait `ValidGrouping<GroupByClause>`:
+               <&'a T as ValidGrouping<GB>>
+               <(T0, T1) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4, T5) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4, T5, T6) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4, T5, T6, T7) as ValidGrouping<__GroupByClause>>
+             and 140 others
+     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(f64, f64)`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `f64: QueryId` is not satisfied
- --> tests/fail/array_expressions_must_be_correct_type.rs:9:33
-  |
-9 |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
-  |                                 ^^^^^^^^^^ the trait `QueryId` is not implemented for `f64`
-  |
-  = note: required because of the requirements on the impl of `QueryId` for `(f64, f64)`
-  = note: 3 redundant requirements hidden
-  = note: required because of the requirements on the impl of `QueryId` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
-  = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
+    --> tests/fail/array_expressions_must_be_correct_type.rs:9:33
+     |
+9    |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
+     |                                 ^^^^^^^^^^ the trait `QueryId` is not implemented for `f64`
+     |
+     = help: the following other types implement trait `QueryId`:
+               &'a T
+               ()
+               (T0, T1)
+               (T0, T1, T2)
+               (T0, T1, T2, T3)
+               (T0, T1, T2, T3, T4)
+               (T0, T1, T2, T3, T4, T5)
+               (T0, T1, T2, T3, T4, T5, T6)
+             and 229 others
+     = note: required because of the requirements on the impl of `QueryId` for `(f64, f64)`
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryId` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
+
+error[E0277]: the trait bound `f64: QueryFragment<Pg>` is not satisfied
+    --> tests/fail/array_expressions_must_be_correct_type.rs:9:33
+     |
+9    |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
+     |                                 ^^^^^^^^^^ the trait `QueryFragment<Pg>` is not implemented for `f64`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <&'a T as QueryFragment<DB>>
+               <() as QueryFragment<DB>>
+               <(T0, T1) as QueryFragment<__DB>>
+               <(T0, T1, T2) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4, T5) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4, T5, T6) as QueryFragment<__DB>>
+             and 268 others
+     = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `(f64, f64)`
+     = note: 4 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(f64, f64), diesel::sql_types::Integer>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `f64: diesel::Expression` is not satisfied
   --> tests/fail/array_expressions_must_be_correct_type.rs:9:12
@@ -86,6 +168,16 @@ error[E0277]: the trait bound `f64: diesel::Expression` is not satisfied
 9  |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
    |            ^^^^^ the trait `diesel::Expression` is not implemented for `f64`
    |
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 120 others
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Integer>` for `f64`
    = note: required because of the requirements on the impl of `AsExpressionList<diesel::sql_types::Integer>` for `(f64, f64)`
 note: required by a bound in `diesel::dsl::array`
@@ -100,4 +192,14 @@ error[E0277]: the trait bound `f64: diesel::Expression` is not satisfied
 9 |     select(array((1f64, 3f64))).get_result::<Vec<i32>>(&mut connection);
   |            ^^^^^^^^^^^^^^^^^^^ the trait `diesel::Expression` is not implemented for `f64`
   |
+  = help: the following other types implement trait `diesel::Expression`:
+            &'a T
+            (T0, T1)
+            (T0, T1, T2)
+            (T0, T1, T2, T3)
+            (T0, T1, T2, T3, T4)
+            (T0, T1, T2, T3, T4, T5)
+            (T0, T1, T2, T3, T4, T5, T6)
+            (T0, T1, T2, T3, T4, T5, T6, T7)
+          and 120 others
   = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Integer>` for `f64`
diff --git a/diesel_compile_tests/tests/fail/array_expressions_must_be_same_type.stderr b/diesel_compile_tests/tests/fail/array_expressions_must_be_same_type.stderr
index bb87fbccf054..24ff445ace8c 100644
--- a/diesel_compile_tests/tests/fail/array_expressions_must_be_same_type.stderr
+++ b/diesel_compile_tests/tests/fail/array_expressions_must_be_same_type.stderr
@@ -1,15 +1,26 @@
-error[E0277]: the trait bound `f64: SelectableExpression<NoFromClause>` is not satisfied
+error[E0277]: Cannot select `f64` from `NoFromClause`
    --> tests/fail/array_expressions_must_be_same_type.rs:11:5
     |
 11  |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
     |     ^^^^^^ the trait `SelectableExpression<NoFromClause>` is not implemented for `f64`
     |
-    = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64)`
-    = note: 1 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>`
-    = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<NoFromClause>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>`
-    = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
-    = note: required because of the requirements on the impl of `AsQuery` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+    = note: `f64` is no valid selection for `NoFromClause`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
+              <&'a T as SelectableExpression<QS>>
+              <(T0, T1) as SelectableExpression<QS>>
+              <(T0, T1, T2) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3, T4) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3, T4, T5) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3, T4, T5, T6) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3, T4, T5, T6, T7) as SelectableExpression<QS>>
+            and 155 others
+    = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64)`
+    = note: 1 redundant requirement hidden
+    = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>`
+    = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<NoFromClause>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>`
+    = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+    = note: required because of the requirements on the impl of `AsQuery` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
 note: required by a bound in `diesel::select`
    --> $DIESEL/src/query_builder/functions.rs
     |
@@ -22,63 +33,134 @@ error[E0277]: the trait bound `f64: ValidGrouping<()>` is not satisfied
 11  |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
     |     ^^^^^^ the trait `ValidGrouping<()>` is not implemented for `f64`
     |
+    = help: the following other types implement trait `ValidGrouping<GroupByClause>`:
+              <&'a T as ValidGrouping<GB>>
+              <(T0, T1) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3, T4) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3, T4, T5) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3, T4, T5, T6) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3, T4, T5, T6, T7) as ValidGrouping<__GroupByClause>>
+            and 140 others
     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(f64,)`
     = note: 2 redundant requirements hidden
-    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>`
-    = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
-    = note: required because of the requirements on the impl of `AsQuery` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>`
+    = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+    = note: required because of the requirements on the impl of `AsQuery` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
 note: required by a bound in `diesel::select`
    --> $DIESEL/src/query_builder/functions.rs
     |
     |     crate::dsl::BareSelect<T>: AsQuery,
     |                                ^^^^^^^ required by this bound in `diesel::select`
 
-error[E0277]: the trait bound `f64: SelectableExpression<NoFromClause>` is not satisfied
-  --> tests/fail/array_expressions_must_be_same_type.rs:11:30
-   |
-11 |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
-   |                              ^^^^^^^^^^ the trait `SelectableExpression<NoFromClause>` is not implemented for `f64`
-   |
-   = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64)`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>`
-   = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<NoFromClause>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+error[E0277]: Cannot select `f64` from `NoFromClause`
+    --> tests/fail/array_expressions_must_be_same_type.rs:11:30
+     |
+11   |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
+     |                              ^^^^^^^^^^ the trait `SelectableExpression<NoFromClause>` is not implemented for `f64`
+     |
+     = note: `f64` is no valid selection for `NoFromClause`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <&'a T as SelectableExpression<QS>>
+               <(T0, T1) as SelectableExpression<QS>>
+               <(T0, T1, T2) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4, T5) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4, T5, T6) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4, T5, T6, T7) as SelectableExpression<QS>>
+             and 155 others
+     = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64)`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<NoFromClause>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `f64: ValidGrouping<()>` is not satisfied
-  --> tests/fail/array_expressions_must_be_same_type.rs:11:30
-   |
-11 |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
-   |                              ^^^^^^^^^^ the trait `ValidGrouping<()>` is not implemented for `f64`
-   |
-   = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(f64,)`
-   = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
-
-error[E0277]: the trait bound `f64: QueryFragment<Pg>` is not satisfied
-  --> tests/fail/array_expressions_must_be_same_type.rs:11:30
-   |
-11 |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
-   |                              ^^^^^^^^^^ the trait `QueryFragment<Pg>` is not implemented for `f64`
-   |
-   = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64)`
-   = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+    --> tests/fail/array_expressions_must_be_same_type.rs:11:30
+     |
+11   |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
+     |                              ^^^^^^^^^^ the trait `ValidGrouping<()>` is not implemented for `f64`
+     |
+     = help: the following other types implement trait `ValidGrouping<GroupByClause>`:
+               <&'a T as ValidGrouping<GB>>
+               <(T0, T1) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4, T5) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4, T5, T6) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4, T5, T6, T7) as ValidGrouping<__GroupByClause>>
+             and 140 others
+     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(f64,)`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `f64: QueryId` is not satisfied
-  --> tests/fail/array_expressions_must_be_same_type.rs:11:30
-   |
-11 |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
-   |                              ^^^^^^^^^^ the trait `QueryId` is not implemented for `f64`
-   |
-   = note: required because of the requirements on the impl of `QueryId` for `(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64)`
-   = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryId` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+    --> tests/fail/array_expressions_must_be_same_type.rs:11:30
+     |
+11   |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
+     |                              ^^^^^^^^^^ the trait `QueryId` is not implemented for `f64`
+     |
+     = help: the following other types implement trait `QueryId`:
+               &'a T
+               ()
+               (T0, T1)
+               (T0, T1, T2)
+               (T0, T1, T2, T3)
+               (T0, T1, T2, T3, T4)
+               (T0, T1, T2, T3, T4, T5)
+               (T0, T1, T2, T3, T4, T5, T6)
+             and 229 others
+     = note: required because of the requirements on the impl of `QueryId` for `(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64)`
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryId` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
+
+error[E0277]: the trait bound `f64: QueryFragment<Pg>` is not satisfied
+    --> tests/fail/array_expressions_must_be_same_type.rs:11:30
+     |
+11   |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
+     |                              ^^^^^^^^^^ the trait `QueryFragment<Pg>` is not implemented for `f64`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <&'a T as QueryFragment<DB>>
+               <() as QueryFragment<DB>>
+               <(T0, T1) as QueryFragment<__DB>>
+               <(T0, T1, T2) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4, T5) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4, T5, T6) as QueryFragment<__DB>>
+             and 268 others
+     = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64)`
+     = note: 4 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `f64: diesel::Expression` is not satisfied
   --> tests/fail/array_expressions_must_be_same_type.rs:11:12
@@ -86,6 +168,16 @@ error[E0277]: the trait bound `f64: diesel::Expression` is not satisfied
 11 |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
    |            ^^^^^ the trait `diesel::Expression` is not implemented for `f64`
    |
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 120 others
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Integer>` for `f64`
    = note: required because of the requirements on the impl of `AsExpressionList<diesel::sql_types::Integer>` for `(i32, f64)`
 note: required by a bound in `diesel::dsl::array`
@@ -94,24 +186,29 @@ note: required by a bound in `diesel::dsl::array`
    |     T: AsExpressionList<ST>,
    |        ^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::dsl::array`
 
-error[E0277]: the trait bound `{integer}: SelectableExpression<NoFromClause>` is not satisfied
+error[E0277]: Cannot select `{integer}` from `NoFromClause`
    --> tests/fail/array_expressions_must_be_same_type.rs:12:5
     |
 12  |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
     |     ^^^^^^ the trait `SelectableExpression<NoFromClause>` is not implemented for `{integer}`
     |
-    = help: the following implementations were found:
+    = note: `{integer}` is no valid selection for `NoFromClause`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
               <&'a T as SelectableExpression<QS>>
               <(T0, T1) as SelectableExpression<QS>>
               <(T0, T1, T2) as SelectableExpression<QS>>
               <(T0, T1, T2, T3) as SelectableExpression<QS>>
-            and 158 others
-    = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>)`
-    = note: 1 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>`
-    = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<NoFromClause>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>`
-    = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
-    = note: required because of the requirements on the impl of `AsQuery` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+              <(T0, T1, T2, T3, T4) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3, T4, T5) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3, T4, T5, T6) as SelectableExpression<QS>>
+              <(T0, T1, T2, T3, T4, T5, T6, T7) as SelectableExpression<QS>>
+            and 155 others
+    = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
+    = note: 1 redundant requirement hidden
+    = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>`
+    = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<NoFromClause>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>`
+    = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+    = note: required because of the requirements on the impl of `AsQuery` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
 note: required by a bound in `diesel::select`
    --> $DIESEL/src/query_builder/functions.rs
     |
@@ -124,93 +221,134 @@ error[E0277]: the trait bound `{integer}: ValidGrouping<()>` is not satisfied
 12  |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
     |     ^^^^^^ the trait `ValidGrouping<()>` is not implemented for `{integer}`
     |
-    = help: the following implementations were found:
+    = help: the following other types implement trait `ValidGrouping<GroupByClause>`:
               <&'a T as ValidGrouping<GB>>
               <(T0, T1) as ValidGrouping<__GroupByClause>>
               <(T0, T1, T2) as ValidGrouping<__GroupByClause>>
               <(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
-            and 143 others
-    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>)`
-    = note: 1 redundant requirements hidden
-    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>`
-    = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
-    = note: required because of the requirements on the impl of `AsQuery` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+              <(T0, T1, T2, T3, T4) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3, T4, T5) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3, T4, T5, T6) as ValidGrouping<__GroupByClause>>
+              <(T0, T1, T2, T3, T4, T5, T6, T7) as ValidGrouping<__GroupByClause>>
+            and 140 others
+    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
+    = note: 1 redundant requirement hidden
+    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>`
+    = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+    = note: required because of the requirements on the impl of `AsQuery` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
 note: required by a bound in `diesel::select`
    --> $DIESEL/src/query_builder/functions.rs
     |
     |     crate::dsl::BareSelect<T>: AsQuery,
     |                                ^^^^^^^ required by this bound in `diesel::select`
 
-error[E0277]: the trait bound `{integer}: SelectableExpression<NoFromClause>` is not satisfied
-  --> tests/fail/array_expressions_must_be_same_type.rs:12:30
-   |
-12 |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
-   |                              ^^^^^^^^^^ the trait `SelectableExpression<NoFromClause>` is not implemented for `{integer}`
-   |
-   = help: the following implementations were found:
-             <&'a T as SelectableExpression<QS>>
-             <(T0, T1) as SelectableExpression<QS>>
-             <(T0, T1, T2) as SelectableExpression<QS>>
-             <(T0, T1, T2, T3) as SelectableExpression<QS>>
-           and 158 others
-   = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>)`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>`
-   = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<NoFromClause>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<f64>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+error[E0277]: Cannot select `{integer}` from `NoFromClause`
+    --> tests/fail/array_expressions_must_be_same_type.rs:12:30
+     |
+12   |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
+     |                              ^^^^^^^^^^ the trait `SelectableExpression<NoFromClause>` is not implemented for `{integer}`
+     |
+     = note: `{integer}` is no valid selection for `NoFromClause`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <&'a T as SelectableExpression<QS>>
+               <(T0, T1) as SelectableExpression<QS>>
+               <(T0, T1, T2) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4, T5) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4, T5, T6) as SelectableExpression<QS>>
+               <(T0, T1, T2, T3, T4, T5, T6, T7) as SelectableExpression<QS>>
+             and 155 others
+     = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<NoFromClause>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<f64>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `{integer}: ValidGrouping<()>` is not satisfied
-  --> tests/fail/array_expressions_must_be_same_type.rs:12:30
-   |
-12 |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
-   |                              ^^^^^^^^^^ the trait `ValidGrouping<()>` is not implemented for `{integer}`
-   |
-   = help: the following implementations were found:
-             <&'a T as ValidGrouping<GB>>
-             <(T0, T1) as ValidGrouping<__GroupByClause>>
-             <(T0, T1, T2) as ValidGrouping<__GroupByClause>>
-             <(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
-           and 143 others
-   = note: required because of the requirements on the impl of `ValidGrouping<()>` for `({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>)`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<f64>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
-
-error[E0277]: the trait bound `{integer}: QueryFragment<Pg>` is not satisfied
-  --> tests/fail/array_expressions_must_be_same_type.rs:12:30
-   |
-12 |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
-   |                              ^^^^^^^^^^ the trait `QueryFragment<Pg>` is not implemented for `{integer}`
-   |
-   = help: the following implementations were found:
-             <&'a T as QueryFragment<DB>>
-             <() as QueryFragment<DB>>
-             <(T0, T1) as QueryFragment<__DB>>
-             <(T0, T1, T2) as QueryFragment<__DB>>
-           and 273 others
-   = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>)`
-   = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<f64>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+    --> tests/fail/array_expressions_must_be_same_type.rs:12:30
+     |
+12   |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
+     |                              ^^^^^^^^^^ the trait `ValidGrouping<()>` is not implemented for `{integer}`
+     |
+     = help: the following other types implement trait `ValidGrouping<GroupByClause>`:
+               <&'a T as ValidGrouping<GB>>
+               <(T0, T1) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4, T5) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4, T5, T6) as ValidGrouping<__GroupByClause>>
+               <(T0, T1, T2, T3, T4, T5, T6, T7) as ValidGrouping<__GroupByClause>>
+             and 140 others
+     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<f64>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `{integer}: QueryId` is not satisfied
-  --> tests/fail/array_expressions_must_be_same_type.rs:12:30
-   |
-12 |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
-   |                              ^^^^^^^^^^ the trait `QueryId` is not implemented for `{integer}`
-   |
-   = help: the following implementations were found:
-             <&'a T as QueryId>
-             <() as QueryId>
-             <(T0, T1) as QueryId>
-             <(T0, T1, T2) as QueryId>
-           and 234 others
-   = note: required because of the requirements on the impl of `QueryId` for `({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>)`
-   = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryId` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<f64>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+    --> tests/fail/array_expressions_must_be_same_type.rs:12:30
+     |
+12   |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
+     |                              ^^^^^^^^^^ the trait `QueryId` is not implemented for `{integer}`
+     |
+     = help: the following other types implement trait `QueryId`:
+               &'a T
+               ()
+               (T0, T1)
+               (T0, T1, T2)
+               (T0, T1, T2, T3)
+               (T0, T1, T2, T3, T4)
+               (T0, T1, T2, T3, T4, T5)
+               (T0, T1, T2, T3, T4, T5, T6)
+             and 229 others
+     = note: required because of the requirements on the impl of `QueryId` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryId` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<f64>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
+
+error[E0277]: the trait bound `{integer}: QueryFragment<Pg>` is not satisfied
+    --> tests/fail/array_expressions_must_be_same_type.rs:12:30
+     |
+12   |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
+     |                              ^^^^^^^^^^ the trait `QueryFragment<Pg>` is not implemented for `{integer}`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <&'a T as QueryFragment<DB>>
+               <() as QueryFragment<DB>>
+               <(T0, T1) as QueryFragment<__DB>>
+               <(T0, T1, T2) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4, T5) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4, T5, T6) as QueryFragment<__DB>>
+             and 268 others
+     = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
+     = note: 4 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<f64>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `{integer}: diesel::Expression` is not satisfied
   --> tests/fail/array_expressions_must_be_same_type.rs:12:12
@@ -218,12 +356,16 @@ error[E0277]: the trait bound `{integer}: diesel::Expression` is not satisfied
 12 |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
    |            ^^^^^ the trait `diesel::Expression` is not implemented for `{integer}`
    |
-   = help: the following implementations were found:
-             <&'a T as diesel::Expression>
-             <(T0, T1) as diesel::Expression>
-             <(T0, T1, T2) as diesel::Expression>
-             <(T0, T1, T2, T3) as diesel::Expression>
-           and 123 others
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 120 others
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Double>` for `{integer}`
    = note: required because of the requirements on the impl of `AsExpressionList<diesel::sql_types::Double>` for `({integer}, f64)`
 note: required by a bound in `diesel::dsl::array`
@@ -238,6 +380,16 @@ error[E0277]: the trait bound `f64: diesel::Expression` is not satisfied
 11 |     select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
    |            ^^^^^^^^^^^^^^^^ the trait `diesel::Expression` is not implemented for `f64`
    |
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 120 others
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Integer>` for `f64`
 
 error[E0277]: the trait bound `{integer}: diesel::Expression` is not satisfied
@@ -246,10 +398,14 @@ error[E0277]: the trait bound `{integer}: diesel::Expression` is not satisfied
 12 |     select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
    |            ^^^^^^^^^^^^^^^^ the trait `diesel::Expression` is not implemented for `{integer}`
    |
-   = help: the following implementations were found:
-             <&'a T as diesel::Expression>
-             <(T0, T1) as diesel::Expression>
-             <(T0, T1, T2) as diesel::Expression>
-             <(T0, T1, T2, T3) as diesel::Expression>
-           and 123 others
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 120 others
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Double>` for `{integer}`
diff --git a/diesel_compile_tests/tests/fail/array_only_usable_with_pg.stderr b/diesel_compile_tests/tests/fail/array_only_usable_with_pg.stderr
index e0029ce6058e..aafe0573f519 100644
--- a/diesel_compile_tests/tests/fail/array_only_usable_with_pg.stderr
+++ b/diesel_compile_tests/tests/fail/array_only_usable_with_pg.stderr
@@ -1,15 +1,25 @@
 error[E0271]: type mismatch resolving `<diesel::SqliteConnection as diesel::Connection>::Backend == Pg`
- --> tests/fail/array_only_usable_with_pg.rs:8:25
-  |
-8 |     select(array((1,))).get_result::<Vec<i32>>(&mut connection);
-  |                         ^^^^^^^^^^ expected struct `Sqlite`, found struct `Pg`
-  |
-  = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>,), diesel::sql_types::Integer>>>`
+    --> tests/fail/array_only_usable_with_pg.rs:8:25
+     |
+8    |     select(array((1,))).get_result::<Vec<i32>>(&mut connection);
+     |                         ^^^^^^^^^^ expected struct `Pg`, found struct `Sqlite`
+     |
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>,), diesel::sql_types::Integer>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0271]: type mismatch resolving `<diesel::MysqlConnection as diesel::Connection>::Backend == Pg`
-  --> tests/fail/array_only_usable_with_pg.rs:11:25
-   |
-11 |     select(array((1,))).get_result::<Vec<i32>>(&mut connection);
-   |                         ^^^^^^^^^^ expected struct `Mysql`, found struct `Pg`
-   |
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>,), diesel::sql_types::Integer>>>`
+    --> tests/fail/array_only_usable_with_pg.rs:11:25
+     |
+11   |     select(array((1,))).get_result::<Vec<i32>>(&mut connection);
+     |                         ^^^^^^^^^^ expected struct `Pg`, found struct `Mysql`
+     |
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, Vec<i32>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>,), diesel::sql_types::Integer>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
diff --git a/diesel_compile_tests/tests/fail/boxed_queries_and_group_by.stderr b/diesel_compile_tests/tests/fail/boxed_queries_and_group_by.stderr
index a4f9483ecb75..e1a0f897e8b5 100644
--- a/diesel_compile_tests/tests/fail/boxed_queries_and_group_by.stderr
+++ b/diesel_compile_tests/tests/fail/boxed_queries_and_group_by.stderr
@@ -4,9 +4,9 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 55 |     users::table.group_by(users::name).into_boxed();
    |                                        ^^^^^^^^^^ the trait `BoxedDsl<'_, _>` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<users::columns::name>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H> as BoxedDsl<'a, DB>>
-             <SelectStatement<NoFromClause, S, D, W, O, LOf, G, H> as BoxedDsl<'a, DB>>
+   = help: the following other types implement trait `BoxedDsl<'a, DB>`:
+             SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H>
+             SelectStatement<NoFromClause, S, D, W, O, LOf, G, H>
 
 error[E0271]: type mismatch resolving `<users::columns::name as IsContainedInGroupBy<users::columns::id>>::Output == diesel::expression::is_contained_in_group_by::Yes`
   --> tests/fail/boxed_queries_and_group_by.rs:59:10
@@ -14,8 +14,18 @@ error[E0271]: type mismatch resolving `<users::columns::name as IsContainedInGro
 59 |         .select(users::id)
    |          ^^^^^^ expected struct `diesel::expression::is_contained_in_group_by::No`, found struct `diesel::expression::is_contained_in_group_by::Yes`
    |
-   = note: required because of the requirements on the impl of `ValidGrouping<users::columns::name>` for `users::columns::id`
+note: required because of the requirements on the impl of `ValidGrouping<users::columns::name>` for `users::columns::id`
+  --> tests/fail/boxed_queries_and_group_by.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> Text,
+9  | |     }
+10 | | }
+   | |_^
    = note: required because of the requirements on the impl of `SelectDsl<users::columns::id>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<users::columns::name>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<users::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<users::columns::name>>: BoxedDsl<'_, _>` is not satisfied
   --> tests/fail/boxed_queries_and_group_by.rs:60:10
@@ -23,9 +33,9 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 60 |         .into_boxed();
    |          ^^^^^^^^^^ the trait `BoxedDsl<'_, _>` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<users::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<users::columns::name>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H> as BoxedDsl<'a, DB>>
-             <SelectStatement<NoFromClause, S, D, W, O, LOf, G, H> as BoxedDsl<'a, DB>>
+   = help: the following other types implement trait `BoxedDsl<'a, DB>`:
+             SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H>
+             SelectStatement<NoFromClause, S, D, W, O, LOf, G, H>
 
 error[E0271]: type mismatch resolving `<users::columns::name as IsContainedInGroupBy<users::columns::id>>::Output == diesel::expression::is_contained_in_group_by::Yes`
   --> tests/fail/boxed_queries_and_group_by.rs:66:10
@@ -33,8 +43,18 @@ error[E0271]: type mismatch resolving `<users::columns::name as IsContainedInGro
 66 |         .select(users::id)
    |          ^^^^^^ expected struct `diesel::expression::is_contained_in_group_by::No`, found struct `diesel::expression::is_contained_in_group_by::Yes`
    |
-   = note: required because of the requirements on the impl of `ValidGrouping<users::columns::name>` for `users::columns::id`
+note: required because of the requirements on the impl of `ValidGrouping<users::columns::name>` for `users::columns::id`
+  --> tests/fail/boxed_queries_and_group_by.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> Text,
+9  | |     }
+10 | | }
+   | |_^
    = note: required because of the requirements on the impl of `SelectDsl<users::columns::id>` for `BoxedSelectStatement<'_, diesel::sql_types::Text, FromClause<users::table>, _, users::columns::name>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `BoxedSelectStatement<'_, diesel::sql_types::Text, FromClause<users::table>, _, users::columns::name>: Table` is not satisfied
   --> tests/fail/boxed_queries_and_group_by.rs:73:10
@@ -42,21 +62,37 @@ error[E0277]: the trait bound `BoxedSelectStatement<'_, diesel::sql_types::Text,
 73 |         .inner_join(posts::table)
    |          ^^^^^^^^^^ the trait `Table` is not implemented for `BoxedSelectStatement<'_, diesel::sql_types::Text, FromClause<users::table>, _, users::columns::name>`
    |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             posts::table
+             users::table
    = note: required because of the requirements on the impl of `JoinTo<query_source::joins::OnClauseWrapper<_, _>>` for `BoxedSelectStatement<'_, diesel::sql_types::Text, FromClause<users::table>, _, users::columns::name>`
    = note: required because of the requirements on the impl of `JoinWithImplicitOnClause<query_source::joins::OnClauseWrapper<_, _>, Inner>` for `BoxedSelectStatement<'_, diesel::sql_types::Text, FromClause<users::table>, _, users::columns::name>`
 
 error[E0308]: mismatched types
-  --> tests/fail/boxed_queries_and_group_by.rs:73:21
-   |
-73 |         .inner_join(posts::table)
-   |                     ^^^^^^^^^^^^ expected struct `query_source::joins::OnClauseWrapper`, found struct `posts::table`
-   |
-   = note: expected struct `query_source::joins::OnClauseWrapper<_, _>`
-              found struct `posts::table`
+   --> tests/fail/boxed_queries_and_group_by.rs:73:21
+    |
+73  |         .inner_join(posts::table)
+    |          ---------- ^^^^^^^^^^^^ expected struct `query_source::joins::OnClauseWrapper`, found struct `posts::table`
+    |          |
+    |          arguments to this function are incorrect
+    |
+    = note: expected struct `query_source::joins::OnClauseWrapper<_, _>`
+               found struct `posts::table`
+note: associated function defined here
+   --> $DIESEL/src/query_dsl/mod.rs
+    |
+    |     fn inner_join<Rhs>(self, rhs: Rhs) -> InnerJoin<Self, Rhs>
+    |        ^^^^^^^^^^
 
 error[E0308]: mismatched types
   --> tests/fail/boxed_queries_and_group_by.rs:79:9
    |
+76 |     let mut a = users::table.into_boxed();
+   |                 ------------------------- expected due to this value
+...
 79 |     a = users::table.group_by(users::id).into_boxed();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `users::columns::id`
    |
@@ -79,6 +115,12 @@ error[E0277]: the trait bound `BoxedSelectStatement<'_, (diesel::sql_types::Inte
 84 |         .group_by(users::id)
    |          ^^^^^^^^ the trait `Table` is not implemented for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, _>`
    |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             posts::table
+             users::table
    = note: required because of the requirements on the impl of `GroupByDsl<_>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, _>`
 
 error[E0277]: the trait bound `SelectStatement<FromClause<BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, _>>>: GroupByDsl<_>` is not satisfied
@@ -87,5 +129,4 @@ error[E0277]: the trait bound `SelectStatement<FromClause<BoxedSelectStatement<'
 84 |         .group_by(users::id)
    |          ^^^^^^^^ the trait `GroupByDsl<_>` is not implemented for `SelectStatement<FromClause<BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, _>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<F, S, D, W, O, LOf, G, H> as GroupByDsl<Expr>>
+   = help: the trait `GroupByDsl<Expr>` is implemented for `SelectStatement<F, S, D, W, O, LOf, G, H>`
diff --git a/diesel_compile_tests/tests/fail/boxed_queries_must_be_used_with_proper_connection.stderr b/diesel_compile_tests/tests/fail/boxed_queries_must_be_used_with_proper_connection.stderr
index 02c419ef4bf8..d8d0fef6b2a1 100644
--- a/diesel_compile_tests/tests/fail/boxed_queries_must_be_used_with_proper_connection.stderr
+++ b/diesel_compile_tests/tests/fail/boxed_queries_must_be_used_with_proper_connection.stderr
@@ -1,7 +1,12 @@
 error[E0271]: type mismatch resolving `<diesel::SqliteConnection as diesel::Connection>::Backend == Pg`
-  --> $DIR/boxed_queries_must_be_used_with_proper_connection.rs:14:37
-   |
-14 |     users::table.into_boxed::<Pg>().load::<(i32,)>(&mut connection);
-   |                                     ^^^^ expected struct `Sqlite`, found struct `Pg`
-   |
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, (i32,)>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer,), FromClause<users::table>, Pg>`
+    --> tests/fail/boxed_queries_must_be_used_with_proper_connection.rs:14:37
+     |
+14   |     users::table.into_boxed::<Pg>().load::<(i32,)>(&mut connection);
+     |                                     ^^^^ expected struct `Pg`, found struct `Sqlite`
+     |
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, (i32,)>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer,), FromClause<users::table>, Pg>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
diff --git a/diesel_compile_tests/tests/fail/boxed_queries_require_selectable_expression_for_filter.stderr b/diesel_compile_tests/tests/fail/boxed_queries_require_selectable_expression_for_filter.stderr
index 2a3a608fe729..91495d7a0ba3 100644
--- a/diesel_compile_tests/tests/fail/boxed_queries_require_selectable_expression_for_filter.stderr
+++ b/diesel_compile_tests/tests/fail/boxed_queries_require_selectable_expression_for_filter.stderr
@@ -15,9 +15,9 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 18 | | }
    | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>`
-   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, Pg>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>`
+   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, Pg>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
   --> tests/fail/boxed_queries_require_selectable_expression_for_filter.rs:21:37
@@ -25,6 +25,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
 21 |     users::table.into_boxed::<Pg>().filter(posts::title.eq("Hello"));
    |                                     ^^^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::title`
   --> tests/fail/boxed_queries_require_selectable_expression_for_filter.rs:13:1
@@ -37,6 +44,6 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 18 | | }
    | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>`
-   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, Pg>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>`
+   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, Pg>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/boxed_queries_require_selectable_expression_for_order.stderr b/diesel_compile_tests/tests/fail/boxed_queries_require_selectable_expression_for_order.stderr
index 0a260f68dfb9..a6f50f5bdce1 100644
--- a/diesel_compile_tests/tests/fail/boxed_queries_require_selectable_expression_for_order.stderr
+++ b/diesel_compile_tests/tests/fail/boxed_queries_require_selectable_expression_for_order.stderr
@@ -4,8 +4,7 @@ error[E0277]: the trait bound `FromClause<users::table>: AppearsInFromClause<pos
 21 |     users::table.into_boxed::<Pg>().order(posts::title.desc());
    |                                     ^^^^^ the trait `AppearsInFromClause<posts::table>` is not implemented for `FromClause<users::table>`
    |
-   = help: the following implementations were found:
-             <FromClause<QS2> as AppearsInFromClause<QS1>>
+   = help: the trait `AppearsInFromClause<QS1>` is implemented for `FromClause<QS2>`
 note: required because of the requirements on the impl of `AppearsOnTable<FromClause<users::table>>` for `posts::columns::title`
   --> tests/fail/boxed_queries_require_selectable_expression_for_order.rs:13:1
    |
@@ -16,7 +15,7 @@ note: required because of the requirements on the impl of `AppearsOnTable<FromCl
 17 | |     }
 18 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<FromClause<users::table>>` for `diesel::expression::operators::Desc<posts::columns::title>`
    = note: required because of the requirements on the impl of `OrderDsl<diesel::expression::operators::Desc<posts::columns::title>>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, Pg>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/cannot_join_to_non_joinable_table.stderr b/diesel_compile_tests/tests/fail/cannot_join_to_non_joinable_table.stderr
index 0ea87a8a4a8b..999a91f2269f 100644
--- a/diesel_compile_tests/tests/fail/cannot_join_to_non_joinable_table.stderr
+++ b/diesel_compile_tests/tests/fail/cannot_join_to_non_joinable_table.stderr
@@ -4,12 +4,13 @@ error[E0277]: the trait bound `users::table: JoinTo<posts::table>` is not satisf
 30 |     let _ = users::table.inner_join(posts::table);
    |                          ^^^^^^^^^^ the trait `JoinTo<posts::table>` is not implemented for `users::table`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `JoinTo<T>`:
              <users::table as JoinTo<Alias<S>>>
              <users::table as JoinTo<BoxedSelectStatement<'a, FromClause<QS>, ST, DB>>>
              <users::table as JoinTo<JoinOn<Join, On>>>
              <users::table as JoinTo<Only<S>>>
-           and 2 others
+             <users::table as JoinTo<SelectStatement<FromClause<F>, S, D, W, O, L, Of, G>>>
+             <users::table as JoinTo<query_source::joins::Join<Left, Right, Kind>>>
    = note: required because of the requirements on the impl of `JoinWithImplicitOnClause<posts::table, Inner>` for `users::table`
 
 error[E0277]: the trait bound `users::table: JoinTo<posts::table>` is not satisfied
@@ -18,25 +19,28 @@ error[E0277]: the trait bound `users::table: JoinTo<posts::table>` is not satisf
 31 |     let _ = users::table.left_outer_join(posts::table);
    |                          ^^^^^^^^^^^^^^^ the trait `JoinTo<posts::table>` is not implemented for `users::table`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `JoinTo<T>`:
              <users::table as JoinTo<Alias<S>>>
              <users::table as JoinTo<BoxedSelectStatement<'a, FromClause<QS>, ST, DB>>>
              <users::table as JoinTo<JoinOn<Join, On>>>
              <users::table as JoinTo<Only<S>>>
-           and 2 others
+             <users::table as JoinTo<SelectStatement<FromClause<F>, S, D, W, O, L, Of, G>>>
+             <users::table as JoinTo<query_source::joins::Join<Left, Right, Kind>>>
    = note: required because of the requirements on the impl of `JoinWithImplicitOnClause<posts::table, LeftOuter>` for `users::table`
 
 error[E0277]: the trait bound `posts::table: JoinTo<users::table>` is not satisfied
-  --> tests/fail/cannot_join_to_non_joinable_table.rs:36:37
+  --> tests/fail/cannot_join_to_non_joinable_table.rs:36:26
    |
 36 |     let _ = users::table.inner_join(join);
-   |                                     ^^^^ the trait `JoinTo<users::table>` is not implemented for `posts::table`
+   |                          ^^^^^^^^^^ the trait `JoinTo<users::table>` is not implemented for `posts::table`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `JoinTo<T>`:
              <posts::table as JoinTo<Alias<S>>>
              <posts::table as JoinTo<BoxedSelectStatement<'a, FromClause<QS>, ST, DB>>>
              <posts::table as JoinTo<JoinOn<Join, On>>>
              <posts::table as JoinTo<Only<S>>>
-           and 3 others
-   = note: required because of the requirements on the impl of `JoinTo<users::table>` for `diesel::internal::table_macro::Join<posts::table, comments::table, Inner>`
-   = note: required because of the requirements on the impl of `JoinWithImplicitOnClause<SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>` for `users::table`
+             <posts::table as JoinTo<SelectStatement<FromClause<F>, S, D, W, O, L, Of, G>>>
+             <posts::table as JoinTo<comments::table>>
+             <posts::table as JoinTo<query_source::joins::Join<Left, Right, Kind>>>
+   = note: required because of the requirements on the impl of `JoinTo<users::table>` for `query_source::joins::Join<posts::table, comments::table, Inner>`
+   = note: required because of the requirements on the impl of `JoinWithImplicitOnClause<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>` for `users::table`
diff --git a/diesel_compile_tests/tests/fail/cannot_load_default_select_with_group_by.stderr b/diesel_compile_tests/tests/fail/cannot_load_default_select_with_group_by.stderr
index ad586e55b22b..0448ae4e0323 100644
--- a/diesel_compile_tests/tests/fail/cannot_load_default_select_with_group_by.stderr
+++ b/diesel_compile_tests/tests/fail/cannot_load_default_select_with_group_by.stderr
@@ -1,11 +1,26 @@
 error[E0271]: type mismatch resolving `<columns::name as IsContainedInGroupBy<columns::id>>::Output == diesel::expression::is_contained_in_group_by::Yes`
-  --> tests/fail/cannot_load_default_select_with_group_by.rs:16:10
-   |
-16 |         .load::<(i32, String)>(&mut conn);
-   |          ^^^^ expected struct `diesel::expression::is_contained_in_group_by::No`, found struct `diesel::expression::is_contained_in_group_by::Yes`
-   |
-   = note: required because of the requirements on the impl of `ValidGrouping<columns::name>` for `columns::id`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `ValidGrouping<columns::name>` for `(columns::id, columns::name)`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::name>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::name>>`
+    --> tests/fail/cannot_load_default_select_with_group_by.rs:16:10
+     |
+16   |         .load::<(i32, String)>(&mut conn);
+     |          ^^^^ expected struct `diesel::expression::is_contained_in_group_by::Yes`, found struct `diesel::expression::is_contained_in_group_by::No`
+     |
+note: required because of the requirements on the impl of `ValidGrouping<columns::name>` for `columns::id`
+    --> tests/fail/cannot_load_default_select_with_group_by.rs:5:1
+     |
+5    | / table! {
+6    | |     users {
+7    | |         id -> Integer,
+8    | |         name -> Text,
+9    | |     }
+10   | | }
+     | |_^
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `ValidGrouping<columns::name>` for `(columns::id, columns::name)`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::name>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::name>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/cannot_mix_aggregate_and_non_aggregate_selects.stderr b/diesel_compile_tests/tests/fail/cannot_mix_aggregate_and_non_aggregate_selects.stderr
index cccc72b55769..a2f0bc02e9c5 100644
--- a/diesel_compile_tests/tests/fail/cannot_mix_aggregate_and_non_aggregate_selects.stderr
+++ b/diesel_compile_tests/tests/fail/cannot_mix_aggregate_and_non_aggregate_selects.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `diesel::expression::is_aggregate::No: MixedAggreg
 20 |     let source = users.select((id, count_star()));
    |                        ^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::Yes>` is not implemented for `diesel::expression::is_aggregate::No`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `MixedAggregates<Other>`:
              <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::Never>>
              <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::No>>
    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(columns::id, CountStar)`
@@ -16,11 +16,11 @@ error[E0277]: the trait bound `diesel::expression::is_aggregate::No: MixedAggreg
 22 |     let source = users.select(nullable_int_col + max(nullable_int_col));
    |                        ^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::Yes>` is not implemented for `diesel::expression::is_aggregate::No`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `MixedAggregates<Other>`:
              <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::Never>>
              <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::No>>
-   = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::internal::derives::numeric_ops::Add<columns::nullable_int_col, diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Nullable<diesel::sql_types::Integer>, columns::nullable_int_col>>`
-   = note: required because of the requirements on the impl of `SelectDsl<diesel::internal::derives::numeric_ops::Add<columns::nullable_int_col, diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Nullable<diesel::sql_types::Integer>, columns::nullable_int_col>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::expression::ops::numeric::Add<columns::nullable_int_col, diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Nullable<diesel::sql_types::Integer>, columns::nullable_int_col>>`
+   = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::ops::numeric::Add<columns::nullable_int_col, diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Nullable<diesel::sql_types::Integer>, columns::nullable_int_col>>>` for `SelectStatement<FromClause<users::table>>`
 
 error[E0277]: the trait bound `diesel::expression::is_aggregate::No: MixedAggregates<diesel::expression::is_aggregate::Yes>` is not satisfied
   --> tests/fail/cannot_mix_aggregate_and_non_aggregate_selects.rs:24:24
@@ -28,15 +28,15 @@ error[E0277]: the trait bound `diesel::expression::is_aggregate::No: MixedAggreg
 24 |     let source = users.select(f(nullable_int_col, max(nullable_int_col)));
    |                        ^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::Yes>` is not implemented for `diesel::expression::is_aggregate::No`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `MixedAggregates<Other>`:
              <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::Never>>
              <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::No>>
 note: required because of the requirements on the impl of `ValidGrouping<()>` for `__Derived<columns::nullable_int_col, diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Nullable<diesel::sql_types::Integer>, columns::nullable_int_col>>`
   --> tests/fail/cannot_mix_aggregate_and_non_aggregate_selects.rs:14:1
    |
 14 | sql_function!(fn f(x: Nullable<Integer>, y: Nullable<Integer>) -> Nullable<Integer>);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: 1 redundant requirements hidden
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `f::f<columns::nullable_int_col, diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Nullable<diesel::sql_types::Integer>, columns::nullable_int_col>>`
    = note: required because of the requirements on the impl of `SelectDsl<f::f<columns::nullable_int_col, diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Nullable<diesel::sql_types::Integer>, columns::nullable_int_col>>>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `sql_function` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `sql_function` which comes from the expansion of the derive macro `ValidGrouping` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/cannot_pass_aggregate_to_where.stderr b/diesel_compile_tests/tests/fail/cannot_pass_aggregate_to_where.stderr
index 9cafce838c96..54f1cbb99f14 100644
--- a/diesel_compile_tests/tests/fail/cannot_pass_aggregate_to_where.stderr
+++ b/diesel_compile_tests/tests/fail/cannot_pass_aggregate_to_where.stderr
@@ -4,8 +4,8 @@ error[E0277]: the trait bound `diesel::expression::is_aggregate::Yes: MixedAggre
 15 |     let source = users.filter(count(id).gt(3));
    |                        ^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::No>` is not implemented for `diesel::expression::is_aggregate::Yes`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `MixedAggregates<Other>`:
              <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Never>>
              <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Yes>>
-   = note: required because of the requirements on the impl of `NonAggregate` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<diesel::expression::count::count::count<diesel::sql_types::Integer, columns::id>, diesel::internal::derives::as_expression::Bound<BigInt, i64>>>`
-   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<diesel::expression::count::count::count<diesel::sql_types::Integer, columns::id>, diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: required because of the requirements on the impl of `NonAggregate` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<diesel::expression::count::count::count<diesel::sql_types::Integer, columns::id>, diesel::expression::bound::Bound<BigInt, i64>>>`
+   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<diesel::expression::count::count::count<diesel::sql_types::Integer, columns::id>, diesel::expression::bound::Bound<BigInt, i64>>>>` for `SelectStatement<FromClause<users::table>>`
diff --git a/diesel_compile_tests/tests/fail/cannot_update_target_with_methods_other_than_filter_called.stderr b/diesel_compile_tests/tests/fail/cannot_update_target_with_methods_other_than_filter_called.stderr
index bc887e6805d6..c986693e22c1 100644
--- a/diesel_compile_tests/tests/fail/cannot_update_target_with_methods_other_than_filter_called.stderr
+++ b/diesel_compile_tests/tests/fail/cannot_update_target_with_methods_other_than_filter_called.stderr
@@ -2,8 +2,11 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
   --> tests/fail/cannot_update_target_with_methods_other_than_filter_called.rs:15:26
    |
 15 |     let command = update(users.select(id)).set(id.eq(1));
-   |                          ^^^^^^^^^^^^^^^^ the trait `Identifiable` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>>`
+   |                   ------ ^^^^^^^^^^^^^^^^ the trait `Identifiable` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>>`
+   |                   |
+   |                   required by a bound introduced by this call
    |
+   = help: the trait `IntoUpdateTarget` is implemented for `SelectStatement<FromClause<F>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<F>>, diesel::query_builder::distinct_clause::NoDistinctClause, W>`
    = note: required because of the requirements on the impl of `IntoUpdateTarget` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>>`
 note: required by a bound in `diesel::update`
   --> $DIESEL/src/query_builder/functions.rs
@@ -15,8 +18,11 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
   --> tests/fail/cannot_update_target_with_methods_other_than_filter_called.rs:16:26
    |
 16 |     let command = update(users.order(id)).set(id.eq(1));
-   |                          ^^^^^^^^^^^^^^^ the trait `Identifiable` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::OrderClause<columns::id>>`
+   |                   ------ ^^^^^^^^^^^^^^^ the trait `Identifiable` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::OrderClause<columns::id>>`
+   |                   |
+   |                   required by a bound introduced by this call
    |
+   = help: the trait `IntoUpdateTarget` is implemented for `SelectStatement<FromClause<F>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<F>>, diesel::query_builder::distinct_clause::NoDistinctClause, W>`
    = note: required because of the requirements on the impl of `IntoUpdateTarget` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::OrderClause<columns::id>>`
 note: required by a bound in `diesel::update`
   --> $DIESEL/src/query_builder/functions.rs
@@ -30,6 +36,7 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 15 |     let command = update(users.select(id)).set(id.eq(1));
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Identifiable` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>>`
    |
+   = help: the trait `IntoUpdateTarget` is implemented for `SelectStatement<FromClause<F>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<F>>, diesel::query_builder::distinct_clause::NoDistinctClause, W>`
    = note: required because of the requirements on the impl of `IntoUpdateTarget` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>>`
 
 error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::OrderClause<columns::id>>: Identifiable` is not satisfied
@@ -38,4 +45,5 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 16 |     let command = update(users.order(id)).set(id.eq(1));
    |                   ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Identifiable` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::OrderClause<columns::id>>`
    |
+   = help: the trait `IntoUpdateTarget` is implemented for `SelectStatement<FromClause<F>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<F>>, diesel::query_builder::distinct_clause::NoDistinctClause, W>`
    = note: required because of the requirements on the impl of `IntoUpdateTarget` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::OrderClause<columns::id>>`
diff --git a/diesel_compile_tests/tests/fail/check_message_for_to_many_columns.stderr b/diesel_compile_tests/tests/fail/check_message_for_to_many_columns.stderr
index bf2f9dbcecd5..79210253e1ee 100644
--- a/diesel_compile_tests/tests/fail/check_message_for_to_many_columns.stderr
+++ b/diesel_compile_tests/tests/fail/check_message_for_to_many_columns.stderr
@@ -10,4 +10,4 @@ error: Table contains more than 16 columns. Consider enabling the `32-column-tab
 23 | | }
    | |_^
    |
-   = note: this error originates in the macro `$crate::__diesel_error_table_size` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_error_table_size` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/codegen_does_not_add_save_changes_method_on_structs_without_primary_key.stderr b/diesel_compile_tests/tests/fail/codegen_does_not_add_save_changes_method_on_structs_without_primary_key.stderr
index 09ed19b91e58..6d702ca386cc 100644
--- a/diesel_compile_tests/tests/fail/codegen_does_not_add_save_changes_method_on_structs_without_primary_key.stderr
+++ b/diesel_compile_tests/tests/fail/codegen_does_not_add_save_changes_method_on_structs_without_primary_key.stderr
@@ -1,36 +1,50 @@
 error[E0599]: the method `save_changes` exists for struct `User`, but its trait bounds were not satisfied
-  --> $DIR/codegen_does_not_add_save_changes_method_on_structs_without_primary_key.rs:26:10
-   |
-15 | pub struct User {
-   | ---------------
-   | |
-   | method `save_changes` not found for this
-   | doesn't satisfy `User: Copy`
-   | doesn't satisfy `User: HasTable`
-   | doesn't satisfy `User: IntoUpdateTarget`
-   | doesn't satisfy `User: diesel::SaveChangesDsl<_>`
+   --> tests/fail/codegen_does_not_add_save_changes_method_on_structs_without_primary_key.rs:26:10
+    |
+15  | pub struct User {
+    | ---------------
+    | |
+    | method `save_changes` not found for this struct
+    | doesn't satisfy `User: Copy`
+    | doesn't satisfy `User: HasTable`
+    | doesn't satisfy `User: IntoUpdateTarget`
+    | doesn't satisfy `User: diesel::SaveChangesDsl<_>`
 ...
-26 |     user.save_changes(&mut connection);
-   |          ^^^^^^^^^^^^ method cannot be called on `User` due to unsatisfied trait bounds
-   |
-   = note: the following trait bounds were not satisfied:
-           `User: HasTable`
-           which is required by `User: diesel::SaveChangesDsl<_>`
-           `User: Copy`
-           which is required by `User: diesel::SaveChangesDsl<_>`
-           `User: IntoUpdateTarget`
-           which is required by `User: diesel::SaveChangesDsl<_>`
-           `User: HasTable`
-           which is required by `&User: diesel::SaveChangesDsl<_>`
-           `&User: IntoUpdateTarget`
-           which is required by `&User: diesel::SaveChangesDsl<_>`
-           `&mut User: HasTable`
-           which is required by `&mut User: diesel::SaveChangesDsl<_>`
-           `<&mut User as diesel::AsChangeset>::Target = _`
-           which is required by `&mut User: diesel::SaveChangesDsl<_>`
-           `&mut User: Copy`
-           which is required by `&mut User: diesel::SaveChangesDsl<_>`
-           `&mut User: diesel::AsChangeset`
-           which is required by `&mut User: diesel::SaveChangesDsl<_>`
-           `&mut User: IntoUpdateTarget`
-           which is required by `&mut User: diesel::SaveChangesDsl<_>`
+26  |     user.save_changes(&mut connection);
+    |          ^^^^^^^^^^^^ method cannot be called on `User` due to unsatisfied trait bounds
+    |
+    = note: the following trait bounds were not satisfied:
+            `User: HasTable`
+            which is required by `User: diesel::SaveChangesDsl<_>`
+            `User: Copy`
+            which is required by `User: diesel::SaveChangesDsl<_>`
+            `User: IntoUpdateTarget`
+            which is required by `User: diesel::SaveChangesDsl<_>`
+            `User: HasTable`
+            which is required by `&User: diesel::SaveChangesDsl<_>`
+            `&User: IntoUpdateTarget`
+            which is required by `&User: diesel::SaveChangesDsl<_>`
+            `&mut User: HasTable`
+            which is required by `&mut User: diesel::SaveChangesDsl<_>`
+            `<&mut User as diesel::AsChangeset>::Target = _`
+            which is required by `&mut User: diesel::SaveChangesDsl<_>`
+            `&mut User: Copy`
+            which is required by `&mut User: diesel::SaveChangesDsl<_>`
+            `&mut User: diesel::AsChangeset`
+            which is required by `&mut User: diesel::SaveChangesDsl<_>`
+            `&mut User: IntoUpdateTarget`
+            which is required by `&mut User: diesel::SaveChangesDsl<_>`
+note: the following traits must be implemented
+   --> $DIESEL/src/associations/mod.rs
+    |
+    | pub trait HasTable {
+    | ^^^^^^^^^^^^^^^^^^
+    |
+   ::: $DIESEL/src/query_builder/update_statement/target.rs
+    |
+    | pub trait IntoUpdateTarget: HasTable {
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: consider annotating `User` with `#[derive(Clone, Copy)]`
+    |
+15  | #[derive(Clone, Copy)]
+    |
diff --git a/diesel_compile_tests/tests/fail/columns_cannot_be_rhs_of_insert.stderr b/diesel_compile_tests/tests/fail/columns_cannot_be_rhs_of_insert.stderr
index 81511790bd50..c11ef5f1a0e1 100644
--- a/diesel_compile_tests/tests/fail/columns_cannot_be_rhs_of_insert.stderr
+++ b/diesel_compile_tests/tests/fail/columns_cannot_be_rhs_of_insert.stderr
@@ -1,25 +1,30 @@
 error[E0271]: type mismatch resolving `<NoFromClause as AppearsInFromClause<users::table>>::Count == diesel::query_source::Once`
-  --> tests/fail/columns_cannot_be_rhs_of_insert.rs:20:10
-   |
-20 |         .execute(&mut conn)
-   |          ^^^^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-   |
+    --> tests/fail/columns_cannot_be_rhs_of_insert.rs:20:10
+     |
+20   |         .execute(&mut conn)
+     |          ^^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+     |
 note: required because of the requirements on the impl of `AppearsOnTable<NoFromClause>` for `columns::hair_color`
-  --> tests/fail/columns_cannot_be_rhs_of_insert.rs:6:1
-   |
-6  | / table! {
-7  | |     users {
-8  | |         id -> Integer,
-9  | |         name -> Text,
-10 | |         hair_color -> Text,
-11 | |     }
-12 | | }
-   | |_^
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<NoFromClause>` for `&columns::hair_color`
-   = note: required because of the requirements on the impl of `InsertValues<users::table, _>` for `ColumnInsertValue<columns::name, &columns::hair_color>`
-   = note: required because of the requirements on the impl of `QueryFragment<_>` for `diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::name, &columns::hair_color>, users::table>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<_>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::name, &columns::hair_color>, users::table>>`
-   = note: required because of the requirements on the impl of `ExecuteDsl<_, _>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::name, &columns::hair_color>, users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+    --> tests/fail/columns_cannot_be_rhs_of_insert.rs:6:1
+     |
+6    | / table! {
+7    | |     users {
+8    | |         id -> Integer,
+9    | |         name -> Text,
+10   | |         hair_color -> Text,
+11   | |     }
+12   | | }
+     | |_^
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<NoFromClause>` for `&columns::hair_color`
+     = note: required because of the requirements on the impl of `InsertValues<users::table, _>` for `ColumnInsertValue<columns::name, &columns::hair_color>`
+     = note: required because of the requirements on the impl of `QueryFragment<_>` for `diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::name, &columns::hair_color>, users::table>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `QueryFragment<_>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::name, &columns::hair_color>, users::table>>`
+     = note: required because of the requirements on the impl of `ExecuteDsl<_, _>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::name, &columns::hair_color>, users::table>>`
+note: required by a bound in `diesel::RunQueryDsl::execute`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: methods::ExecuteDsl<Conn>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::execute`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/combinations_require_same_sql_types.stderr b/diesel_compile_tests/tests/fail/combinations_require_same_sql_types.stderr
index f3f8ed167487..eece7f02edb9 100644
--- a/diesel_compile_tests/tests/fail/combinations_require_same_sql_types.stderr
+++ b/diesel_compile_tests/tests/fail/combinations_require_same_sql_types.stderr
@@ -1,17 +1,27 @@
 error[E0271]: type mismatch resolving `<comments::table as AsQuery>::SqlType == (diesel::sql_types::Integer, diesel::sql_types::Text)`
-  --> $DIR/combinations_require_same_sql_types.rs:30:26
+  --> tests/fail/combinations_require_same_sql_types.rs:30:26
    |
 30 |     let _ = users::table.union(comments::table);
-   |                          ^^^^^ expected struct `diesel::sql_types::Integer`, found struct `diesel::sql_types::Text`
+   |                          ^^^^^ expected struct `diesel::sql_types::Text`, found struct `diesel::sql_types::Integer`
    |
-   = note: expected tuple `(diesel::sql_types::Integer, diesel::sql_types::Integer)`
-              found tuple `(diesel::sql_types::Integer, diesel::sql_types::Text)`
+   = note: expected tuple `(diesel::sql_types::Integer, diesel::sql_types::Text)`
+              found tuple `(diesel::sql_types::Integer, diesel::sql_types::Integer)`
+note: required by a bound in `union`
+  --> $DIESEL/src/query_dsl/combine_dsl.rs
+   |
+   |         Rhs: AsQuery<SqlType = <Self::Query as Query>::SqlType>;
+   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `union`
 
 error[E0271]: type mismatch resolving `<comments::table as AsQuery>::SqlType == (diesel::sql_types::Integer, diesel::sql_types::Text)`
-  --> $DIR/combinations_require_same_sql_types.rs:35:19
+  --> tests/fail/combinations_require_same_sql_types.rs:35:19
    |
 35 |     let _ = union.union(comments::table);
-   |                   ^^^^^ expected struct `diesel::sql_types::Integer`, found struct `diesel::sql_types::Text`
+   |                   ^^^^^ expected struct `diesel::sql_types::Text`, found struct `diesel::sql_types::Integer`
+   |
+   = note: expected tuple `(diesel::sql_types::Integer, diesel::sql_types::Text)`
+              found tuple `(diesel::sql_types::Integer, diesel::sql_types::Integer)`
+note: required by a bound in `union`
+  --> $DIESEL/src/query_dsl/combine_dsl.rs
    |
-   = note: expected tuple `(diesel::sql_types::Integer, diesel::sql_types::Integer)`
-              found tuple `(diesel::sql_types::Integer, diesel::sql_types::Text)`
+   |         Rhs: AsQuery<SqlType = <Self::Query as Query>::SqlType>;
+   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `union`
diff --git a/diesel_compile_tests/tests/fail/custom_returning_requires_nonaggregate.stderr b/diesel_compile_tests/tests/fail/custom_returning_requires_nonaggregate.stderr
index 4865f8ff0b27..05fbf5c876a3 100644
--- a/diesel_compile_tests/tests/fail/custom_returning_requires_nonaggregate.stderr
+++ b/diesel_compile_tests/tests/fail/custom_returning_requires_nonaggregate.stderr
@@ -1,23 +1,33 @@
 error[E0277]: the trait bound `diesel::expression::is_aggregate::Yes: MixedAggregates<diesel::expression::is_aggregate::No>` is not satisfied
-  --> tests/fail/custom_returning_requires_nonaggregate.rs:22:68
-   |
-22 |     let stmt = update(users.filter(id.eq(1))).set(name.eq("Bill")).returning(count(id));
-   |                                                                    ^^^^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::No>` is not implemented for `diesel::expression::is_aggregate::Yes`
-   |
-   = help: the following implementations were found:
-             <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Never>>
-             <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Yes>>
-   = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::count::count::count<diesel::sql_types::Integer, columns::id>>>`
+   --> tests/fail/custom_returning_requires_nonaggregate.rs:22:68
+    |
+22  |     let stmt = update(users.filter(id.eq(1))).set(name.eq("Bill")).returning(count(id));
+    |                                                                    ^^^^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::No>` is not implemented for `diesel::expression::is_aggregate::Yes`
+    |
+    = help: the following other types implement trait `MixedAggregates<Other>`:
+              <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Never>>
+              <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Yes>>
+    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::count::count::count<diesel::sql_types::Integer, columns::id>>>`
+note: required by a bound in `UpdateStatement::<T, U, V>::returning`
+   --> $DIESEL/src/query_builder/update_statement/mod.rs
+    |
+    |         UpdateStatement<T, U, V, ReturningClause<E>>: Query,
+    |                                                       ^^^^^ required by this bound in `UpdateStatement::<T, U, V>::returning`
 
 error[E0277]: the trait bound `diesel::expression::is_aggregate::No: MixedAggregates<diesel::expression::is_aggregate::Yes>` is not satisfied
-  --> tests/fail/custom_returning_requires_nonaggregate.rs:27:53
-   |
-27 |     let stmt = insert_into(users).values(&new_user).returning((name, count(name)));
-   |                                                     ^^^^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::Yes>` is not implemented for `diesel::expression::is_aggregate::No`
-   |
-   = help: the following implementations were found:
-             <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::Never>>
-             <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::No>>
-   = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(columns::name, diesel::expression::count::count::count<diesel::sql_types::Text, columns::name>)`
-   = note: required because of the requirements on the impl of `NonAggregate` for `(columns::name, diesel::expression::count::count::count<diesel::sql_types::Text, columns::name>)`
-   = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<(columns::name, diesel::expression::count::count::count<diesel::sql_types::Text, columns::name>)>>`
+   --> tests/fail/custom_returning_requires_nonaggregate.rs:27:53
+    |
+27  |     let stmt = insert_into(users).values(&new_user).returning((name, count(name)));
+    |                                                     ^^^^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::Yes>` is not implemented for `diesel::expression::is_aggregate::No`
+    |
+    = help: the following other types implement trait `MixedAggregates<Other>`:
+              <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::Never>>
+              <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::No>>
+    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(columns::name, diesel::expression::count::count::count<diesel::sql_types::Text, columns::name>)`
+    = note: required because of the requirements on the impl of `NonAggregate` for `(columns::name, diesel::expression::count::count::count<diesel::sql_types::Text, columns::name>)`
+    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<(columns::name, diesel::expression::count::count::count<diesel::sql_types::Text, columns::name>)>>`
+note: required by a bound in `InsertStatement::<T, U, Op>::returning`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         InsertStatement<T, U, Op, ReturningClause<E>>: Query,
+    |                                                        ^^^^^ required by this bound in `InsertStatement::<T, U, Op>::returning`
diff --git a/diesel_compile_tests/tests/fail/custom_returning_requires_selectable_expression.stderr b/diesel_compile_tests/tests/fail/custom_returning_requires_selectable_expression.stderr
index d32790a3d4d5..fc836ea8b57e 100644
--- a/diesel_compile_tests/tests/fail/custom_returning_requires_selectable_expression.stderr
+++ b/diesel_compile_tests/tests/fail/custom_returning_requires_selectable_expression.stderr
@@ -1,73 +1,104 @@
-error[E0277]: the trait bound `bad::columns::age: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/custom_returning_requires_selectable_expression.rs:28:78
-   |
-28 |     let stmt = update(users.filter(id.eq(1))).set(name.eq("Bill")).returning(bad::age);
-   |                                                                              ^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `bad::columns::age`
-   |
-   = help: the following implementations were found:
-             <bad::columns::age as SelectableExpression<JoinOn<Join, On>>>
-             <bad::columns::age as SelectableExpression<Only<bad::table>>>
-             <bad::columns::age as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <bad::columns::age as SelectableExpression<bad::table>>
-           and 2 others
-   = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<bad::columns::age>>`
+error[E0277]: Cannot select `bad::columns::age` from `users::table`
+   --> tests/fail/custom_returning_requires_selectable_expression.rs:28:68
+    |
+28  |     let stmt = update(users.filter(id.eq(1))).set(name.eq("Bill")).returning(bad::age);
+    |                                                                    ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `bad::columns::age`
+    |
+    = note: `bad::columns::age` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
+              <bad::columns::age as SelectableExpression<JoinOn<Join, On>>>
+              <bad::columns::age as SelectableExpression<Only<bad::table>>>
+              <bad::columns::age as SelectableExpression<SelectStatement<FromClause<From>>>>
+              <bad::columns::age as SelectableExpression<bad::table>>
+              <bad::columns::age as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <bad::columns::age as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<bad::columns::age>>`
+note: required by a bound in `UpdateStatement::<T, U, V>::returning`
+   --> $DIESEL/src/query_builder/update_statement/mod.rs
+    |
+    |         UpdateStatement<T, U, V, ReturningClause<E>>: Query,
+    |                                                       ^^^^^ required by this bound in `UpdateStatement::<T, U, V>::returning`
 
-error[E0277]: the trait bound `bad::columns::age: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/custom_returning_requires_selectable_expression.rs:33:63
-   |
-33 |     let stmt = insert_into(users).values(&new_user).returning((name, bad::age));
-   |                                                               ^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `bad::columns::age`
-   |
-   = help: the following implementations were found:
-             <bad::columns::age as SelectableExpression<JoinOn<Join, On>>>
-             <bad::columns::age as SelectableExpression<Only<bad::table>>>
-             <bad::columns::age as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <bad::columns::age as SelectableExpression<bad::table>>
-           and 2 others
-   = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(users::columns::name, bad::columns::age)`
-   = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<(users::columns::name, bad::columns::age)>>`
+error[E0277]: Cannot select `bad::columns::age` from `users::table`
+   --> tests/fail/custom_returning_requires_selectable_expression.rs:33:53
+    |
+33  |     let stmt = insert_into(users).values(&new_user).returning((name, bad::age));
+    |                                                     ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `bad::columns::age`
+    |
+    = note: `bad::columns::age` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
+              <bad::columns::age as SelectableExpression<JoinOn<Join, On>>>
+              <bad::columns::age as SelectableExpression<Only<bad::table>>>
+              <bad::columns::age as SelectableExpression<SelectStatement<FromClause<From>>>>
+              <bad::columns::age as SelectableExpression<bad::table>>
+              <bad::columns::age as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <bad::columns::age as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(users::columns::name, bad::columns::age)`
+    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<(users::columns::name, bad::columns::age)>>`
+note: required by a bound in `InsertStatement::<T, U, Op>::returning`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         InsertStatement<T, U, Op, ReturningClause<E>>: Query,
+    |                                                        ^^^^^ required by this bound in `InsertStatement::<T, U, Op>::returning`
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<bad::table>>::Count == diesel::query_source::Once`
-  --> tests/fail/custom_returning_requires_selectable_expression.rs:33:53
-   |
-33 |     let stmt = insert_into(users).values(&new_user).returning((name, bad::age));
-   |                                                     ^^^^^^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-   |
+   --> tests/fail/custom_returning_requires_selectable_expression.rs:33:53
+    |
+33  |     let stmt = insert_into(users).values(&new_user).returning((name, bad::age));
+    |                                                     ^^^^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+    |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `bad::columns::age`
-  --> tests/fail/custom_returning_requires_selectable_expression.rs:12:1
-   |
-12 | / table! {
-13 | |     bad {
-14 | |       id -> Integer,
-15 | |       age -> Integer,
-16 | |     }
-17 | | }
-   | |_^
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(users::columns::name, bad::columns::age)`
-   = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(users::columns::name, bad::columns::age)`
-   = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<(users::columns::name, bad::columns::age)>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   --> tests/fail/custom_returning_requires_selectable_expression.rs:12:1
+    |
+12  | / table! {
+13  | |     bad {
+14  | |       id -> Integer,
+15  | |       age -> Integer,
+16  | |     }
+17  | | }
+    | |_^
+    = note: 1 redundant requirement hidden
+    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(users::columns::name, bad::columns::age)`
+    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(users::columns::name, bad::columns::age)`
+    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<(users::columns::name, bad::columns::age)>>`
+note: required by a bound in `InsertStatement::<T, U, Op>::returning`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         InsertStatement<T, U, Op, ReturningClause<E>>: Query,
+    |                                                        ^^^^^ required by this bound in `InsertStatement::<T, U, Op>::returning`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<bad::table>` is not satisfied
-  --> tests/fail/custom_returning_requires_selectable_expression.rs:33:53
-   |
-33 |     let stmt = insert_into(users).values(&new_user).returning((name, bad::age));
-   |                                                     ^^^^^^^^^ the trait `TableNotEqual<bad::table>` is not implemented for `users::table`
-   |
-   = note: required because of the requirements on the impl of `AppearsInFromClause<bad::table>` for `users::table`
+   --> tests/fail/custom_returning_requires_selectable_expression.rs:33:53
+    |
+33  |     let stmt = insert_into(users).values(&new_user).returning((name, bad::age));
+    |                                                     ^^^^^^^^^ the trait `TableNotEqual<bad::table>` is not implemented for `users::table`
+    |
+    = help: the following other types implement trait `TableNotEqual<T>`:
+              <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+              <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+              <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+              <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+              <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+              <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+    = note: required because of the requirements on the impl of `AppearsInFromClause<bad::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `bad::columns::age`
-  --> tests/fail/custom_returning_requires_selectable_expression.rs:12:1
-   |
-12 | / table! {
-13 | |     bad {
-14 | |       id -> Integer,
-15 | |       age -> Integer,
-16 | |     }
-17 | | }
-   | |_^
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(users::columns::name, bad::columns::age)`
-   = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(users::columns::name, bad::columns::age)`
-   = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<(users::columns::name, bad::columns::age)>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   --> tests/fail/custom_returning_requires_selectable_expression.rs:12:1
+    |
+12  | / table! {
+13  | |     bad {
+14  | |       id -> Integer,
+15  | |       age -> Integer,
+16  | |     }
+17  | | }
+    | |_^
+    = note: 1 redundant requirement hidden
+    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(users::columns::name, bad::columns::age)`
+    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(users::columns::name, bad::columns::age)`
+    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<(users::columns::name, bad::columns::age)>>`
+note: required by a bound in `InsertStatement::<T, U, Op>::returning`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         InsertStatement<T, U, Op, ReturningClause<E>>: Query,
+    |                                                        ^^^^^ required by this bound in `InsertStatement::<T, U, Op>::returning`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/delete_statement_does_not_support_returning_methods_on_sqlite.stderr b/diesel_compile_tests/tests/fail/delete_statement_does_not_support_returning_methods_on_sqlite.stderr
index 5eec2fe1e01f..0d504166e28e 100644
--- a/diesel_compile_tests/tests/fail/delete_statement_does_not_support_returning_methods_on_sqlite.stderr
+++ b/diesel_compile_tests/tests/fail/delete_statement_does_not_support_returning_methods_on_sqlite.stderr
@@ -1,29 +1,39 @@
 error[E0277]: the trait bound `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>: QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not satisfied
-  --> tests/fail/delete_statement_does_not_support_returning_methods_on_sqlite.rs:17:10
-   |
-17 |         .get_result(&mut connection);
-   |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>>, diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>>>`
+    --> tests/fail/delete_statement_does_not_support_returning_methods_on_sqlite.rs:17:10
+     |
+17   |         .get_result(&mut connection);
+     |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>, diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `diesel::query_builder::returning_clause::ReturningClause<columns::name>: QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not satisfied
-  --> tests/fail/delete_statement_does_not_support_returning_methods_on_sqlite.rs:21:10
-   |
-21 |         .get_result(&mut connection);
-   |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>>, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>>, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
+    --> tests/fail/delete_statement_does_not_support_returning_methods_on_sqlite.rs:21:10
+     |
+21   |         .get_result(&mut connection);
+     |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
diff --git a/diesel_compile_tests/tests/fail/derive/aliases.stderr b/diesel_compile_tests/tests/fail/derive/aliases.stderr
index bf3c8e323097..274e8d00738f 100644
--- a/diesel_compile_tests/tests/fail/derive/aliases.stderr
+++ b/diesel_compile_tests/tests/fail/derive/aliases.stderr
@@ -2,128 +2,117 @@ error[E0271]: type mismatch resolving `<posts::columns::id as Column>::Table ==
   --> tests/fail/derive/aliases.rs:36:16
    |
 36 |     user_alias.field(posts::id);
-   |                ^^^^^ expected struct `posts::table`, found struct `users::table`
-
-error[E0277]: the trait bound `(diesel::query_source::Once, diesel::query_source::Once): Pick<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>>` is not satisfied
-  --> tests/fail/derive/aliases.rs:42:10
-   |
-42 |         .inner_join(post_alias)
-   |          ^^^^^^^^^^ the trait `Pick<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>>` is not implemented for `(diesel::query_source::Once, diesel::query_source::Once)`
-   |
-   = help: the following implementations were found:
-             <(MoreThanOnce, OtherCount) as Pick<Left, Right>>
-             <(diesel::query_source::Never, MoreThanOnce) as Pick<Left, Right>>
-             <(diesel::query_source::Never, diesel::query_source::Never) as Pick<Left, Right>>
-             <(diesel::query_source::Never, diesel::query_source::Once) as Pick<Left, Right>>
-           and 2 others
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `AliasedField<posts2, posts::columns::id>`
-   = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `((users::columns::id, users::columns::name), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>))`
-   = note: required because of the requirements on the impl of `QuerySource` for `diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>`
-   = note: required because of the requirements on the impl of `InternalJoinDsl<Alias<posts2>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>`
-
-error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
-  --> tests/fail/derive/aliases.rs:42:10
+   |                ^^^^^ expected struct `users::table`, found struct `posts::table`
    |
-42 |         .inner_join(post_alias)
-   |          ^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+note: required by a bound in `Alias::<S>::field`
+  --> $DIESEL/src/query_source/aliasing/alias.rs
    |
-   = note: required because of the requirements on the impl of `AppearsOnTable<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `AliasedField<posts2, posts::columns::id>`
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `AliasedField<posts2, posts::columns::id>`
-   = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `((users::columns::id, users::columns::name), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>))`
-   = note: required because of the requirements on the impl of `QuerySource` for `diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>`
-   = note: required because of the requirements on the impl of `InternalJoinDsl<Alias<posts2>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>`
+   |         F: Column<Table = S::Target>,
+   |                   ^^^^^^^^^^^^^^^^^ required by this bound in `Alias::<S>::field`
 
-error[E0271]: type mismatch resolving `<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner> as AppearsInFromClause<Alias<posts2>>>::Count == diesel::query_source::Once`
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
   --> tests/fail/derive/aliases.rs:42:10
    |
 42 |         .inner_join(post_alias)
    |          ^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
    |
-   = note: required because of the requirements on the impl of `AppearsOnTable<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `AliasedField<posts2, posts::columns::id>`
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `AliasedField<posts2, posts::columns::id>`
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `((users::columns::id, users::columns::name), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>))`
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `((users::columns::id, users::columns::name), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>))`
-   = note: required because of the requirements on the impl of `QuerySource` for `diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>`
-   = note: required because of the requirements on the impl of `InternalJoinDsl<Alias<posts2>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `((users::columns::id, users::columns::name), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>))`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<Alias<posts2>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>`
 
-error[E0271]: type mismatch resolving `<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>> as AppearsInFromClause<Alias<posts2>>>::Count == diesel::query_source::Once`
+error[E0271]: type mismatch resolving `<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner> as AppearsInFromClause<Alias<posts2>>>::Count == diesel::query_source::Once`
   --> tests/fail/derive/aliases.rs:42:10
    |
 42 |         .inner_join(post_alias)
    |          ^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
    |
-   = note: required because of the requirements on the impl of `AppearsOnTable<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>` for `AliasedField<posts2, posts::columns::id>`
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `AliasedField<posts2, posts::columns::id>`
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>` for `((users::columns::id, users::columns::name), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>))`
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>` for `((users::columns::id, users::columns::name), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>))`
-   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>`
-   = note: required because of the requirements on the impl of `InternalJoinDsl<Alias<posts2>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>>` for `((users::columns::id, users::columns::name), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>), (AliasedField<posts2, posts::columns::id>, AliasedField<posts2, posts::columns::author>, AliasedField<posts2, posts::columns::title>))`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<Alias<posts2>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>`
 
-error[E0599]: the method `select` exists for struct `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>`, but its trait bounds were not satisfied
+error[E0599]: the method `select` exists for struct `SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>`, but its trait bounds were not satisfied
   --> tests/fail/derive/aliases.rs:43:10
    |
 43 |         .select(users::id)
    |          ^^^^^^ private field, not a method
    |
    = note: the following trait bounds were not satisfied:
-           `&SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>: Table`
-           which is required by `&SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>: diesel::QueryDsl`
-           `&mut SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>: Table`
-           which is required by `&mut SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>: diesel::QueryDsl`
+           `&SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>: Table`
+           which is required by `&SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>: diesel::QueryDsl`
+           `&mut SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>: Table`
+           which is required by `&mut SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>, Alias<posts2>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<AliasedField<posts2, posts::columns::author>>, NullableExpression<users::columns::id>>>>>>: diesel::QueryDsl`
 
-error[E0277]: the trait bound `users::columns::id: SelectableExpression<Alias<users2>>` is not satisfied
-  --> tests/fail/derive/aliases.rs:48:23
+error[E0277]: Cannot select `users::columns::id` from `Alias<users2>`
+  --> tests/fail/derive/aliases.rs:48:16
    |
 48 |     user_alias.select(users::id).load::<i32>(conn).unwrap();
-   |                       ^^^^^^^^^ the trait `SelectableExpression<Alias<users2>>` is not implemented for `users::columns::id`
+   |                ^^^^^^ the trait `SelectableExpression<Alias<users2>>` is not implemented for `users::columns::id`
    |
-   = help: the following implementations were found:
+   = note: `users::columns::id` is no valid selection for `Alias<users2>`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <users::columns::id as SelectableExpression<JoinOn<Join, On>>>
              <users::columns::id as SelectableExpression<Only<users::table>>>
              <users::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <users::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <users::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <users::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+             <users::columns::id as SelectableExpression<users::table>>
    = note: required because of the requirements on the impl of `SelectDsl<users::columns::id>` for `SelectStatement<FromClause<Alias<users2>>>`
 
-error[E0277]: the trait bound `users::columns::id: SelectableExpression<Alias<users2>>` is not satisfied
-  --> tests/fail/derive/aliases.rs:48:34
-   |
-48 |     user_alias.select(users::id).load::<i32>(conn).unwrap();
-   |                                  ^^^^ the trait `SelectableExpression<Alias<users2>>` is not implemented for `users::columns::id`
-   |
-   = help: the following implementations were found:
-             <users::columns::id as SelectableExpression<JoinOn<Join, On>>>
-             <users::columns::id as SelectableExpression<Only<users::table>>>
-             <users::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <users::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
-   = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<FromClause<Alias<users2>>>` for `diesel::query_builder::select_clause::SelectClause<users::columns::id>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<Alias<users2>>, diesel::query_builder::select_clause::SelectClause<users::columns::id>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, i32>` for `SelectStatement<FromClause<Alias<users2>>, diesel::query_builder::select_clause::SelectClause<users::columns::id>>`
+error[E0277]: Cannot select `users::columns::id` from `Alias<users2>`
+    --> tests/fail/derive/aliases.rs:48:34
+     |
+48   |     user_alias.select(users::id).load::<i32>(conn).unwrap();
+     |                                  ^^^^ the trait `SelectableExpression<Alias<users2>>` is not implemented for `users::columns::id`
+     |
+     = note: `users::columns::id` is no valid selection for `Alias<users2>`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <users::columns::id as SelectableExpression<JoinOn<Join, On>>>
+               <users::columns::id as SelectableExpression<Only<users::table>>>
+               <users::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
+               <users::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+               <users::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+               <users::columns::id as SelectableExpression<users::table>>
+     = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<FromClause<Alias<users2>>>` for `diesel::query_builder::select_clause::SelectClause<users::columns::id>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<Alias<users2>>, diesel::query_builder::select_clause::SelectClause<users::columns::id>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, i32>` for `SelectStatement<FromClause<Alias<users2>>, diesel::query_builder::select_clause::SelectClause<users::columns::id>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `Alias<users2>: AppearsInFromClause<pets::table>` is not satisfied
-  --> tests/fail/derive/aliases.rs:54:21
+  --> tests/fail/derive/aliases.rs:54:10
    |
 54 |         .inner_join(user_alias)
-   |                     ^^^^^^^^^^ the trait `AppearsInFromClause<pets::table>` is not implemented for `Alias<users2>`
-   |
-   = help: the following implementations were found:
-             <Alias<S> as AppearsInFromClause<QS>>
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<pets::table, Alias<users2>, Inner>>` for `pets::columns::id`
+   |          ^^^^^^^^^^ the trait `AppearsInFromClause<pets::table>` is not implemented for `Alias<users2>`
+   |
+   = help: the trait `AppearsInFromClause<QS>` is implemented for `Alias<S>`
+   = note: required because of the requirements on the impl of `AppearsInFromClause<pets::table>` for `query_source::joins::Join<pets::table, Alias<users2>, Inner>`
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<pets::table, Alias<users2>, Inner>>` for `pets::columns::id`
+  --> tests/fail/derive/aliases.rs:21:1
+   |
+21 | / table! {
+22 | |     pets {
+23 | |         id -> Integer,
+24 | |     }
+25 | | }
+   | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<pets::table, Alias<users2>, Inner>>` for `((pets::columns::id,), (AliasedField<users2, users::columns::id>, AliasedField<users2, users::columns::name>))`
-   = note: required because of the requirements on the impl of `QuerySource` for `diesel::internal::table_macro::Join<pets::table, Alias<users2>, Inner>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<diesel::internal::table_macro::Join<pets::table, Alias<users2>, Inner>, _>`
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<pets::table, Alias<users2>, Inner>>` for `((pets::columns::id,), (AliasedField<users2, users::columns::id>, AliasedField<users2, users::columns::name>))`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<pets::table, Alias<users2>, Inner>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<pets::table, Alias<users2>, Inner>, _>`
    = note: required because of the requirements on the impl of `InternalJoinDsl<Alias<users2>, Inner, _>` for `SelectStatement<FromClause<pets::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: JoinTo<pets::table>` is not satisfied
   --> tests/fail/derive/aliases.rs:54:10
@@ -131,23 +120,25 @@ error[E0277]: the trait bound `users::table: JoinTo<pets::table>` is not satisfi
 54 |         .inner_join(user_alias)
    |          ^^^^^^^^^^ the trait `JoinTo<pets::table>` is not implemented for `users::table`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `JoinTo<T>`:
              <users::table as JoinTo<Alias<S>>>
              <users::table as JoinTo<BoxedSelectStatement<'a, FromClause<QS>, ST, DB>>>
              <users::table as JoinTo<JoinOn<Join, On>>>
              <users::table as JoinTo<Only<S>>>
-           and 3 others
+             <users::table as JoinTo<SelectStatement<FromClause<F>, S, D, W, O, L, Of, G>>>
+             <users::table as JoinTo<posts::table>>
+             <users::table as JoinTo<query_source::joins::Join<Left, Right, Kind>>>
    = note: required because of the requirements on the impl of `JoinTo<pets::table>` for `Alias<users2>`
    = note: required because of the requirements on the impl of `JoinWithImplicitOnClause<Alias<users2>, Inner>` for `pets::table`
 
-error[E0599]: the method `select` exists for struct `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, Alias<users2>, Inner>, _>>>`, but its trait bounds were not satisfied
+error[E0599]: the method `select` exists for struct `SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, Alias<users2>, Inner>, _>>>`, but its trait bounds were not satisfied
   --> tests/fail/derive/aliases.rs:55:10
    |
 55 |         .select(pets::id)
    |          ^^^^^^ private field, not a method
    |
    = note: the following trait bounds were not satisfied:
-           `&SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, Alias<users2>, Inner>, _>>>: Table`
-           which is required by `&SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, Alias<users2>, Inner>, _>>>: diesel::QueryDsl`
-           `&mut SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, Alias<users2>, Inner>, _>>>: Table`
-           which is required by `&mut SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, Alias<users2>, Inner>, _>>>: diesel::QueryDsl`
+           `&SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, Alias<users2>, Inner>, _>>>: Table`
+           which is required by `&SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, Alias<users2>, Inner>, _>>>: diesel::QueryDsl`
+           `&mut SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, Alias<users2>, Inner>, _>>>: Table`
+           which is required by `&mut SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, Alias<users2>, Inner>, _>>>: diesel::QueryDsl`
diff --git a/diesel_compile_tests/tests/fail/derive/as_changeset_struct_with_only_primary_key.stderr b/diesel_compile_tests/tests/fail/derive/as_changeset_struct_with_only_primary_key.stderr
index 156c53fad8ab..f4827808f85c 100644
--- a/diesel_compile_tests/tests/fail/derive/as_changeset_struct_with_only_primary_key.stderr
+++ b/diesel_compile_tests/tests/fail/derive/as_changeset_struct_with_only_primary_key.stderr
@@ -1,23 +1,19 @@
 error: Deriving `AsChangeset` on a structure that only contains primary keys isn't supported.
-
-  = help: If you want to change the primary key of a row, you should do so with `.set(table::id.eq(new_id))`.
-  = note: `#[derive(AsChangeset)]` never changes the primary key of a row.
-
   --> tests/fail/derive/as_changeset_struct_with_only_primary_key.rs:18:10
    |
 18 | #[derive(AsChangeset)]
    |          ^^^^^^^^^^^
    |
+   = help: If you want to change the primary key of a row, you should do so with `.set(table::id.eq(new_id))`.
+   = note: `#[derive(AsChangeset)]` never changes the primary key of a row.
    = note: this error originates in the derive macro `AsChangeset` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: Deriving `AsChangeset` on a structure that only contains primary keys isn't supported.
-
-  = help: If you want to change the primary key of a row, you should do so with `.set(table::id.eq(new_id))`.
-  = note: `#[derive(AsChangeset)]` never changes the primary key of a row.
-
   --> tests/fail/derive/as_changeset_struct_with_only_primary_key.rs:24:10
    |
 24 | #[derive(AsChangeset)]
    |          ^^^^^^^^^^^
    |
+   = help: If you want to change the primary key of a row, you should do so with `.set(table::id.eq(new_id))`.
+   = note: `#[derive(AsChangeset)]` never changes the primary key of a row.
    = note: this error originates in the derive macro `AsChangeset` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/derive/bad_belongs_to.stderr b/diesel_compile_tests/tests/fail/derive/bad_belongs_to.stderr
index 2ba43a708bc2..4058f7561a5e 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_belongs_to.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_belongs_to.stderr
@@ -1,53 +1,51 @@
 error: unexpected end of input, expected parentheses
-
-  = help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
-
-  --> $DIR/bad_belongs_to.rs:29:9
+  --> tests/fail/derive/bad_belongs_to.rs:29:20
    |
 29 | #[diesel(belongs_to)]
-   |         ^^^^^^^^^^^^
+   |                    ^
+   |
+   = help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
 
 error: expected parentheses
-  --> $DIR/bad_belongs_to.rs:36:21
+  --> tests/fail/derive/bad_belongs_to.rs:36:21
    |
 36 | #[diesel(belongs_to = "Bar")]
    |                     ^
 
 error: unexpected end of input, expected identifier
-  --> $DIR/bad_belongs_to.rs:43:20
+  --> tests/fail/derive/bad_belongs_to.rs:43:21
    |
 43 | #[diesel(belongs_to())]
-   |                    ^^
+   |                     ^
 
 error: expected `,`
-  --> $DIR/bad_belongs_to.rs:50:33
+  --> tests/fail/derive/bad_belongs_to.rs:50:33
    |
 50 | #[diesel(belongs_to(foreign_key = bar_id))]
    |                                 ^
 
 error: expected `,`
-  --> $DIR/bad_belongs_to.rs:57:25
+  --> tests/fail/derive/bad_belongs_to.rs:57:25
    |
 57 | #[diesel(belongs_to(Bar = "bar_id"))]
    |                         ^
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
-
-  --> $DIR/bad_belongs_to.rs:64:20
+  --> tests/fail/derive/bad_belongs_to.rs:64:37
    |
 64 | #[diesel(belongs_to(Bar, foreign_key))]
-   |                    ^^^^^^^^^^^^^^^^^^
+   |                                     ^
+   |
+   = help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
 
 error: expected `=`
-  --> $DIR/bad_belongs_to.rs:71:37
+  --> tests/fail/derive/bad_belongs_to.rs:71:37
    |
 71 | #[diesel(belongs_to(Bar, foreign_key(bar_id)))]
-   |                                     ^^^^^^^^
+   |                                     ^
 
 error: unknown attribute, expected `foreign_key`
-  --> $DIR/bad_belongs_to.rs:78:26
+  --> tests/fail/derive/bad_belongs_to.rs:78:26
    |
 78 | #[diesel(belongs_to(Bar, what))]
    |                          ^^^^
diff --git a/diesel_compile_tests/tests/fail/derive/bad_column_name.stderr b/diesel_compile_tests/tests/fail/derive/bad_column_name.stderr
index 1a93bcb133b3..7f8c95e6207a 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_column_name.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_column_name.stderr
@@ -1,20 +1,19 @@
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(column_name = foo)]`
-
-  --> $DIR/bad_column_name.rs:14:13
+  --> tests/fail/derive/bad_column_name.rs:14:25
    |
 14 |     #[diesel(column_name)]
-   |             ^^^^^^^^^^^^^
+   |                         ^
+   |
+   = help: The correct format looks like `#[diesel(column_name = foo)]`
 
 error: expected `=`
-  --> $DIR/bad_column_name.rs:21:25
+  --> tests/fail/derive/bad_column_name.rs:21:25
    |
 21 |     #[diesel(column_name(another))]
-   |                         ^^^^^^^^^
+   |                         ^
 
 error: expected string literal
-  --> $DIR/bad_column_name.rs:28:28
+  --> tests/fail/derive/bad_column_name.rs:28:28
    |
 28 |     #[diesel(column_name = true)]
    |                            ^^^^
diff --git a/diesel_compile_tests/tests/fail/derive/bad_deserialize_as.stderr b/diesel_compile_tests/tests/fail/derive/bad_deserialize_as.stderr
index b4db06bb8a09..8b7ded22ce6f 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_deserialize_as.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_deserialize_as.stderr
@@ -1,26 +1,25 @@
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(deserialize_as = Foo)]`
-
- --> $DIR/bad_deserialize_as.rs:7:13
+ --> tests/fail/derive/bad_deserialize_as.rs:7:28
   |
 7 |     #[diesel(deserialize_as)]
-  |             ^^^^^^^^^^^^^^^^
+  |                            ^
+  |
+  = help: The correct format looks like `#[diesel(deserialize_as = Foo)]`
 
 error: expected `=`
-  --> $DIR/bad_deserialize_as.rs:14:28
+  --> tests/fail/derive/bad_deserialize_as.rs:14:28
    |
 14 |     #[diesel(deserialize_as(Foo))]
-   |                            ^^^^^
+   |                            ^
 
 error: expected identifier
-  --> $DIR/bad_deserialize_as.rs:21:31
+  --> tests/fail/derive/bad_deserialize_as.rs:21:31
    |
 21 |     #[diesel(deserialize_as = "foo")]
    |                               ^^^^^
 
 error: expected identifier
-  --> $DIR/bad_deserialize_as.rs:28:31
+  --> tests/fail/derive/bad_deserialize_as.rs:28:31
    |
 28 |     #[diesel(deserialize_as = 1omg)]
    |                               ^^^^
diff --git a/diesel_compile_tests/tests/fail/derive/bad_insertable.stderr b/diesel_compile_tests/tests/fail/derive/bad_insertable.stderr
index ce08feaf7e4a..c499d2733bf2 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_insertable.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_insertable.stderr
@@ -4,6 +4,16 @@ error[E0277]: the trait bound `std::string::String: diesel::Expression` is not s
 12 |     id: String,
    |     ^^ the trait `diesel::Expression` is not implemented for `std::string::String`
    |
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 123 others
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Integer>` for `std::string::String`
 
 error[E0277]: the trait bound `i32: diesel::Expression` is not satisfied
@@ -12,6 +22,16 @@ error[E0277]: the trait bound `i32: diesel::Expression` is not satisfied
 13 |     name: i32,
    |     ^^^^ the trait `diesel::Expression` is not implemented for `i32`
    |
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 123 others
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Text>` for `i32`
 
 error[E0277]: the trait bound `std::string::String: diesel::Expression` is not satisfied
@@ -20,6 +40,16 @@ error[E0277]: the trait bound `std::string::String: diesel::Expression` is not s
 12 |     id: String,
    |     ^^ the trait `diesel::Expression` is not implemented for `std::string::String`
    |
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 123 others
    = note: required because of the requirements on the impl of `diesel::Expression` for `&'insert std::string::String`
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Integer>` for `&'insert std::string::String`
 
@@ -29,5 +59,15 @@ error[E0277]: the trait bound `i32: diesel::Expression` is not satisfied
 13 |     name: i32,
    |     ^^^^ the trait `diesel::Expression` is not implemented for `i32`
    |
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 123 others
    = note: required because of the requirements on the impl of `diesel::Expression` for `&'insert i32`
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Text>` for `&'insert i32`
diff --git a/diesel_compile_tests/tests/fail/derive/bad_mysql_type.stderr b/diesel_compile_tests/tests/fail/derive/bad_mysql_type.stderr
index 2d402b57414b..575df6a81526 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_mysql_type.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_mysql_type.stderr
@@ -1,50 +1,47 @@
 error: unexpected end of input, expected parentheses
-
-  = help: The correct format looks like `#[diesel(mysql_type(name = "foo"))]`
-
- --> $DIR/bad_mysql_type.rs:6:9
+ --> tests/fail/derive/bad_mysql_type.rs:6:20
   |
 6 | #[diesel(mysql_type)]
-  |         ^^^^^^^^^^^^
+  |                    ^
+  |
+  = help: The correct format looks like `#[diesel(mysql_type(name = "foo"))]`
 
 error: expected attribute `name`
-
-  = help: The correct format looks like #[diesel(mysql_type(name = "foo"))]
-
-  --> $DIR/bad_mysql_type.rs:10:20
+  --> tests/fail/derive/bad_mysql_type.rs:10:21
    |
 10 | #[diesel(mysql_type())]
-   |                    ^^
+   |                     ^
+   |
+   = help: The correct format looks like #[diesel(mysql_type(name = "foo"))]
 
 error: expected parentheses
-  --> $DIR/bad_mysql_type.rs:14:21
+  --> tests/fail/derive/bad_mysql_type.rs:14:21
    |
 14 | #[diesel(mysql_type = "foo")]
    |                     ^
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(mysql_type(name = "foo"))]`
-
-  --> $DIR/bad_mysql_type.rs:18:20
+  --> tests/fail/derive/bad_mysql_type.rs:18:25
    |
 18 | #[diesel(mysql_type(name))]
-   |                    ^^^^^^
+   |                         ^
+   |
+   = help: The correct format looks like `#[diesel(mysql_type(name = "foo"))]`
 
 error: expected `=`
-  --> $DIR/bad_mysql_type.rs:22:25
+  --> tests/fail/derive/bad_mysql_type.rs:22:25
    |
 22 | #[diesel(mysql_type(name()))]
-   |                         ^^
+   |                         ^
 
 error: expected string literal
-  --> $DIR/bad_mysql_type.rs:26:28
+  --> tests/fail/derive/bad_mysql_type.rs:26:28
    |
 26 | #[diesel(mysql_type(name = Foo))]
    |                            ^^^
 
 error: unknown attribute, expected `name`
-  --> $DIR/bad_mysql_type.rs:30:21
+  --> tests/fail/derive/bad_mysql_type.rs:30:21
    |
 30 | #[diesel(mysql_type(what))]
    |                     ^^^^
diff --git a/diesel_compile_tests/tests/fail/derive/bad_postgres_type.stderr b/diesel_compile_tests/tests/fail/derive/bad_postgres_type.stderr
index 3cb776103762..7e52c61ceeaa 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_postgres_type.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_postgres_type.stderr
@@ -1,125 +1,115 @@
 error: unexpected end of input, expected parentheses
-
-  = help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
-
- --> $DIR/bad_postgres_type.rs:6:9
+ --> tests/fail/derive/bad_postgres_type.rs:6:23
   |
 6 | #[diesel(postgres_type)]
-  |         ^^^^^^^^^^^^^^^
+  |                       ^
+  |
+  = help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
 
 error: expected `oid` and `array_oid` attribute or `name` attribute
-
-  = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
-
-  --> $DIR/bad_postgres_type.rs:10:23
+  --> tests/fail/derive/bad_postgres_type.rs:10:24
    |
 10 | #[diesel(postgres_type())]
-   |                       ^^
+   |                        ^
+   |
+   = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
 
 error: expected parentheses
-  --> $DIR/bad_postgres_type.rs:14:24
+  --> tests/fail/derive/bad_postgres_type.rs:14:24
    |
 14 | #[diesel(postgres_type = "foo")]
    |                        ^
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
-
-  --> $DIR/bad_postgres_type.rs:18:23
+  --> tests/fail/derive/bad_postgres_type.rs:18:28
    |
 18 | #[diesel(postgres_type(name))]
-   |                       ^^^^^^
+   |                            ^
+   |
+   = help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
 
 error: expected `=`
-  --> $DIR/bad_postgres_type.rs:22:28
+  --> tests/fail/derive/bad_postgres_type.rs:22:28
    |
 22 | #[diesel(postgres_type(name()))]
-   |                            ^^
+   |                            ^
 
 error: expected string literal
-  --> $DIR/bad_postgres_type.rs:26:31
+  --> tests/fail/derive/bad_postgres_type.rs:26:31
    |
 26 | #[diesel(postgres_type(name = Foo))]
    |                               ^^^
 
 error: unexpected `oid` when `name` is present
-
-  = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
-
-  --> $DIR/bad_postgres_type.rs:30:38
+  --> tests/fail/derive/bad_postgres_type.rs:30:38
    |
 30 | #[diesel(postgres_type(name = "foo", oid = 2, array_oid = 3))]
    |                                      ^^^
+   |
+   = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
 
 error: unexpected `array_oid` when `name` is present
-
-  = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
-
-  --> $DIR/bad_postgres_type.rs:34:38
+  --> tests/fail/derive/bad_postgres_type.rs:34:38
    |
 34 | #[diesel(postgres_type(name = "foo", array_oid = 3))]
    |                                      ^^^^^^^^^
+   |
+   = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
 
 error: expected `oid` and `array_oid` attribute or `name` attribute
-
-  = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
-
-  --> $DIR/bad_postgres_type.rs:38:23
+  --> tests/fail/derive/bad_postgres_type.rs:38:31
    |
 38 | #[diesel(postgres_type(oid = 2))]
-   |                       ^^^^^^^^^
+   |                               ^
+   |
+   = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
 
 error: expected integer literal
-  --> $DIR/bad_postgres_type.rs:42:45
+  --> tests/fail/derive/bad_postgres_type.rs:42:45
    |
 42 | #[diesel(postgres_type(oid = 1, array_oid = "1"))]
    |                                             ^^^
 
 error: expected integer literal
-  --> $DIR/bad_postgres_type.rs:46:30
+  --> tests/fail/derive/bad_postgres_type.rs:46:30
    |
 46 | #[diesel(postgres_type(oid = "1", array_oid = 1))]
    |                              ^^^
 
 error: expected `name` to be also present
-
-  = help: make sure `name` is present, `#[diesel(postgres_type(name = "...", schema = "foo"))]`
-
-  --> $DIR/bad_postgres_type.rs:50:24
+  --> tests/fail/derive/bad_postgres_type.rs:50:24
    |
 50 | #[diesel(postgres_type(schema = "foo"))]
    |                        ^^^^^^
+   |
+   = help: make sure `name` is present, `#[diesel(postgres_type(name = "...", schema = "foo"))]`
 
 error: unknown attribute, expected one of `oid`, `array_oid`, `name`, `schema`
-  --> $DIR/bad_postgres_type.rs:54:24
+  --> tests/fail/derive/bad_postgres_type.rs:54:24
    |
 54 | #[diesel(postgres_type(what))]
    |                        ^^^^
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
-
-  --> $DIR/bad_postgres_type.rs:58:23
+  --> tests/fail/derive/bad_postgres_type.rs:58:30
    |
 58 | #[diesel(postgres_type(schema))]
-   |                       ^^^^^^^^
+   |                              ^
+   |
+   = help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
-
-  --> $DIR/bad_postgres_type.rs:62:23
+  --> tests/fail/derive/bad_postgres_type.rs:62:27
    |
 62 | #[diesel(postgres_type(oid))]
-   |                       ^^^^^
+   |                           ^
+   |
+   = help: The correct format looks like `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
-
-  --> $DIR/bad_postgres_type.rs:66:23
+  --> tests/fail/derive/bad_postgres_type.rs:66:33
    |
 66 | #[diesel(postgres_type(array_oid))]
-   |                       ^^^^^^^^^^^
+   |                                 ^
+   |
+   = help: The correct format looks like `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
diff --git a/diesel_compile_tests/tests/fail/derive/bad_primary_key.stderr b/diesel_compile_tests/tests/fail/derive/bad_primary_key.stderr
index a0d0da4cc91d..165c191c9360 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_primary_key.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_primary_key.stderr
@@ -1,23 +1,23 @@
 error: expected `,`
-  --> $DIR/bad_primary_key.rs:12:30
+  --> tests/fail/derive/bad_primary_key.rs:12:30
    |
 12 | #[diesel(primary_key(id, bar = "baz"))]
    |                              ^
 
 error: expected `,`
-  --> $DIR/bad_primary_key.rs:19:29
+  --> tests/fail/derive/bad_primary_key.rs:19:29
    |
 19 | #[diesel(primary_key(id, qux(id)))]
-   |                             ^^^^
+   |                             ^
 
 error: unexpected end of input, expected parentheses
-  --> $DIR/bad_primary_key.rs:26:9
+  --> tests/fail/derive/bad_primary_key.rs:26:21
    |
 26 | #[diesel(primary_key)]
-   |         ^^^^^^^^^^^^^
+   |                     ^
 
 error: expected parentheses
-  --> $DIR/bad_primary_key.rs:33:22
+  --> tests/fail/derive/bad_primary_key.rs:33:22
    |
 33 | #[diesel(primary_key = id)]
    |                      ^
diff --git a/diesel_compile_tests/tests/fail/derive/bad_serialize_as.stderr b/diesel_compile_tests/tests/fail/derive/bad_serialize_as.stderr
index c7b9d5ca3ee2..8bc2d02809f4 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_serialize_as.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_serialize_as.stderr
@@ -1,26 +1,25 @@
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(serialize_as = Foo)]`
-
-  --> $DIR/bad_serialize_as.rs:15:13
+  --> tests/fail/derive/bad_serialize_as.rs:15:26
    |
 15 |     #[diesel(serialize_as)]
-   |             ^^^^^^^^^^^^^^
+   |                          ^
+   |
+   = help: The correct format looks like `#[diesel(serialize_as = Foo)]`
 
 error: expected `=`
-  --> $DIR/bad_serialize_as.rs:23:26
+  --> tests/fail/derive/bad_serialize_as.rs:23:26
    |
 23 |     #[diesel(serialize_as(Foo))]
-   |                          ^^^^^
+   |                          ^
 
 error: expected identifier
-  --> $DIR/bad_serialize_as.rs:31:29
+  --> tests/fail/derive/bad_serialize_as.rs:31:29
    |
 31 |     #[diesel(serialize_as = "foo")]
    |                             ^^^^^
 
 error: expected identifier
-  --> $DIR/bad_serialize_as.rs:39:29
+  --> tests/fail/derive/bad_serialize_as.rs:39:29
    |
 39 |     #[diesel(serialize_as = 1omg)]
    |                             ^^^^
diff --git a/diesel_compile_tests/tests/fail/derive/bad_sql_type.stderr b/diesel_compile_tests/tests/fail/derive/bad_sql_type.stderr
index b38c7f8c1644..8bbfbf08b852 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_sql_type.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_sql_type.stderr
@@ -1,26 +1,25 @@
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(sql_type = Foo)]`
-
- --> $DIR/bad_sql_type.rs:5:9
+ --> tests/fail/derive/bad_sql_type.rs:5:18
   |
 5 | #[diesel(sql_type)]
-  |         ^^^^^^^^^^
+  |                  ^
+  |
+  = help: The correct format looks like `#[diesel(sql_type = Foo)]`
 
 error: expected `=`
- --> $DIR/bad_sql_type.rs:9:18
+ --> tests/fail/derive/bad_sql_type.rs:9:18
   |
 9 | #[diesel(sql_type(Foo))]
-  |                  ^^^^^
+  |                  ^
 
 error: expected identifier
-  --> $DIR/bad_sql_type.rs:13:21
+  --> tests/fail/derive/bad_sql_type.rs:13:21
    |
 13 | #[diesel(sql_type = "foo")]
    |                     ^^^^^
 
 error: expected identifier
-  --> $DIR/bad_sql_type.rs:17:21
+  --> tests/fail/derive/bad_sql_type.rs:17:21
    |
 17 | #[diesel(sql_type = 1omg)]
    |                     ^^^^
diff --git a/diesel_compile_tests/tests/fail/derive/bad_sqlite_type.stderr b/diesel_compile_tests/tests/fail/derive/bad_sqlite_type.stderr
index bc71788283ad..6bf4959ce57a 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_sqlite_type.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_sqlite_type.stderr
@@ -1,50 +1,47 @@
 error: unexpected end of input, expected parentheses
-
-  = help: The correct format looks like `#[diesel(sqlite_type(name = "foo"))]`
-
- --> $DIR/bad_sqlite_type.rs:6:9
+ --> tests/fail/derive/bad_sqlite_type.rs:6:21
   |
 6 | #[diesel(sqlite_type)]
-  |         ^^^^^^^^^^^^^
+  |                     ^
+  |
+  = help: The correct format looks like `#[diesel(sqlite_type(name = "foo"))]`
 
 error: expected attribute `name`
-
-  = help: The correct format looks like #[diesel(sqlite_type(name = "foo"))]
-
-  --> $DIR/bad_sqlite_type.rs:10:21
+  --> tests/fail/derive/bad_sqlite_type.rs:10:22
    |
 10 | #[diesel(sqlite_type())]
-   |                     ^^
+   |                      ^
+   |
+   = help: The correct format looks like #[diesel(sqlite_type(name = "foo"))]
 
 error: expected parentheses
-  --> $DIR/bad_sqlite_type.rs:14:22
+  --> tests/fail/derive/bad_sqlite_type.rs:14:22
    |
 14 | #[diesel(sqlite_type = "foo")]
    |                      ^
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(sqlite_type(name = "foo"))]`
-
-  --> $DIR/bad_sqlite_type.rs:18:21
+  --> tests/fail/derive/bad_sqlite_type.rs:18:26
    |
 18 | #[diesel(sqlite_type(name))]
-   |                     ^^^^^^
+   |                          ^
+   |
+   = help: The correct format looks like `#[diesel(sqlite_type(name = "foo"))]`
 
 error: expected `=`
-  --> $DIR/bad_sqlite_type.rs:22:26
+  --> tests/fail/derive/bad_sqlite_type.rs:22:26
    |
 22 | #[diesel(sqlite_type(name()))]
-   |                          ^^
+   |                          ^
 
 error: expected string literal
-  --> $DIR/bad_sqlite_type.rs:26:29
+  --> tests/fail/derive/bad_sqlite_type.rs:26:29
    |
 26 | #[diesel(sqlite_type(name = Foo))]
    |                             ^^^
 
 error: unknown attribute, expected `name`
-  --> $DIR/bad_sqlite_type.rs:30:22
+  --> tests/fail/derive/bad_sqlite_type.rs:30:22
    |
 30 | #[diesel(sqlite_type(what))]
    |                      ^^^^
diff --git a/diesel_compile_tests/tests/fail/derive/bad_table_name.stderr b/diesel_compile_tests/tests/fail/derive/bad_table_name.stderr
index 808c67e9b5dd..96092f80dd77 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_table_name.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_table_name.stderr
@@ -1,32 +1,31 @@
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(table_name = foo)]`
-
-  --> $DIR/bad_table_name.rs:12:9
+  --> tests/fail/derive/bad_table_name.rs:12:20
    |
 12 | #[diesel(table_name)]
-   |         ^^^^^^^^^^^^
+   |                    ^
+   |
+   = help: The correct format looks like `#[diesel(table_name = foo)]`
 
 error: expected `=`
-  --> $DIR/bad_table_name.rs:18:20
+  --> tests/fail/derive/bad_table_name.rs:18:20
    |
 18 | #[diesel(table_name(users))]
-   |                    ^^^^^^^
+   |                    ^
 
 error: expected identifier
-  --> $DIR/bad_table_name.rs:24:23
+  --> tests/fail/derive/bad_table_name.rs:24:23
    |
 24 | #[diesel(table_name = true)]
    |                       ^^^^
 
 error: expected identifier
-  --> $DIR/bad_table_name.rs:30:23
+  --> tests/fail/derive/bad_table_name.rs:30:23
    |
 30 | #[diesel(table_name = "not a path")]
    |                       ^^^^^^^^^^^^
 
 error[E0433]: failed to resolve: use of undeclared crate or module `does`
-  --> $DIR/bad_table_name.rs:36:23
+  --> tests/fail/derive/bad_table_name.rs:36:23
    |
 36 | #[diesel(table_name = does::not::exist)]
    |                       ^^^^ use of undeclared crate or module `does`
diff --git a/diesel_compile_tests/tests/fail/derive/bad_treat_none_as_default_value.stderr b/diesel_compile_tests/tests/fail/derive/bad_treat_none_as_default_value.stderr
index 5f6f189e7356..1553c222a3c0 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_treat_none_as_default_value.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_treat_none_as_default_value.stderr
@@ -1,20 +1,19 @@
 error: expected `=`
-  --> $DIR/bad_treat_none_as_default_value.rs:13:37
+  --> tests/fail/derive/bad_treat_none_as_default_value.rs:13:37
    |
 13 | #[diesel(treat_none_as_default_value())]
-   |                                     ^^
+   |                                     ^
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(treat_none_as_default_value = true)]`
-
-  --> $DIR/bad_treat_none_as_default_value.rs:21:9
+  --> tests/fail/derive/bad_treat_none_as_default_value.rs:21:37
    |
 21 | #[diesel(treat_none_as_default_value)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                                     ^
+   |
+   = help: The correct format looks like `#[diesel(treat_none_as_default_value = true)]`
 
 error: expected boolean literal
-  --> $DIR/bad_treat_none_as_default_value.rs:29:40
+  --> tests/fail/derive/bad_treat_none_as_default_value.rs:29:40
    |
 29 | #[diesel(treat_none_as_default_value = "foo")]
    |                                        ^^^^^
diff --git a/diesel_compile_tests/tests/fail/derive/bad_treat_none_as_null.stderr b/diesel_compile_tests/tests/fail/derive/bad_treat_none_as_null.stderr
index 6cf3e6a408c7..a5512d469cdc 100644
--- a/diesel_compile_tests/tests/fail/derive/bad_treat_none_as_null.stderr
+++ b/diesel_compile_tests/tests/fail/derive/bad_treat_none_as_null.stderr
@@ -1,20 +1,19 @@
 error: expected `=`
-  --> $DIR/bad_treat_none_as_null.rs:13:28
+  --> tests/fail/derive/bad_treat_none_as_null.rs:13:28
    |
 13 | #[diesel(treat_none_as_null("true"))]
-   |                            ^^^^^^^^
+   |                            ^
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(treat_none_as_null = true)]`
-
-  --> $DIR/bad_treat_none_as_null.rs:21:9
+  --> tests/fail/derive/bad_treat_none_as_null.rs:21:28
    |
 21 | #[diesel(treat_none_as_null)]
-   |         ^^^^^^^^^^^^^^^^^^^^
+   |                            ^
+   |
+   = help: The correct format looks like `#[diesel(treat_none_as_null = true)]`
 
 error: expected boolean literal
-  --> $DIR/bad_treat_none_as_null.rs:29:31
+  --> tests/fail/derive/bad_treat_none_as_null.rs:29:31
    |
 29 | #[diesel(treat_none_as_null = "foo")]
    |                               ^^^^^
diff --git a/diesel_compile_tests/tests/fail/derive/belongs_to_incorrect_lifetime_syntax.stderr b/diesel_compile_tests/tests/fail/derive/belongs_to_incorrect_lifetime_syntax.stderr
index 7c69b1295790..c0c0796ee853 100644
--- a/diesel_compile_tests/tests/fail/derive/belongs_to_incorrect_lifetime_syntax.stderr
+++ b/diesel_compile_tests/tests/fail/derive/belongs_to_incorrect_lifetime_syntax.stderr
@@ -2,6 +2,20 @@ error[E0261]: use of undeclared lifetime name `'a`
   --> tests/fail/derive/belongs_to_incorrect_lifetime_syntax.rs:25:25
    |
 24 | #[derive(Associations)]
-   |          - lifetime `'a` is missing in item created through this procedural macro
+   |          ------------ lifetime `'a` is missing in item created through this procedural macro
 25 | #[diesel(belongs_to(Foo<'a>))]
    |                         ^^ undeclared lifetime
+
+error[E0261]: use of undeclared lifetime name `'a`
+  --> tests/fail/derive/belongs_to_incorrect_lifetime_syntax.rs:25:25
+   |
+24 | #[derive(Associations)]
+   |          ------------ lifetime `'a` is missing in item created through this procedural macro
+25 | #[diesel(belongs_to(Foo<'a>))]
+   |                         ^^ undeclared lifetime
+   |
+   = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
+help: consider making the bound lifetime-generic with a new `'a` lifetime
+   |
+24 | #[derive(for<'a> Associations)]
+   |          +++++++
diff --git a/diesel_compile_tests/tests/fail/derive/queryable_by_name_requires_table_name_or_sql_type_annotation.stderr b/diesel_compile_tests/tests/fail/derive/queryable_by_name_requires_table_name_or_sql_type_annotation.stderr
index 295672ff0e18..3a4054826ea3 100644
--- a/diesel_compile_tests/tests/fail/derive/queryable_by_name_requires_table_name_or_sql_type_annotation.stderr
+++ b/diesel_compile_tests/tests/fail/derive/queryable_by_name_requires_table_name_or_sql_type_annotation.stderr
@@ -1,17 +1,15 @@
 error: Cannot determine the SQL type of foo
-
-  = help: Your struct must either be annotated with `#[diesel(table_name = foo)]` or have this field annotated with `#[diesel(sql_type = ...)]`
-
- --> $DIR/queryable_by_name_requires_table_name_or_sql_type_annotation.rs:6:5
+ --> tests/fail/derive/queryable_by_name_requires_table_name_or_sql_type_annotation.rs:6:5
   |
 6 |     foo: i32,
   |     ^^^
-
-error: Cannot determine the SQL type of field
-
+  |
   = help: Your struct must either be annotated with `#[diesel(table_name = foo)]` or have this field annotated with `#[diesel(sql_type = ...)]`
 
-  --> $DIR/queryable_by_name_requires_table_name_or_sql_type_annotation.rs:11:12
+error: Cannot determine the SQL type of field
+  --> tests/fail/derive/queryable_by_name_requires_table_name_or_sql_type_annotation.rs:11:12
    |
 11 | struct Bar(i32, String);
    |            ^^^
+   |
+   = help: Your struct must either be annotated with `#[diesel(table_name = foo)]` or have this field annotated with `#[diesel(sql_type = ...)]`
diff --git a/diesel_compile_tests/tests/fail/derive/queryable_type_missmatch.stderr b/diesel_compile_tests/tests/fail/derive/queryable_type_missmatch.stderr
index 4d9c09885e04..eb5cd87f9461 100644
--- a/diesel_compile_tests/tests/fail/derive/queryable_type_missmatch.stderr
+++ b/diesel_compile_tests/tests/fail/derive/queryable_type_missmatch.stderr
@@ -1,39 +1,91 @@
 error[E0277]: the trait bound `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>): load_dsl::private::CompatibleType<UserWithToFewFields, _>` is not satisfied
-  --> tests/fail/derive/queryable_type_missmatch.rs:59:26
-   |
-59 |     let _ = users::table.load::<UserWithToFewFields>(conn);
-   |                          ^^^^ the trait `load_dsl::private::CompatibleType<UserWithToFewFields, _>` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
-   |
-   = help: the following implementations were found:
-             <(ST0, ST1, ST2) as load_dsl::private::CompatibleType<__T, __DB>>
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithToFewFields>` for `users::table`
+    --> tests/fail/derive/queryable_type_missmatch.rs:59:26
+     |
+59   |     let _ = users::table.load::<UserWithToFewFields>(conn);
+     |                          ^^^^ the trait `load_dsl::private::CompatibleType<UserWithToFewFields, _>` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
+     |
+     = help: the following other types implement trait `load_dsl::private::CompatibleType<U, DB>`:
+               (ST0, ST1)
+               (ST0, ST1, ST2)
+               (ST0, ST1, ST2, ST3)
+               (ST0, ST1, ST2, ST3, ST4)
+               (ST0, ST1, ST2, ST3, ST4, ST5)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8)
+             and 8 others
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithToFewFields>` for `users::table`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>): load_dsl::private::CompatibleType<UserWithToManyFields, _>` is not satisfied
-  --> tests/fail/derive/queryable_type_missmatch.rs:61:26
-   |
-61 |     let _ = users::table.load::<UserWithToManyFields>(conn);
-   |                          ^^^^ the trait `load_dsl::private::CompatibleType<UserWithToManyFields, _>` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
-   |
-   = help: the following implementations were found:
-             <(ST0, ST1, ST2) as load_dsl::private::CompatibleType<__T, __DB>>
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithToManyFields>` for `users::table`
+    --> tests/fail/derive/queryable_type_missmatch.rs:61:26
+     |
+61   |     let _ = users::table.load::<UserWithToManyFields>(conn);
+     |                          ^^^^ the trait `load_dsl::private::CompatibleType<UserWithToManyFields, _>` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
+     |
+     = help: the following other types implement trait `load_dsl::private::CompatibleType<U, DB>`:
+               (ST0, ST1)
+               (ST0, ST1, ST2)
+               (ST0, ST1, ST2, ST3)
+               (ST0, ST1, ST2, ST3, ST4)
+               (ST0, ST1, ST2, ST3, ST4, ST5)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8)
+             and 8 others
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithToManyFields>` for `users::table`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>): load_dsl::private::CompatibleType<UserWrongOrder, _>` is not satisfied
-  --> tests/fail/derive/queryable_type_missmatch.rs:63:26
-   |
-63 |     let _ = users::table.load::<UserWrongOrder>(conn);
-   |                          ^^^^ the trait `load_dsl::private::CompatibleType<UserWrongOrder, _>` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
-   |
-   = help: the following implementations were found:
-             <(ST0, ST1, ST2) as load_dsl::private::CompatibleType<__T, __DB>>
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWrongOrder>` for `users::table`
+    --> tests/fail/derive/queryable_type_missmatch.rs:63:26
+     |
+63   |     let _ = users::table.load::<UserWrongOrder>(conn);
+     |                          ^^^^ the trait `load_dsl::private::CompatibleType<UserWrongOrder, _>` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
+     |
+     = help: the following other types implement trait `load_dsl::private::CompatibleType<U, DB>`:
+               (ST0, ST1)
+               (ST0, ST1, ST2)
+               (ST0, ST1, ST2, ST3)
+               (ST0, ST1, ST2, ST3, ST4)
+               (ST0, ST1, ST2, ST3, ST4, ST5)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8)
+             and 8 others
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWrongOrder>` for `users::table`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>): load_dsl::private::CompatibleType<UserTypeMissmatch, _>` is not satisfied
-  --> tests/fail/derive/queryable_type_missmatch.rs:65:26
-   |
-65 |     let _ = users::table.load::<UserTypeMissmatch>(conn);
-   |                          ^^^^ the trait `load_dsl::private::CompatibleType<UserTypeMissmatch, _>` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
-   |
-   = help: the following implementations were found:
-             <(ST0, ST1, ST2) as load_dsl::private::CompatibleType<__T, __DB>>
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserTypeMissmatch>` for `users::table`
+    --> tests/fail/derive/queryable_type_missmatch.rs:65:26
+     |
+65   |     let _ = users::table.load::<UserTypeMissmatch>(conn);
+     |                          ^^^^ the trait `load_dsl::private::CompatibleType<UserTypeMissmatch, _>` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
+     |
+     = help: the following other types implement trait `load_dsl::private::CompatibleType<U, DB>`:
+               (ST0, ST1)
+               (ST0, ST1, ST2)
+               (ST0, ST1, ST2, ST3)
+               (ST0, ST1, ST2, ST3, ST4)
+               (ST0, ST1, ST2, ST3, ST4, ST5)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8)
+             and 8 others
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserTypeMissmatch>` for `users::table`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
diff --git a/diesel_compile_tests/tests/fail/derive/selectable.rs b/diesel_compile_tests/tests/fail/derive/selectable.rs
new file mode 100644
index 000000000000..5edee02f5912
--- /dev/null
+++ b/diesel_compile_tests/tests/fail/derive/selectable.rs
@@ -0,0 +1,44 @@
+extern crate diesel;
+use diesel::prelude::*;
+
+diesel::table! {
+    users(id) {
+        id -> Integer,
+        name -> Nullable<Text>,
+    }
+}
+
+#[derive(Selectable)]
+#[diesel(table_name = users)]
+struct User {
+    id: i32,
+    name: Option<String>,
+    #[diesel(
+        select_expression = users::name.is_null(),
+        select_expression_type = diesel::dsl::IsNull<users::name>
+    )]
+    name_is_null: bool,
+    #[diesel(
+        select_expression = (users::name, users::id),
+        select_expression_type = (users::name, users::id)
+    )]
+    name_and_id: (Option<String>, i32),
+    non_existing: String,
+    #[diesel(
+        select_expression = users::non_existing,
+        select_expression_type = users::non_existing
+    )]
+    non_existing_with_annotation: String,
+    #[diesel(
+        select_expression = (users::id, users::non_existing),
+        select_expression_type = (users::id, users::non_existing)
+    )]
+    non_existing_in_tuple: (i32, String),
+    #[diesel(
+        select_expression = (users::id + 45),
+        select_expression_type = users::id,
+    )]
+    no_tuple: i32,
+}
+
+fn main() {}
diff --git a/diesel_compile_tests/tests/fail/derive/selectable.stderr b/diesel_compile_tests/tests/fail/derive/selectable.stderr
new file mode 100644
index 000000000000..4121fe12a6d3
--- /dev/null
+++ b/diesel_compile_tests/tests/fail/derive/selectable.stderr
@@ -0,0 +1,44 @@
+error[E0412]: cannot find type `non_existing` in module `users`
+  --> tests/fail/derive/selectable.rs:26:5
+   |
+26 |     non_existing: String,
+   |     ^^^^^^^^^^^^ not found in `users`
+
+error[E0412]: cannot find type `non_existing` in module `users`
+  --> tests/fail/derive/selectable.rs:29:41
+   |
+29 |         select_expression_type = users::non_existing
+   |                                         ^^^^^^^^^^^^ not found in `users`
+
+error[E0412]: cannot find type `non_existing` in module `users`
+  --> tests/fail/derive/selectable.rs:34:53
+   |
+34 |         select_expression_type = (users::id, users::non_existing)
+   |                                                     ^^^^^^^^^^^^ not found in `users`
+
+error[E0425]: cannot find value `non_existing` in module `users`
+  --> tests/fail/derive/selectable.rs:26:5
+   |
+26 |     non_existing: String,
+   |     ^^^^^^^^^^^^ not found in `users`
+
+error[E0425]: cannot find value `non_existing` in module `users`
+  --> tests/fail/derive/selectable.rs:28:36
+   |
+28 |         select_expression = users::non_existing,
+   |                                    ^^^^^^^^^^^^ not found in `users`
+
+error[E0425]: cannot find value `non_existing` in module `users`
+  --> tests/fail/derive/selectable.rs:33:48
+   |
+33 |         select_expression = (users::id, users::non_existing),
+   |                                                ^^^^^^^^^^^^ not found in `users`
+
+error[E0308]: mismatched types
+  --> tests/fail/derive/selectable.rs:38:29
+   |
+38 |         select_expression = (users::id + 45),
+   |                             ^^^^^^^^^^^^^^^^ expected struct `columns::id`, found struct `diesel::expression::ops::numeric::Add`
+   |
+   = note: expected struct `columns::id`
+              found struct `diesel::expression::ops::numeric::Add<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>`
diff --git a/diesel_compile_tests/tests/fail/derive/unknown_attribute.stderr b/diesel_compile_tests/tests/fail/derive/unknown_attribute.stderr
index a716ac63cbc6..7dd0305d20f6 100644
--- a/diesel_compile_tests/tests/fail/derive/unknown_attribute.stderr
+++ b/diesel_compile_tests/tests/fail/derive/unknown_attribute.stderr
@@ -4,7 +4,7 @@ error: unknown attribute, expected one of `aggregate`, `not_sized`, `foreign_der
 5 | #[diesel(what = true)]
   |          ^^^^
 
-error: unknown attribute, expected one of `embed`, `column_name`, `sql_type`, `serialize_as`, `deserialize_as`
+error: unknown attribute, expected one of `embed`, `column_name`, `sql_type`, `serialize_as`, `deserialize_as`, `select_expression`, `select_expression_type`
   --> $DIR/unknown_attribute.rs:12:14
    |
 12 |     #[diesel(what = true)]
diff --git a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_belongs_to.stderr b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_belongs_to.stderr
index 859ea14b37a6..d0effa8e23e1 100644
--- a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_belongs_to.stderr
+++ b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_belongs_to.stderr
@@ -1,11 +1,10 @@
 error: unexpected end of input, expected parentheses
-
-  = help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
-
   --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:29:3
    |
 29 | #[belongs_to]
    |   ^^^^^^^^^^
+   |
+   = help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
 
 error: expected parentheses
   --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:36:14
@@ -14,10 +13,10 @@ error: expected parentheses
    |              ^
 
 error: unexpected end of input, expected identifier
-  --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:43:13
+  --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:43:14
    |
 43 | #[belongs_to()]
-   |             ^^
+   |              ^
 
 error: expected identifier
   --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:50:14
@@ -26,19 +25,18 @@ error: expected identifier
    |              ^^^^^^
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
-
   --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:57:14
    |
 57 | #[belongs_to(parent)]
    |              ^^^^^^
+   |
+   = help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
 
 error: expected `=`
   --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:64:20
    |
 64 | #[belongs_to(parent())]
-   |                    ^^
+   |                    ^
 
 error: expected string literal
   --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:71:23
@@ -62,13 +60,12 @@ error: expected `foreign_key`
    |                   ^^^^
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
-
   --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:99:19
    |
 99 | #[belongs_to(Bar, foreign_key)]
    |                   ^^^^^^^^^^^
+   |
+   = help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
 
 error: expected string literal
    --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:106:33
@@ -85,19 +82,8 @@ error: expected identifier
 warning: #[belongs_to] attribute form is deprecated
   = help: use `#[diesel(belongs_to(Baz, foreign_key = bar_id))]` instead
 
-error: unexpected token: `Bar`
+error: unexpected expression: `Bar`
   --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:36:16
    |
 36 | #[belongs_to = Bar]
    |                ^^^
-
-error[E0423]: expected value, found struct `Bar`
-  --> tests/fail/derive_deprecated/deprecated_belongs_to.rs:36:16
-   |
-18 | / struct Bar {
-19 | |     id: i32,
-20 | | }
-   | |_- `Bar` defined here
-...
-36 |   #[belongs_to = Bar]
-   |                  ^^^ help: use struct literal syntax instead: `Bar { id: val }`
diff --git a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_changeset_options.stderr b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_changeset_options.stderr
index 1cbfcd01c3ad..7141c85f929d 100644
--- a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_changeset_options.stderr
+++ b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_changeset_options.stderr
@@ -2,34 +2,33 @@ warning: #[changeset_options] attribute form is deprecated
   = help: use `#[diesel(treat_none_as_null = true)]` instead
 
 error: unexpected end of input, expected parentheses
-  --> $DIR/deprecated_changeset_options.rs:21:3
+  --> tests/fail/derive_deprecated/deprecated_changeset_options.rs:21:3
    |
 21 | #[changeset_options]
    |   ^^^^^^^^^^^^^^^^^
 
 error: unexpected end of input, expected identifier
-  --> $DIR/deprecated_changeset_options.rs:29:20
+  --> tests/fail/derive_deprecated/deprecated_changeset_options.rs:29:21
    |
 29 | #[changeset_options()]
-   |                    ^^
+   |                     ^
 
 error: expected `treat_none_as_null`
-  --> $DIR/deprecated_changeset_options.rs:37:21
+  --> tests/fail/derive_deprecated/deprecated_changeset_options.rs:37:21
    |
 37 | #[changeset_options(what)]
    |                     ^^^^
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(treat_none_as_null = true)]`
-
-  --> $DIR/deprecated_changeset_options.rs:45:21
+  --> tests/fail/derive_deprecated/deprecated_changeset_options.rs:45:21
    |
 45 | #[changeset_options(treat_none_as_null)]
    |                     ^^^^^^^^^^^^^^^^^^
+   |
+   = help: The correct format looks like `#[diesel(treat_none_as_null = true)]`
 
 error: expected boolean literal
-  --> $DIR/deprecated_changeset_options.rs:53:42
+  --> tests/fail/derive_deprecated/deprecated_changeset_options.rs:53:42
    |
 53 | #[changeset_options(treat_none_as_null = "what")]
    |                                          ^^^^^^
diff --git a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_column_name.stderr b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_column_name.stderr
index b47f88c23442..5ab43a2b207e 100644
--- a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_column_name.stderr
+++ b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_column_name.stderr
@@ -5,22 +5,21 @@ warning: #[column_name] attribute form is deprecated
   = help: use `#[diesel(column_name = name)]` instead
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(column_name = foo)]`
-
-  --> $DIR/deprecated_column_name.rs:24:7
+  --> tests/fail/derive_deprecated/deprecated_column_name.rs:24:7
    |
 24 |     #[column_name]
    |       ^^^^^^^^^^^
+   |
+   = help: The correct format looks like `#[diesel(column_name = foo)]`
 
 error: expected `=`
-  --> $DIR/deprecated_column_name.rs:31:18
+  --> tests/fail/derive_deprecated/deprecated_column_name.rs:31:18
    |
 31 |     #[column_name()]
-   |                  ^^
+   |                  ^
 
 error: expected string literal
-  --> $DIR/deprecated_column_name.rs:38:21
+  --> tests/fail/derive_deprecated/deprecated_column_name.rs:38:21
    |
 38 |     #[column_name = 1]
    |                     ^
@@ -29,31 +28,31 @@ warning: #[column_name] attribute form is deprecated
   = help: use `#[diesel(column_name = 1)]` instead
 
 error: expected string literal
-  --> $DIR/deprecated_column_name.rs:45:21
+  --> tests/fail/derive_deprecated/deprecated_column_name.rs:45:21
    |
 45 |     #[column_name = "1"]
    |                     ^^^
 
 error[E0412]: cannot find type `name` in module `users`
-  --> $DIR/deprecated_column_name.rs:13:21
+  --> tests/fail/derive_deprecated/deprecated_column_name.rs:13:21
    |
 13 |     #[column_name = "name"]
    |                     ^^^^^^ not found in `users`
 
 error[E0425]: cannot find value `name` in module `users`
-  --> $DIR/deprecated_column_name.rs:13:21
+  --> tests/fail/derive_deprecated/deprecated_column_name.rs:13:21
    |
 13 |     #[column_name = "name"]
    |                     ^^^^^^ not found in `users`
 
 error[E0412]: cannot find type `name` in module `users`
-  --> $DIR/deprecated_column_name.rs:19:34
+  --> tests/fail/derive_deprecated/deprecated_column_name.rs:19:34
    |
 19 | struct UserTuple(#[column_name = "name"] String);
    |                                  ^^^^^^ not found in `users`
 
 error[E0425]: cannot find value `name` in module `users`
-  --> $DIR/deprecated_column_name.rs:19:34
+  --> tests/fail/derive_deprecated/deprecated_column_name.rs:19:34
    |
 19 | struct UserTuple(#[column_name = "name"] String);
    |                                  ^^^^^^ not found in `users`
diff --git a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_mysql_type.stderr b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_mysql_type.stderr
index 31d80fc966ac..fa3065f6473d 100644
--- a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_mysql_type.stderr
+++ b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_mysql_type.stderr
@@ -1,17 +1,16 @@
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(mysql_type(name = "foo"))]`
-
  --> tests/fail/derive_deprecated/deprecated_mysql_type.rs:6:3
   |
 6 | #[mysql_type]
   |   ^^^^^^^^^^
+  |
+  = help: The correct format looks like `#[diesel(mysql_type(name = "foo"))]`
 
 error: expected `=`
   --> tests/fail/derive_deprecated/deprecated_mysql_type.rs:10:13
    |
 10 | #[mysql_type()]
-   |             ^^
+   |             ^
 
 error: expected string literal
   --> tests/fail/derive_deprecated/deprecated_mysql_type.rs:14:16
diff --git a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_postgres_type.stderr b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_postgres_type.stderr
index 8354a7ce7523..4db92502a26c 100644
--- a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_postgres_type.stderr
+++ b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_postgres_type.stderr
@@ -1,83 +1,77 @@
 error: unexpected end of input, expected parentheses
-
-  = help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
-
- --> $DIR/deprecated_postgres_type.rs:6:3
+ --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:6:3
   |
 6 | #[postgres]
   |   ^^^^^^^^
+  |
+  = help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
 
 error: expected `oid` and `array_oid` attribute or `name` attribute
-
-  = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
-
-  --> $DIR/deprecated_postgres_type.rs:10:11
+  --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:10:12
    |
 10 | #[postgres()]
-   |           ^^
+   |            ^
+   |
+   = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
 
 error: expected parentheses
-  --> $DIR/deprecated_postgres_type.rs:14:12
+  --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:14:12
    |
 14 | #[postgres = "foo"]
    |            ^
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
-
-  --> $DIR/deprecated_postgres_type.rs:18:12
+  --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:18:12
    |
 18 | #[postgres(type_name)]
    |            ^^^^^^^^^
+   |
+   = help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
 
 error: expected `=`
-  --> $DIR/deprecated_postgres_type.rs:22:21
+  --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:22:21
    |
 22 | #[postgres(type_name())]
-   |                     ^^
+   |                     ^
 
 error: expected string literal
-  --> $DIR/deprecated_postgres_type.rs:26:24
+  --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:26:24
    |
 26 | #[postgres(type_name = 1)]
    |                        ^
 
 error: unexpected `oid` when `name` is present
-
-  = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
-
-  --> $DIR/deprecated_postgres_type.rs:30:31
+  --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:30:31
    |
 30 | #[postgres(type_name = "foo", oid = "2", array_oid = "3")]
    |                               ^^^
+   |
+   = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
 
 error: unexpected `array_oid` when `name` is present
-
-  = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
-
-  --> $DIR/deprecated_postgres_type.rs:34:31
+  --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:34:31
    |
 34 | #[postgres(type_name = "foo", array_oid = "3")]
    |                               ^^^^^^^^^
+   |
+   = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
 
 error: expected `oid` and `array_oid` attribute or `name` attribute
-
-  = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
-
-  --> $DIR/deprecated_postgres_type.rs:38:11
+  --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:38:21
    |
 38 | #[postgres(oid = "2")]
-   |           ^^^^^^^^^^^
+   |                     ^
+   |
+   = help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
 
 error: expected string literal
-  --> $DIR/deprecated_postgres_type.rs:42:18
+  --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:42:18
    |
 42 | #[postgres(oid = 1, array_oid = "1")]
    |                  ^
 
 error: expected string literal
-  --> $DIR/deprecated_postgres_type.rs:46:35
+  --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:46:35
    |
 46 | #[postgres(oid = "1", array_oid = 1)]
    |                                   ^
@@ -86,7 +80,7 @@ warning: #[postgres] attribute form is deprecated
   = help: use `#[diesel(postgres_type(oid = 1, array_oid = 1))]` instead
 
 error: unknown attribute, expected one of `oid`, `array_oid`, `type_name`
-  --> $DIR/deprecated_postgres_type.rs:54:12
+  --> tests/fail/derive_deprecated/deprecated_postgres_type.rs:54:12
    |
 54 | #[postgres(what)]
    |            ^^^^
diff --git a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_primary_key.stderr b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_primary_key.stderr
index d0914abc2efe..830c6b6c0d45 100644
--- a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_primary_key.stderr
+++ b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_primary_key.stderr
@@ -8,7 +8,7 @@ error: expected `,`
   --> tests/fail/derive_deprecated/deprecated_primary_key.rs:19:22
    |
 19 | #[primary_key(id, qux(id))]
-   |                      ^^^^
+   |                      ^
 
 error: unexpected end of input, expected parentheses
   --> tests/fail/derive_deprecated/deprecated_primary_key.rs:26:3
@@ -26,32 +26,17 @@ warning: #[primary_key] attribute form is deprecated
   = help: use `#[diesel(primary_key(id, name))]` instead
 
 error: Deriving `AsChangeset` on a structure that only contains primary keys isn't supported.
-
-  = help: If you want to change the primary key of a row, you should do so with `.set(table::id.eq(new_id))`.
-  = note: `#[derive(AsChangeset)]` never changes the primary key of a row.
-
   --> tests/fail/derive_deprecated/deprecated_primary_key.rs:39:10
    |
 39 | #[derive(AsChangeset)]
    |          ^^^^^^^^^^^
    |
+   = help: If you want to change the primary key of a row, you should do so with `.set(table::id.eq(new_id))`.
+   = note: `#[derive(AsChangeset)]` never changes the primary key of a row.
    = note: this error originates in the derive macro `AsChangeset` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: unexpected token: `id`
+error: unexpected expression: `id`
   --> tests/fail/derive_deprecated/deprecated_primary_key.rs:33:17
    |
 33 | #[primary_key = id]
    |                 ^^
-
-error[E0425]: cannot find value `id` in this scope
-  --> tests/fail/derive_deprecated/deprecated_primary_key.rs:33:17
-   |
-33 | #[primary_key = id]
-   |                 ^^ not found in this scope
-   |
-help: consider importing one of these items
-   |
-12 | use crate::users::id;
-   |
-12 | use std::process::id;
-   |
diff --git a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sql_type.stderr b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sql_type.stderr
index d36c7730db34..8a5efa7b7af2 100644
--- a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sql_type.stderr
+++ b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sql_type.stderr
@@ -2,22 +2,21 @@ warning: #[sql_type] attribute form is deprecated
   = help: use `#[diesel(sql_type = foo)]` instead
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(sql_type = Foo)]`
-
-  --> $DIR/deprecated_sql_type.rs:10:3
+  --> tests/fail/derive_deprecated/deprecated_sql_type.rs:10:3
    |
 10 | #[sql_type]
    |   ^^^^^^^^
+   |
+   = help: The correct format looks like `#[diesel(sql_type = Foo)]`
 
 error: expected `=`
-  --> $DIR/deprecated_sql_type.rs:14:11
+  --> tests/fail/derive_deprecated/deprecated_sql_type.rs:14:11
    |
 14 | #[sql_type()]
-   |           ^^
+   |           ^
 
 error: expected string literal
-  --> $DIR/deprecated_sql_type.rs:18:14
+  --> tests/fail/derive_deprecated/deprecated_sql_type.rs:18:14
    |
 18 | #[sql_type = 1]
    |              ^
@@ -26,7 +25,7 @@ warning: #[sql_type] attribute form is deprecated
   = help: use `#[diesel(sql_type = 1)]` instead
 
 error: expected identifier
-  --> $DIR/deprecated_sql_type.rs:22:14
+  --> tests/fail/derive_deprecated/deprecated_sql_type.rs:22:14
    |
 22 | #[sql_type = "1"]
    |              ^^^
@@ -35,22 +34,21 @@ warning: #[sql_type] attribute form is deprecated
   = help: use `#[diesel(sql_type = foo)]` instead
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(sql_type = Foo)]`
-
-  --> $DIR/deprecated_sql_type.rs:33:7
+  --> tests/fail/derive_deprecated/deprecated_sql_type.rs:33:7
    |
 33 |     #[sql_type]
    |       ^^^^^^^^
+   |
+   = help: The correct format looks like `#[diesel(sql_type = Foo)]`
 
 error: expected `=`
-  --> $DIR/deprecated_sql_type.rs:39:15
+  --> tests/fail/derive_deprecated/deprecated_sql_type.rs:39:15
    |
 39 |     #[sql_type()]
-   |               ^^
+   |               ^
 
 error: expected string literal
-  --> $DIR/deprecated_sql_type.rs:45:18
+  --> tests/fail/derive_deprecated/deprecated_sql_type.rs:45:18
    |
 45 |     #[sql_type = 1]
    |                  ^
@@ -59,19 +57,27 @@ warning: #[sql_type] attribute form is deprecated
   = help: use `#[diesel(sql_type = 1)]` instead
 
 error: expected identifier
-  --> $DIR/deprecated_sql_type.rs:51:18
+  --> tests/fail/derive_deprecated/deprecated_sql_type.rs:51:18
    |
 51 |     #[sql_type = "1"]
    |                  ^^^
 
 error[E0412]: cannot find type `foo` in this scope
- --> $DIR/deprecated_sql_type.rs:6:14
+ --> tests/fail/derive_deprecated/deprecated_sql_type.rs:6:14
+  |
+6 | #[sql_type = "foo"]
+  |              ^^^^^ not found in this scope
+
+error[E0412]: cannot find type `foo` in this scope
+ --> tests/fail/derive_deprecated/deprecated_sql_type.rs:6:14
   |
+5 | #[derive(Debug, AsExpression)]
+  |                             - help: you might be missing a type parameter: `<foo>`
 6 | #[sql_type = "foo"]
   |              ^^^^^ not found in this scope
 
 error[E0412]: cannot find type `foo` in this scope
-  --> $DIR/deprecated_sql_type.rs:27:18
+  --> tests/fail/derive_deprecated/deprecated_sql_type.rs:27:18
    |
 27 |     #[sql_type = "foo"]
    |                  ^^^^^ not found in this scope
diff --git a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sqlite_type.stderr b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sqlite_type.stderr
index b03635abdf1a..95dd60005063 100644
--- a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sqlite_type.stderr
+++ b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sqlite_type.stderr
@@ -1,17 +1,16 @@
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(sqlite_type(name = "foo"))]`
-
  --> tests/fail/derive_deprecated/deprecated_sqlite_type.rs:6:3
   |
 6 | #[sqlite_type]
   |   ^^^^^^^^^^^
+  |
+  = help: The correct format looks like `#[diesel(sqlite_type(name = "foo"))]`
 
 error: expected `=`
   --> tests/fail/derive_deprecated/deprecated_sqlite_type.rs:10:14
    |
 10 | #[sqlite_type()]
-   |              ^^
+   |              ^
 
 error: expected string literal
   --> tests/fail/derive_deprecated/deprecated_sqlite_type.rs:14:17
diff --git a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_table_name.stderr b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_table_name.stderr
index 19cc96e90bd6..f0d908de4b40 100644
--- a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_table_name.stderr
+++ b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_table_name.stderr
@@ -2,22 +2,21 @@ warning: #[table_name] attribute form is deprecated
   = help: use `#[diesel(table_name = users)]` instead
 
 error: unexpected end of input, expected `=`
-
-  = help: The correct format looks like `#[diesel(table_name = foo)]`
-
-  --> $DIR/deprecated_table_name.rs:12:3
+  --> tests/fail/derive_deprecated/deprecated_table_name.rs:12:3
    |
 12 | #[table_name]
    |   ^^^^^^^^^^
+   |
+   = help: The correct format looks like `#[diesel(table_name = foo)]`
 
 error: expected `=`
-  --> $DIR/deprecated_table_name.rs:19:13
+  --> tests/fail/derive_deprecated/deprecated_table_name.rs:19:13
    |
 19 | #[table_name()]
-   |             ^^
+   |             ^
 
 error: expected string literal
-  --> $DIR/deprecated_table_name.rs:25:16
+  --> tests/fail/derive_deprecated/deprecated_table_name.rs:25:16
    |
 25 | #[table_name = 1]
    |                ^
@@ -26,13 +25,13 @@ warning: #[table_name] attribute form is deprecated
   = help: use `#[diesel(table_name = 1)]` instead
 
 error: expected identifier
-  --> $DIR/deprecated_table_name.rs:32:16
+  --> tests/fail/derive_deprecated/deprecated_table_name.rs:32:16
    |
 32 | #[table_name = "1"]
    |                ^^^
 
 error[E0433]: failed to resolve: use of undeclared crate or module `users`
- --> $DIR/deprecated_table_name.rs:5:16
+ --> tests/fail/derive_deprecated/deprecated_table_name.rs:5:16
   |
 5 | #[table_name = "users"]
   |                ^^^^^^^ use of undeclared crate or module `users`
diff --git a/diesel_compile_tests/tests/fail/distinct_on_allows_only_fields_of_table.stderr b/diesel_compile_tests/tests/fail/distinct_on_allows_only_fields_of_table.stderr
index 68ed441415a1..554c1772abc9 100644
--- a/diesel_compile_tests/tests/fail/distinct_on_allows_only_fields_of_table.stderr
+++ b/diesel_compile_tests/tests/fail/distinct_on_allows_only_fields_of_table.stderr
@@ -1,15 +1,17 @@
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/distinct_on_allows_only_fields_of_table.rs:23:30
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+  --> tests/fail/distinct_on_allows_only_fields_of_table.rs:23:18
    |
 23 |     users::table.distinct_on(posts::id).get_results(&mut connection);
-   |                              ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+   |                  ^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::id` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::id as SelectableExpression<Only<posts::table>>>
              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <posts::columns::id as SelectableExpression<posts::table>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
    = note: required because of the requirements on the impl of `DistinctOnDsl<posts::columns::id>` for `users::table`
 
 error[E0277]: the trait bound `(diesel::sql_types::Text, diesel::sql_types::Text): SingleValue` is not satisfied
@@ -18,20 +20,32 @@ error[E0277]: the trait bound `(diesel::sql_types::Text, diesel::sql_types::Text
 25 |     posts::table.distinct_on((posts::name, users::name)).get_result(&mut connection);
    |                  ^^^^^^^^^^^ the trait `SingleValue` is not implemented for `(diesel::sql_types::Text, diesel::sql_types::Text)`
    |
+   = help: the following other types implement trait `SingleValue`:
+             Array<ST>
+             BigInt
+             Bool
+             Cidr
+             Datetime
+             Inet
+             Interval
+             Json
+           and 22 others
    = note: required because of the requirements on the impl of `DistinctOnDsl<(posts::columns::name, users::columns::name)>` for `posts::table`
 
-error[E0277]: the trait bound `users::columns::name: SelectableExpression<posts::table>` is not satisfied
-  --> tests/fail/distinct_on_allows_only_fields_of_table.rs:25:30
+error[E0277]: Cannot select `users::columns::name` from `posts::table`
+  --> tests/fail/distinct_on_allows_only_fields_of_table.rs:25:18
    |
 25 |     posts::table.distinct_on((posts::name, users::name)).get_result(&mut connection);
-   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<posts::table>` is not implemented for `users::columns::name`
+   |                  ^^^^^^^^^^^ the trait `SelectableExpression<posts::table>` is not implemented for `users::columns::name`
    |
-   = help: the following implementations were found:
+   = note: `users::columns::name` is no valid selection for `posts::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <users::columns::name as SelectableExpression<JoinOn<Join, On>>>
              <users::columns::name as SelectableExpression<Only<users::table>>>
              <users::columns::name as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <users::columns::name as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <users::columns::name as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <users::columns::name as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+             <users::columns::name as SelectableExpression<users::table>>
    = note: required because of the requirements on the impl of `SelectableExpression<posts::table>` for `(posts::columns::name, users::columns::name)`
    = note: required because of the requirements on the impl of `DistinctOnDsl<(posts::columns::name, users::columns::name)>` for `posts::table`
 
@@ -51,11 +65,11 @@ note: required because of the requirements on the impl of `AppearsOnTable<posts:
 9  | |     }
 10 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<posts::table>` for `(posts::columns::name, users::columns::name)`
    = note: required because of the requirements on the impl of `SelectableExpression<posts::table>` for `(posts::columns::name, users::columns::name)`
    = note: required because of the requirements on the impl of `DistinctOnDsl<(posts::columns::name, users::columns::name)>` for `posts::table`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `posts::table: TableNotEqual<users::table>` is not satisfied
   --> tests/fail/distinct_on_allows_only_fields_of_table.rs:25:18
@@ -63,6 +77,13 @@ error[E0277]: the trait bound `posts::table: TableNotEqual<users::table>` is not
 25 |     posts::table.distinct_on((posts::name, users::name)).get_result(&mut connection);
    |                  ^^^^^^^^^^^ the trait `TableNotEqual<users::table>` is not implemented for `posts::table`
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<users::table>` for `posts::table`
 note: required because of the requirements on the impl of `AppearsOnTable<posts::table>` for `users::columns::name`
   --> tests/fail/distinct_on_allows_only_fields_of_table.rs:5:1
@@ -74,8 +95,8 @@ note: required because of the requirements on the impl of `AppearsOnTable<posts:
 9  | |     }
 10 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<posts::table>` for `(posts::columns::name, users::columns::name)`
    = note: required because of the requirements on the impl of `SelectableExpression<posts::table>` for `(posts::columns::name, users::columns::name)`
    = note: required because of the requirements on the impl of `DistinctOnDsl<(posts::columns::name, users::columns::name)>` for `posts::table`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/distinct_on_clause_only_supported_for_pg.stderr b/diesel_compile_tests/tests/fail/distinct_on_clause_only_supported_for_pg.stderr
index 603260428ed4..d3f015d97726 100644
--- a/diesel_compile_tests/tests/fail/distinct_on_clause_only_supported_for_pg.stderr
+++ b/diesel_compile_tests/tests/fail/distinct_on_clause_only_supported_for_pg.stderr
@@ -1,15 +1,33 @@
-error[E0271]: type mismatch resolving `<diesel::SqliteConnection as diesel::Connection>::Backend == Pg`
-  --> tests/fail/distinct_on_clause_only_supported_for_pg.rs:16:29
-   |
-16 |     users.distinct_on(name).get_results(&mut sqlite_connection);
-   |                             ^^^^^^^^^^^ expected struct `Sqlite`, found struct `Pg`
-   |
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::name>>`
+error[E0277]: the trait bound `DistinctOnClause<columns::name>: QueryFragment<Sqlite>` is not satisfied
+    --> tests/fail/distinct_on_clause_only_supported_for_pg.rs:16:29
+     |
+16   |     users.distinct_on(name).get_results(&mut sqlite_connection);
+     |                             ^^^^^^^^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `DistinctOnClause<columns::name>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `DistinctOnClause<T>`
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite, backend::sql_dialect::select_statement_syntax::AnsiSqlSelectStatement>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::name>>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::name>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::name>>`
+note: required by a bound in `get_results`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_results`
 
-error[E0271]: type mismatch resolving `<diesel::MysqlConnection as diesel::Connection>::Backend == Pg`
-  --> tests/fail/distinct_on_clause_only_supported_for_pg.rs:20:29
-   |
-20 |     users.distinct_on(name).get_results(&mut mysql_connection);
-   |                             ^^^^^^^^^^^ expected struct `Mysql`, found struct `Pg`
-   |
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::name>>`
+error[E0277]: the trait bound `DistinctOnClause<columns::name>: QueryFragment<Mysql>` is not satisfied
+    --> tests/fail/distinct_on_clause_only_supported_for_pg.rs:20:29
+     |
+20   |     users.distinct_on(name).get_results(&mut mysql_connection);
+     |                             ^^^^^^^^^^^ the trait `QueryFragment<Mysql>` is not implemented for `DistinctOnClause<columns::name>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `DistinctOnClause<T>`
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql, backend::sql_dialect::select_statement_syntax::AnsiSqlSelectStatement>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::name>>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::name>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::name>>`
+note: required by a bound in `get_results`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_results`
diff --git a/diesel_compile_tests/tests/fail/distinct_on_requires_matching_order_clause.stderr b/diesel_compile_tests/tests/fail/distinct_on_requires_matching_order_clause.stderr
index 94bcfb7b03b6..a32cce90c159 100644
--- a/diesel_compile_tests/tests/fail/distinct_on_requires_matching_order_clause.stderr
+++ b/diesel_compile_tests/tests/fail/distinct_on_requires_matching_order_clause.stderr
@@ -1,20 +1,44 @@
 error[E0308]: mismatched types
-  --> tests/fail/distinct_on_requires_matching_order_clause.rs:55:58
-   |
-55 |     let _ = users::table.order_by(users::id).distinct_on(users::name);
-   |                                                          ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+   --> tests/fail/distinct_on_requires_matching_order_clause.rs:55:58
+    |
+55  |     let _ = users::table.order_by(users::id).distinct_on(users::name);
+    |                                              ----------- ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+    |                                              |
+    |                                              arguments to this function are incorrect
+    |
+note: associated function defined here
+   --> $DIESEL/src/query_dsl/mod.rs
+    |
+    |     fn distinct_on<Expr>(self, expr: Expr) -> DistinctOn<Self, Expr>
+    |        ^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> tests/fail/distinct_on_requires_matching_order_clause.rs:59:73
-   |
-59 |     let _ = users::table.order_by((users::id, users::name)).distinct_on(users::name);
-   |                                                                         ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+   --> tests/fail/distinct_on_requires_matching_order_clause.rs:59:73
+    |
+59  |     let _ = users::table.order_by((users::id, users::name)).distinct_on(users::name);
+    |                                                             ----------- ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+    |                                                             |
+    |                                                             arguments to this function are incorrect
+    |
+note: associated function defined here
+   --> $DIESEL/src/query_dsl/mod.rs
+    |
+    |     fn distinct_on<Expr>(self, expr: Expr) -> DistinctOn<Self, Expr>
+    |        ^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> tests/fail/distinct_on_requires_matching_order_clause.rs:65:22
-   |
-65 |         .distinct_on(users::name);
-   |                      ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+   --> tests/fail/distinct_on_requires_matching_order_clause.rs:65:22
+    |
+65  |         .distinct_on(users::name);
+    |          ----------- ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+    |          |
+    |          arguments to this function are incorrect
+    |
+note: associated function defined here
+   --> $DIESEL/src/query_dsl/mod.rs
+    |
+    |     fn distinct_on<Expr>(self, expr: Expr) -> DistinctOn<Self, Expr>
+    |        ^^^^^^^^^^^
 
 error[E0277]: the trait bound `diesel::query_builder::order_clause::OrderClause<columns::id>: query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<columns::name>>` is not satisfied
   --> tests/fail/distinct_on_requires_matching_order_clause.rs:69:51
@@ -22,31 +46,59 @@ error[E0277]: the trait bound `diesel::query_builder::order_clause::OrderClause<
 69 |     let _ = users::table.distinct_on(users::name).order_by(users::id);
    |                                                   ^^^^^^^^ the trait `query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<columns::name>>` is not implemented for `diesel::query_builder::order_clause::OrderClause<columns::id>`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `query_dsl::order_dsl::ValidOrderingForDistinct<D>`:
              <diesel::query_builder::order_clause::OrderClause<(T,)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<T>>>
              <diesel::query_builder::order_clause::OrderClause<(__D, T0)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
              <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
              <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1, T2)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
-           and 18 others
+             <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1, T2, T3)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
+             <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1, T2, T3, T4)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
+             <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1, T2, T3, T4, T5)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
+             <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1, T2, T3, T4, T5, T6)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
+           and 14 others
    = note: required because of the requirements on the impl of `OrderDsl<columns::id>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::name>>`
 
 error[E0308]: mismatched types
-  --> tests/fail/distinct_on_requires_matching_order_clause.rs:72:58
-   |
-72 |     let _ = users::table.order_by(users::id).distinct_on(users::name).into_boxed();
-   |                                                          ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+   --> tests/fail/distinct_on_requires_matching_order_clause.rs:72:58
+    |
+72  |     let _ = users::table.order_by(users::id).distinct_on(users::name).into_boxed();
+    |                                              ----------- ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+    |                                              |
+    |                                              arguments to this function are incorrect
+    |
+note: associated function defined here
+   --> $DIESEL/src/query_dsl/mod.rs
+    |
+    |     fn distinct_on<Expr>(self, expr: Expr) -> DistinctOn<Self, Expr>
+    |        ^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> tests/fail/distinct_on_requires_matching_order_clause.rs:76:22
-   |
-76 |         .distinct_on(users::name)
-   |                      ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+   --> tests/fail/distinct_on_requires_matching_order_clause.rs:76:22
+    |
+76  |         .distinct_on(users::name)
+    |          ----------- ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+    |          |
+    |          arguments to this function are incorrect
+    |
+note: associated function defined here
+   --> $DIESEL/src/query_dsl/mod.rs
+    |
+    |     fn distinct_on<Expr>(self, expr: Expr) -> DistinctOn<Self, Expr>
+    |        ^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> tests/fail/distinct_on_requires_matching_order_clause.rs:83:22
-   |
-83 |         .distinct_on(users::name)
-   |                      ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+   --> tests/fail/distinct_on_requires_matching_order_clause.rs:83:22
+    |
+83  |         .distinct_on(users::name)
+    |          ----------- ^^^^^^^^^^^ expected struct `columns::id`, found struct `columns::name`
+    |          |
+    |          arguments to this function are incorrect
+    |
+note: associated function defined here
+   --> $DIESEL/src/query_dsl/mod.rs
+    |
+    |     fn distinct_on<Expr>(self, expr: Expr) -> DistinctOn<Self, Expr>
+    |        ^^^^^^^^^^^
 
 error[E0277]: the trait bound `diesel::query_builder::order_clause::OrderClause<columns::id>: query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<columns::name>>` is not satisfied
   --> tests/fail/distinct_on_requires_matching_order_clause.rs:90:10
@@ -54,10 +106,14 @@ error[E0277]: the trait bound `diesel::query_builder::order_clause::OrderClause<
 90 |         .order_by(users::id)
    |          ^^^^^^^^ the trait `query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<columns::name>>` is not implemented for `diesel::query_builder::order_clause::OrderClause<columns::id>`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `query_dsl::order_dsl::ValidOrderingForDistinct<D>`:
              <diesel::query_builder::order_clause::OrderClause<(T,)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<T>>>
              <diesel::query_builder::order_clause::OrderClause<(__D, T0)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
              <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
              <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1, T2)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
-           and 18 others
+             <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1, T2, T3)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
+             <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1, T2, T3, T4)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
+             <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1, T2, T3, T4, T5)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
+             <diesel::query_builder::order_clause::OrderClause<(__D, T0, T1, T2, T3, T4, T5, T6)> as query_dsl::order_dsl::ValidOrderingForDistinct<DistinctOnClause<__D>>>
+           and 14 others
    = note: required because of the requirements on the impl of `OrderDsl<columns::id>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::name>>`
diff --git a/diesel_compile_tests/tests/fail/ensure_sqlite_cannot_access_memory_of_droped_bind.stderr b/diesel_compile_tests/tests/fail/ensure_sqlite_cannot_access_memory_of_droped_bind.stderr
index 077cd8793b3e..eb2c10af7eeb 100644
--- a/diesel_compile_tests/tests/fail/ensure_sqlite_cannot_access_memory_of_droped_bind.stderr
+++ b/diesel_compile_tests/tests/fail/ensure_sqlite_cannot_access_memory_of_droped_bind.stderr
@@ -8,4 +8,4 @@ error[E0505]: cannot move out of `buf` because it is borrowed
    |                        ^^^ move out of `buf` occurs here
 18 |
 19 |         assert_eq!(iter.next().is_some(), true);
-   |                    ---- borrow later used here
+   |                    ----------- borrow later used here
diff --git a/diesel_compile_tests/tests/fail/exists_can_only_take_subselects.stderr b/diesel_compile_tests/tests/fail/exists_can_only_take_subselects.stderr
index 31953c5a661d..0f6c80255e9d 100644
--- a/diesel_compile_tests/tests/fail/exists_can_only_take_subselects.stderr
+++ b/diesel_compile_tests/tests/fail/exists_can_only_take_subselects.stderr
@@ -1,24 +1,27 @@
 error[E0277]: the trait bound `bool: SelectQuery` is not satisfied
-  --> tests/fail/exists_can_only_take_subselects.rs:23:25
+  --> tests/fail/exists_can_only_take_subselects.rs:23:18
    |
 23 |     users::table.filter(exists(true));
-   |                         ^^^^^^^^^^^^ the trait `SelectQuery` is not implemented for `bool`
+   |                  ^^^^^^ the trait `SelectQuery` is not implemented for `bool`
    |
+   = help: the following other types implement trait `SelectQuery`:
+             BoxedSelectStatement<'a, ST, QS, DB, GB>
+             SelectStatement<F, S, D, W, O, LOf, G, H, LC>
    = note: required because of the requirements on the impl of `diesel::Expression` for `diesel::expression::subselect::Subselect<bool, Bool>`
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `diesel::Expression` for `diesel::expression::exists::Exists<bool>`
    = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::exists::Exists<bool>>` for `SelectStatement<FromClause<users::table>>`
 
-error[E0277]: the trait bound `users::columns::id: diesel::Expression` is not satisfied
-  --> tests/fail/exists_can_only_take_subselects.rs:24:25
+error[E0277]: the trait bound `users::columns::id: SelectQuery` is not satisfied
+  --> tests/fail/exists_can_only_take_subselects.rs:24:18
    |
 24 |     users::table.filter(exists(users::id));
-   |                         ^^^^^^^^^^^^^^^^^
-   |                         |
-   |                         expected an implementor of trait `diesel::Expression`
-   |                         help: consider borrowing here: `&exists(users::id)`
+   |                  ^^^^^^ the trait `SelectQuery` is not implemented for `users::columns::id`
    |
+   = help: the following other types implement trait `SelectQuery`:
+             BoxedSelectStatement<'a, ST, QS, DB, GB>
+             SelectStatement<F, S, D, W, O, LOf, G, H, LC>
    = note: required because of the requirements on the impl of `diesel::Expression` for `diesel::expression::subselect::Subselect<users::columns::id, Bool>`
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `diesel::Expression` for `diesel::expression::exists::Exists<users::columns::id>`
    = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::exists::Exists<users::columns::id>>` for `SelectStatement<FromClause<users::table>>`
diff --git a/diesel_compile_tests/tests/fail/expressions_can_only_be_compared_for_equality_to_expressions_of_same_type.stderr b/diesel_compile_tests/tests/fail/expressions_can_only_be_compared_for_equality_to_expressions_of_same_type.stderr
index 9c3870faf981..ed96d31e0dad 100644
--- a/diesel_compile_tests/tests/fail/expressions_can_only_be_compared_for_equality_to_expressions_of_same_type.stderr
+++ b/diesel_compile_tests/tests/fail/expressions_can_only_be_compared_for_equality_to_expressions_of_same_type.stderr
@@ -1,16 +1,30 @@
 error[E0277]: the trait bound `str: diesel::Expression` is not satisfied
-  --> $DIR/expressions_can_only_be_compared_for_equality_to_expressions_of_same_type.rs:15:22
+  --> tests/fail/expressions_can_only_be_compared_for_equality_to_expressions_of_same_type.rs:15:22
    |
 15 |     let pred = id.eq("string");
-   |                      ^^^^^^^^ the trait `diesel::Expression` is not implemented for `str`
+   |                   -- ^^^^^^^^ the trait `diesel::Expression` is not implemented for `str`
+   |                   |
+   |                   required by a bound introduced by this call
    |
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 123 others
    = note: required because of the requirements on the impl of `diesel::Expression` for `&str`
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Integer>` for `&str`
 
 error[E0271]: type mismatch resolving `<columns::name as diesel::Expression>::SqlType == diesel::sql_types::Integer`
-  --> $DIR/expressions_can_only_be_compared_for_equality_to_expressions_of_same_type.rs:16:19
+  --> tests/fail/expressions_can_only_be_compared_for_equality_to_expressions_of_same_type.rs:16:22
    |
 16 |     let pred = id.eq(name);
-   |                   ^^ expected struct `diesel::sql_types::Text`, found struct `diesel::sql_types::Integer`
+   |                   -- ^^^^ expected struct `diesel::sql_types::Text`, found struct `diesel::sql_types::Integer`
+   |                   |
+   |                   required by a bound introduced by this call
    |
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Integer>` for `columns::name`
diff --git a/diesel_compile_tests/tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.stderr b/diesel_compile_tests/tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.stderr
index ccd8c98f15b7..42127abcef3b 100644
--- a/diesel_compile_tests/tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.stderr
+++ b/diesel_compile_tests/tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.stderr
@@ -1,25 +1,30 @@
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
-  --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:32:10
-   |
-32 |         .load::<User>(&mut conn);
-   |          ^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-   |
+    --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:32:10
+     |
+32   |         .load::<User>(&mut conn);
+     |          ^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+     |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
-  --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:13:1
-   |
-13 | / table! {
-14 | |     posts {
-15 | |         id -> Integer,
-16 | |         title -> VarChar,
-17 | |     }
-18 | | }
-   | |_^
-   = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, User>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+    --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:13:1
+     |
+13   | / table! {
+14   | |     posts {
+15   | |         id -> Integer,
+16   | |         title -> VarChar,
+17   | |     }
+18   | | }
+     | |_^
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, User>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
   --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:36:10
@@ -38,42 +43,47 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 18 | | }
    | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, Pg>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, Pg>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>: BoxedDsl<'_, Pg>` is not satisfied
+error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>: BoxedDsl<'_, Pg>` is not satisfied
   --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:39:10
    |
 39 |         .into_boxed::<Pg>();
-   |          ^^^^^^^^^^ the trait `BoxedDsl<'_, Pg>` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
+   |          ^^^^^^^^^^ the trait `BoxedDsl<'_, Pg>` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H> as BoxedDsl<'a, DB>>
-             <SelectStatement<NoFromClause, S, D, W, O, LOf, G, H> as BoxedDsl<'a, DB>>
+   = help: the following other types implement trait `BoxedDsl<'a, DB>`:
+             SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H>
+             SelectStatement<NoFromClause, S, D, W, O, LOf, G, H>
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
-  --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:43:10
-   |
-43 |         .load::<User>(&mut conn);
-   |          ^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-   |
+    --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:43:10
+     |
+43   |         .load::<User>(&mut conn);
+     |          ^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+     |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::title`
-  --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:13:1
-   |
-13 | / table! {
-14 | |     posts {
-15 | |         id -> Integer,
-16 | |         title -> VarChar,
-17 | |     }
-18 | | }
-   | |_^
-   = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>`
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, User>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+    --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:13:1
+     |
+13   | / table! {
+14   | |     posts {
+15   | |         id -> Integer,
+16   | |         title -> VarChar,
+17   | |     }
+18   | | }
+     | |_^
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, User>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
   --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:47:10
@@ -94,7 +104,7 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
    = note: 2 redundant requirements hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>`
    = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, Pg>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>>>: BoxedDsl<'_, Pg>` is not satisfied
   --> tests/fail/filter_cannot_take_comparison_for_columns_from_another_table.rs:51:10
@@ -102,6 +112,6 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 51 |         .into_boxed::<Pg>();
    |          ^^^^^^^^^^ the trait `BoxedDsl<'_, Pg>` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, posts::columns::title>>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H> as BoxedDsl<'a, DB>>
-             <SelectStatement<NoFromClause, S, D, W, O, LOf, G, H> as BoxedDsl<'a, DB>>
+   = help: the following other types implement trait `BoxedDsl<'a, DB>`:
+             SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H>
+             SelectStatement<NoFromClause, S, D, W, O, LOf, G, H>
diff --git a/diesel_compile_tests/tests/fail/filter_requires_bool_nonaggregate_expression.stderr b/diesel_compile_tests/tests/fail/filter_requires_bool_nonaggregate_expression.stderr
index 42fce7ba7763..266411ce3243 100644
--- a/diesel_compile_tests/tests/fail/filter_requires_bool_nonaggregate_expression.stderr
+++ b/diesel_compile_tests/tests/fail/filter_requires_bool_nonaggregate_expression.stderr
@@ -4,6 +4,9 @@ error[E0277]: the trait bound `diesel::sql_types::Text: BoolOrNullableBool` is n
 15 |     let _ = users::table.filter(users::name);
    |                          ^^^^^^ the trait `BoolOrNullableBool` is not implemented for `diesel::sql_types::Text`
    |
+   = help: the following other types implement trait `BoolOrNullableBool`:
+             Bool
+             Nullable<Bool>
    = note: required because of the requirements on the impl of `FilterDsl<columns::name>` for `SelectStatement<FromClause<users::table>>`
 
 error[E0277]: the trait bound `diesel::expression::is_aggregate::Yes: MixedAggregates<diesel::expression::is_aggregate::No>` is not satisfied
@@ -12,8 +15,8 @@ error[E0277]: the trait bound `diesel::expression::is_aggregate::Yes: MixedAggre
 16 |     let _ = users::table.filter(sum(users::id).eq(1));
    |                          ^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::No>` is not implemented for `diesel::expression::is_aggregate::Yes`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `MixedAggregates<Other>`:
              <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Never>>
              <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Yes>>
-   = note: required because of the requirements on the impl of `NonAggregate` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, columns::id>, diesel::internal::derives::as_expression::Bound<Nullable<BigInt>, i64>>>`
-   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, columns::id>, diesel::internal::derives::as_expression::Bound<Nullable<BigInt>, i64>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: required because of the requirements on the impl of `NonAggregate` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, columns::id>, diesel::expression::bound::Bound<Nullable<BigInt>, i64>>>`
+   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, columns::id>, diesel::expression::bound::Bound<Nullable<BigInt>, i64>>>>` for `SelectStatement<FromClause<users::table>>`
diff --git a/diesel_compile_tests/tests/fail/find_requires_correct_type.stderr b/diesel_compile_tests/tests/fail/find_requires_correct_type.stderr
index 2a109d996122..415363adbae3 100644
--- a/diesel_compile_tests/tests/fail/find_requires_correct_type.stderr
+++ b/diesel_compile_tests/tests/fail/find_requires_correct_type.stderr
@@ -1,53 +1,81 @@
 error[E0277]: the trait bound `str: diesel::Expression` is not satisfied
-  --> tests/fail/find_requires_correct_type.rs:20:33
+  --> tests/fail/find_requires_correct_type.rs:20:28
    |
 20 |     int_primary_key::table.find("1");
-   |                                 ^^^ the trait `diesel::Expression` is not implemented for `str`
+   |                            ^^^^ the trait `diesel::Expression` is not implemented for `str`
    |
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 124 others
    = note: required because of the requirements on the impl of `diesel::Expression` for `&str`
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `diesel::Expression` for `diesel::expression::operators::Eq<int_primary_key::columns::id, &str>`
    = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<int_primary_key::columns::id, &str>>>` for `SelectStatement<FromClause<int_primary_key::table>>`
 
 error[E0277]: the trait bound `str: ValidGrouping<()>` is not satisfied
-  --> tests/fail/find_requires_correct_type.rs:20:33
+  --> tests/fail/find_requires_correct_type.rs:20:28
    |
 20 |     int_primary_key::table.find("1");
-   |                                 ^^^ the trait `ValidGrouping<()>` is not implemented for `str`
+   |                            ^^^^ the trait `ValidGrouping<()>` is not implemented for `str`
    |
+   = help: the following other types implement trait `ValidGrouping<GroupByClause>`:
+             <&'a T as ValidGrouping<GB>>
+             <(T0, T1) as ValidGrouping<__GroupByClause>>
+             <(T0, T1, T2) as ValidGrouping<__GroupByClause>>
+             <(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
+             <(T0, T1, T2, T3, T4) as ValidGrouping<__GroupByClause>>
+             <(T0, T1, T2, T3, T4, T5) as ValidGrouping<__GroupByClause>>
+             <(T0, T1, T2, T3, T4, T5, T6) as ValidGrouping<__GroupByClause>>
+             <(T0, T1, T2, T3, T4, T5, T6, T7) as ValidGrouping<__GroupByClause>>
+           and 146 others
    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `&str`
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::expression::operators::Eq<int_primary_key::columns::id, &str>`
    = note: required because of the requirements on the impl of `NonAggregate` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<int_primary_key::columns::id, &str>>`
    = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<int_primary_key::columns::id, &str>>>` for `SelectStatement<FromClause<int_primary_key::table>>`
 
 error[E0277]: the trait bound `{integer}: diesel::Expression` is not satisfied
-  --> tests/fail/find_requires_correct_type.rs:22:36
+  --> tests/fail/find_requires_correct_type.rs:22:31
    |
 22 |     string_primary_key::table.find(1);
-   |                                    ^ the trait `diesel::Expression` is not implemented for `{integer}`
-   |
-   = help: the following implementations were found:
-             <&'a T as diesel::Expression>
-             <(T0, T1) as diesel::Expression>
-             <(T0, T1, T2) as diesel::Expression>
-             <(T0, T1, T2, T3) as diesel::Expression>
-           and 127 others
+   |                               ^^^^ the trait `diesel::Expression` is not implemented for `{integer}`
+   |
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 124 others
    = note: required because of the requirements on the impl of `diesel::Expression` for `diesel::expression::operators::Eq<string_primary_key::columns::id, {integer}>`
    = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<string_primary_key::columns::id, {integer}>>>` for `SelectStatement<FromClause<string_primary_key::table>>`
 
 error[E0277]: the trait bound `{integer}: ValidGrouping<()>` is not satisfied
-  --> tests/fail/find_requires_correct_type.rs:22:36
+  --> tests/fail/find_requires_correct_type.rs:22:31
    |
 22 |     string_primary_key::table.find(1);
-   |                                    ^ the trait `ValidGrouping<()>` is not implemented for `{integer}`
+   |                               ^^^^ the trait `ValidGrouping<()>` is not implemented for `{integer}`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `ValidGrouping<GroupByClause>`:
              <&'a T as ValidGrouping<GB>>
              <(T0, T1) as ValidGrouping<__GroupByClause>>
              <(T0, T1, T2) as ValidGrouping<__GroupByClause>>
              <(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
-           and 149 others
+             <(T0, T1, T2, T3, T4) as ValidGrouping<__GroupByClause>>
+             <(T0, T1, T2, T3, T4, T5) as ValidGrouping<__GroupByClause>>
+             <(T0, T1, T2, T3, T4, T5, T6) as ValidGrouping<__GroupByClause>>
+             <(T0, T1, T2, T3, T4, T5, T6, T7) as ValidGrouping<__GroupByClause>>
+           and 146 others
    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::expression::operators::Eq<string_primary_key::columns::id, {integer}>`
    = note: required because of the requirements on the impl of `NonAggregate` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<string_primary_key::columns::id, {integer}>>`
    = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<string_primary_key::columns::id, {integer}>>>` for `SelectStatement<FromClause<string_primary_key::table>>`
diff --git a/diesel_compile_tests/tests/fail/having_cant_be_used_without_group_by.stderr b/diesel_compile_tests/tests/fail/having_cant_be_used_without_group_by.stderr
index 9da50db3f153..588922224f1f 100644
--- a/diesel_compile_tests/tests/fail/having_cant_be_used_without_group_by.stderr
+++ b/diesel_compile_tests/tests/fail/having_cant_be_used_without_group_by.stderr
@@ -4,8 +4,7 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 26 |     users::table.select(users::name).having(users::id.gt(1)).load(&mut conn);
    |                                      ^^^^^^ the trait `HavingDsl<_>` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<users::columns::name>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<F, S, D, W, O, LOf, diesel::query_builder::group_by_clause::GroupByClause<G>, H> as HavingDsl<Predicate>>
+   = help: the trait `HavingDsl<Predicate>` is implemented for `SelectStatement<F, S, D, W, O, LOf, diesel::query_builder::group_by_clause::GroupByClause<G>, H>`
 
 error[E0277]: the trait bound `(): diesel::Expression` is not satisfied
   --> tests/fail/having_cant_be_used_without_group_by.rs:28:31
@@ -13,6 +12,16 @@ error[E0277]: the trait bound `(): diesel::Expression` is not satisfied
 28 |     users::table.into_boxed().having(users::id.gt(1)).load(&mut conn);
    |                               ^^^^^^ the trait `diesel::Expression` is not implemented for `()`
    |
+   = help: the following other types implement trait `diesel::Expression`:
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+             (T0, T1, T2, T3, T4, T5, T6, T7, T8)
+           and 8 others
    = note: required because of the requirements on the impl of `HavingDsl<_>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, _>`
 
 error[E0271]: type mismatch resolving `<FromClause<users::table> as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
@@ -33,9 +42,9 @@ note: required because of the requirements on the impl of `AppearsOnTable<FromCl
 18 | | }
    | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<FromClause<users::table>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: required because of the requirements on the impl of `HavingDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<users::columns::name>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<users::columns::id>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: required because of the requirements on the impl of `AppearsOnTable<FromClause<users::table>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+   = note: required because of the requirements on the impl of `HavingDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<users::columns::name>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<users::columns::id>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<FromClause<users::table> as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
   --> tests/fail/having_cant_be_used_without_group_by.rs:32:71
@@ -55,6 +64,6 @@ note: required because of the requirements on the impl of `AppearsOnTable<FromCl
 18 | | }
    | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<FromClause<users::table>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: required because of the requirements on the impl of `HavingDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>` for `BoxedSelectStatement<'_, diesel::sql_types::Text, FromClause<users::table>, _, users::columns::id>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: required because of the requirements on the impl of `AppearsOnTable<FromClause<users::table>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+   = note: required because of the requirements on the impl of `HavingDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>` for `BoxedSelectStatement<'_, diesel::sql_types::Text, FromClause<users::table>, _, users::columns::id>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/ilike_only_compiles_for_pg.stderr b/diesel_compile_tests/tests/fail/ilike_only_compiles_for_pg.stderr
index e1a48b1c21ab..be9300057658 100644
--- a/diesel_compile_tests/tests/fail/ilike_only_compiles_for_pg.stderr
+++ b/diesel_compile_tests/tests/fail/ilike_only_compiles_for_pg.stderr
@@ -1,11 +1,33 @@
-error[E0271]: type mismatch resolving `<diesel::SqliteConnection as diesel::Connection>::Backend == Pg`
-  --> $DIR/ilike_only_compiles_for_pg.rs:21:53
-   |
-21 |     users::table.filter(users::name.ilike("%hey%")).execute(&mut connection);
-   |                                                     ^^^^^^^ expected struct `Sqlite`, found struct `Pg`
+error[E0277]: the trait bound `diesel::pg::expression::operators::ILike<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>: QueryFragment<Sqlite>` is not satisfied
+    --> tests/fail/ilike_only_compiles_for_pg.rs:21:53
+     |
+21   |     users::table.filter(users::name.ilike("%hey%")).execute(&mut connection);
+     |                                                     ^^^^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::pg::expression::operators::ILike<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `diesel::pg::expression::operators::ILike<T, U>`
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ILike<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>`
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ILike<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>>`
+     = note: required because of the requirements on the impl of `ExecuteDsl<diesel::SqliteConnection, Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ILike<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::execute`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: methods::ExecuteDsl<Conn>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::execute`
 
-error[E0271]: type mismatch resolving `<diesel::MysqlConnection as diesel::Connection>::Backend == Pg`
-  --> $DIR/ilike_only_compiles_for_pg.rs:24:53
-   |
-24 |     users::table.filter(users::name.ilike("%hey%")).execute(&mut connection);
-   |                                                     ^^^^^^^ expected struct `Mysql`, found struct `Pg`
+error[E0277]: the trait bound `diesel::pg::expression::operators::ILike<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>: QueryFragment<Mysql>` is not satisfied
+    --> tests/fail/ilike_only_compiles_for_pg.rs:24:53
+     |
+24   |     users::table.filter(users::name.ilike("%hey%")).execute(&mut connection);
+     |                                                     ^^^^^^^ the trait `QueryFragment<Mysql>` is not implemented for `diesel::pg::expression::operators::ILike<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `diesel::pg::expression::operators::ILike<T, U>`
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ILike<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>`
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ILike<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>>`
+     = note: required because of the requirements on the impl of `ExecuteDsl<diesel::MysqlConnection, Mysql>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ILike<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::execute`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: methods::ExecuteDsl<Conn>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::execute`
diff --git a/diesel_compile_tests/tests/fail/insert_cannot_reference_columns_from_other_table.stderr b/diesel_compile_tests/tests/fail/insert_cannot_reference_columns_from_other_table.stderr
index 20a7a95295dc..d4ef69e1e3fd 100644
--- a/diesel_compile_tests/tests/fail/insert_cannot_reference_columns_from_other_table.stderr
+++ b/diesel_compile_tests/tests/fail/insert_cannot_reference_columns_from_other_table.stderr
@@ -4,15 +4,60 @@ error[E0271]: type mismatch resolving `<posts::columns::id as Column>::Table ==
 22 |         .values(&posts::id.eq(1));
    |          ^^^^^^ expected struct `posts::table`, found struct `users::table`
 
-error[E0271]: type mismatch resolving `<&diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>> as diesel::Insertable<users::table>>::Values == diesel::query_builder::insert_statement::ValuesClause<_, users::table>`
+error[E0271]: type mismatch resolving `<posts::columns::id as Column>::Table == users::table`
+  --> tests/fail/insert_cannot_reference_columns_from_other_table.rs:22:17
+   |
+22 |         .values(&posts::id.eq(1));
+   |          ------ ^^^^^^^^^^^^^^^^ expected struct `posts::table`, found struct `users::table`
+   |          |
+   |          required by a bound introduced by this call
+   |
+   = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `&diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `&diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+
+error[E0271]: type mismatch resolving `<&diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>> as diesel::Insertable<users::table>>::Values == diesel::query_builder::insert_statement::ValuesClause<_, users::table>`
   --> tests/fail/insert_cannot_reference_columns_from_other_table.rs:25:10
    |
 25 |         .values(&(posts::id.eq(1), users::id.eq(2)));
    |          ^^^^^^ expected struct `posts::table`, found struct `users::table`
    |
-   = note: expected struct `diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<posts::columns::id, &diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, posts::table>`
+   = note: expected struct `diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<posts::columns::id, &diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, posts::table>`
               found struct `diesel::query_builder::insert_statement::ValuesClause<_, users::table>`
-   = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `(&diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>, &diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>)`
+   = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `(&diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>, &diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>)`
+
+error[E0271]: type mismatch resolving `<&diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>> as diesel::Insertable<users::table>>::Values == diesel::query_builder::insert_statement::ValuesClause<_, users::table>`
+  --> tests/fail/insert_cannot_reference_columns_from_other_table.rs:25:17
+   |
+25 |         .values(&(posts::id.eq(1), users::id.eq(2)));
+   |          ------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `posts::table`, found struct `users::table`
+   |          |
+   |          required by a bound introduced by this call
+   |
+   = note: expected struct `diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<posts::columns::id, &diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, posts::table>`
+              found struct `diesel::query_builder::insert_statement::ValuesClause<_, users::table>`
+   = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `(&diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>, &diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>)`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `&(diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>)`
+
+error[E0271]: type mismatch resolving `<&diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>> as diesel::Insertable<users::table>>::Values == diesel::query_builder::insert_statement::ValuesClause<_, users::table>`
+   --> tests/fail/insert_cannot_reference_columns_from_other_table.rs:25:17
+    |
+25  |         .values(&(posts::id.eq(1), users::id.eq(2)));
+    |          ------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `users::table`, found struct `posts::table`
+    |          |
+    |          required by a bound introduced by this call
+    |
+    = note: expected struct `diesel::query_builder::insert_statement::ValuesClause<_, users::table>`
+               found struct `diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<posts::columns::id, &diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, posts::table>`
+    = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `(&diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>, &diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>)`
+    = note: 1 redundant requirement hidden
+    = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `&(diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>)`
+note: required by a bound in `IncompleteInsertStatement::<T, Op>::values`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         U: Insertable<T>,
+    |            ^^^^^^^^^^^^^ required by this bound in `IncompleteInsertStatement::<T, Op>::values`
 
 error[E0271]: type mismatch resolving `<posts::columns::id as Column>::Table == users::table`
   --> tests/fail/insert_cannot_reference_columns_from_other_table.rs:25:10
@@ -20,6 +65,23 @@ error[E0271]: type mismatch resolving `<posts::columns::id as Column>::Table ==
 25 |         .values(&(posts::id.eq(1), users::id.eq(2)));
    |          ^^^^^^ expected struct `posts::table`, found struct `users::table`
    |
-   = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `&diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>`
+   = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `&diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>`
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `(&diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>, &diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>)`
+   = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `(&diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>, &diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>)`
+
+error[E0271]: type mismatch resolving `<posts::columns::id as Column>::Table == users::table`
+   --> tests/fail/insert_cannot_reference_columns_from_other_table.rs:25:17
+    |
+25  |         .values(&(posts::id.eq(1), users::id.eq(2)));
+    |          ------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `users::table`, found struct `posts::table`
+    |          |
+    |          required by a bound introduced by this call
+    |
+    = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `&diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>`
+    = note: 3 redundant requirements hidden
+    = note: required because of the requirements on the impl of `diesel::Insertable<users::table>` for `&(diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>)`
+note: required by a bound in `IncompleteInsertStatement::<T, Op>::values`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         U: Insertable<T>,
+    |            ^^^^^^^^^^^^^ required by this bound in `IncompleteInsertStatement::<T, Op>::values`
diff --git a/diesel_compile_tests/tests/fail/insert_from_select_cant_be_used_with_tuples_or_arrays.stderr b/diesel_compile_tests/tests/fail/insert_from_select_cant_be_used_with_tuples_or_arrays.stderr
index b213e5fae19a..0fe5b3cfdd3d 100644
--- a/diesel_compile_tests/tests/fail/insert_from_select_cant_be_used_with_tuples_or_arrays.stderr
+++ b/diesel_compile_tests/tests/fail/insert_from_select_cant_be_used_with_tuples_or_arrays.stderr
@@ -1,18 +1,46 @@
 error[E0277]: the trait bound `users::table: UndecoratedInsertRecord<posts::table>` is not satisfied
-  --> tests/fail/insert_from_select_cant_be_used_with_tuples_or_arrays.rs:34:17
+  --> tests/fail/insert_from_select_cant_be_used_with_tuples_or_arrays.rs:34:10
    |
 34 |         .values(vec![users, users]);
-   |                 ^^^^^^^^^^^^^^^^^^ the trait `UndecoratedInsertRecord<posts::table>` is not implemented for `users::table`
+   |          ^^^^^^ the trait `UndecoratedInsertRecord<posts::table>` is not implemented for `users::table`
    |
+   = help: the following other types implement trait `UndecoratedInsertRecord<Table>`:
+             <&'a T as UndecoratedInsertRecord<Tab>>
+             <(T0, T1) as UndecoratedInsertRecord<Tab>>
+             <(T0, T1, T2) as UndecoratedInsertRecord<Tab>>
+             <(T0, T1, T2, T3) as UndecoratedInsertRecord<Tab>>
+             <(T0, T1, T2, T3, T4) as UndecoratedInsertRecord<Tab>>
+             <(T0, T1, T2, T3, T4, T5) as UndecoratedInsertRecord<Tab>>
+             <(T0, T1, T2, T3, T4, T5, T6) as UndecoratedInsertRecord<Tab>>
+             <(T0, T1, T2, T3, T4, T5, T6, T7) as UndecoratedInsertRecord<Tab>>
+           and 20 others
    = note: required because of the requirements on the impl of `diesel::Insertable<posts::table>` for `Vec<users::table>`
-   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<users::table as diesel::Insertable<posts::table>>::Values == diesel::query_builder::insert_statement::ValuesClause<_, posts::table>`
-  --> tests/fail/insert_from_select_cant_be_used_with_tuples_or_arrays.rs:37:10
+  --> tests/fail/insert_from_select_cant_be_used_with_tuples_or_arrays.rs:37:17
    |
 37 |         .values((users, users));
-   |          ^^^^^^ expected struct `diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect`, found struct `diesel::query_builder::insert_statement::ValuesClause`
+   |          ------ ^^^^^^^^^^^^^^ expected struct `diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect`, found struct `diesel::query_builder::insert_statement::ValuesClause`
+   |          |
+   |          required by a bound introduced by this call
    |
    = note: expected struct `diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<SelectStatement<FromClause<users::table>>, (posts::columns::user_id, posts::columns::title, posts::columns::body)>`
               found struct `diesel::query_builder::insert_statement::ValuesClause<_, posts::table>`
    = note: required because of the requirements on the impl of `diesel::Insertable<posts::table>` for `(users::table, users::table)`
+
+error[E0271]: type mismatch resolving `<users::table as diesel::Insertable<posts::table>>::Values == diesel::query_builder::insert_statement::ValuesClause<_, posts::table>`
+   --> tests/fail/insert_from_select_cant_be_used_with_tuples_or_arrays.rs:37:17
+    |
+37  |         .values((users, users));
+    |          ------ ^^^^^^^^^^^^^^ expected struct `diesel::query_builder::insert_statement::ValuesClause`, found struct `diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect`
+    |          |
+    |          required by a bound introduced by this call
+    |
+    = note: expected struct `diesel::query_builder::insert_statement::ValuesClause<_, posts::table>`
+               found struct `diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<SelectStatement<FromClause<users::table>>, (posts::columns::user_id, posts::columns::title, posts::columns::body)>`
+    = note: required because of the requirements on the impl of `diesel::Insertable<posts::table>` for `(users::table, users::table)`
+note: required by a bound in `IncompleteInsertStatement::<T, Op>::values`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         U: Insertable<T>,
+    |            ^^^^^^^^^^^^^ required by this bound in `IncompleteInsertStatement::<T, Op>::values`
diff --git a/diesel_compile_tests/tests/fail/insert_from_select_requires_valid_column_list.stderr b/diesel_compile_tests/tests/fail/insert_from_select_requires_valid_column_list.stderr
index c915463938eb..7153762a0875 100644
--- a/diesel_compile_tests/tests/fail/insert_from_select_requires_valid_column_list.stderr
+++ b/diesel_compile_tests/tests/fail/insert_from_select_requires_valid_column_list.stderr
@@ -1,55 +1,95 @@
 error[E0271]: type mismatch resolving `<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<(users::columns::name, users::columns::hair_color)>> as Query>::SqlType == (diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
-  --> $DIR/insert_from_select_requires_valid_column_list.rs:57:10
-   |
-57 |         .execute(&mut conn)
-   |          ^^^^^^^ expected a tuple with 2 elements, found one with 3 elements
-   |
-   = note: expected tuple `(diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
-              found tuple `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
-   = note: required because of the requirements on the impl of `QueryFragment<_>` for `diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<(users::columns::name, users::columns::hair_color)>>, (posts::columns::user_id, posts::columns::title, posts::columns::body)>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<_>` for `InsertStatement<posts::table, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<(users::columns::name, users::columns::hair_color)>>, (posts::columns::user_id, posts::columns::title, posts::columns::body)>>`
-   = note: required because of the requirements on the impl of `ExecuteDsl<_, _>` for `InsertStatement<posts::table, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<(users::columns::name, users::columns::hair_color)>>, (posts::columns::user_id, posts::columns::title, posts::columns::body)>>`
+    --> tests/fail/insert_from_select_requires_valid_column_list.rs:57:10
+     |
+57   |         .execute(&mut conn)
+     |          ^^^^^^^ expected a tuple with 3 elements, found one with 2 elements
+     |
+     = note: expected tuple `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
+                found tuple `(diesel::sql_types::Text, diesel::sql_types::Nullable<diesel::sql_types::Text>)`
+     = note: required because of the requirements on the impl of `QueryFragment<_>` for `diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<(users::columns::name, users::columns::hair_color)>>, (posts::columns::user_id, posts::columns::title, posts::columns::body)>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `QueryFragment<_>` for `InsertStatement<posts::table, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<(users::columns::name, users::columns::hair_color)>>, (posts::columns::user_id, posts::columns::title, posts::columns::body)>>`
+     = note: required because of the requirements on the impl of `ExecuteDsl<_, _>` for `InsertStatement<posts::table, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<(users::columns::name, users::columns::hair_color)>>, (posts::columns::user_id, posts::columns::title, posts::columns::body)>>`
+note: required by a bound in `diesel::RunQueryDsl::execute`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: methods::ExecuteDsl<Conn>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::execute`
 
 error[E0271]: type mismatch resolving `<comments::columns::post_id as diesel::query_builder::insert_statement::column_list::ColumnList>::Table == posts::table`
-  --> $DIR/insert_from_select_requires_valid_column_list.rs:63:10
-   |
-63 |         .into_columns(comments::post_id);
-   |          ^^^^^^^^^^^^ expected struct `comments::table`, found struct `posts::table`
+   --> tests/fail/insert_from_select_requires_valid_column_list.rs:63:10
+    |
+63  |         .into_columns(comments::post_id);
+    |          ^^^^^^^^^^^^ expected struct `posts::table`, found struct `comments::table`
+    |
+note: required by a bound in `InsertStatement::<T, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<U, C>, Op, Ret>::into_columns`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         C2: ColumnList<Table = T> + Expression,
+    |                        ^^^^^^^^^ required by this bound in `InsertStatement::<T, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<U, C>, Op, Ret>::into_columns`
 
 error[E0271]: type mismatch resolving `<posts::columns::title as diesel::Expression>::SqlType == diesel::sql_types::Integer`
-  --> $DIR/insert_from_select_requires_valid_column_list.rs:68:10
+  --> tests/fail/insert_from_select_requires_valid_column_list.rs:68:10
    |
 68 |         .into_columns(title);
    |          ^^^^^^^^^^^^ expected struct `diesel::sql_types::Text`, found struct `diesel::sql_types::Integer`
 
 error[E0277]: the trait bound `(comments::columns::post_id, posts::columns::title): diesel::query_builder::insert_statement::column_list::ColumnList` is not satisfied
-  --> $DIR/insert_from_select_requires_valid_column_list.rs:73:23
-   |
-73 |         .into_columns((comments::post_id, title));
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `diesel::query_builder::insert_statement::column_list::ColumnList` is not implemented for `(comments::columns::post_id, posts::columns::title)`
-   |
-   = help: the following implementations were found:
-             <(T0, T1) as diesel::query_builder::insert_statement::column_list::ColumnList>
+   --> tests/fail/insert_from_select_requires_valid_column_list.rs:73:23
+    |
+73  |         .into_columns((comments::post_id, title));
+    |          ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `diesel::query_builder::insert_statement::column_list::ColumnList` is not implemented for `(comments::columns::post_id, posts::columns::title)`
+    |          |
+    |          required by a bound introduced by this call
+    |
+    = help: the following other types implement trait `diesel::query_builder::insert_statement::column_list::ColumnList`:
+              (T0, T1)
+              (T0, T1, T2)
+              (T0, T1, T2, T3)
+              (T0, T1, T2, T3, T4)
+              (T0, T1, T2, T3, T4, T5)
+              (T0, T1, T2, T3, T4, T5, T6)
+              (T0, T1, T2, T3, T4, T5, T6, T7)
+              (T0, T1, T2, T3, T4, T5, T6, T7, T8)
+            and 8 others
+note: required by a bound in `InsertStatement::<T, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<U, C>, Op, Ret>::into_columns`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         C2: ColumnList<Table = T> + Expression,
+    |             ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `InsertStatement::<T, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<U, C>, Op, Ret>::into_columns`
 
 error[E0271]: type mismatch resolving `<comments::columns::post_id as diesel::query_builder::insert_statement::column_list::ColumnList>::Table == posts::table`
-  --> $DIR/insert_from_select_requires_valid_column_list.rs:78:10
-   |
-78 |         .into_columns((comments::post_id, comments::body));
-   |          ^^^^^^^^^^^^ expected struct `comments::table`, found struct `posts::table`
-   |
-   = note: required because of the requirements on the impl of `diesel::query_builder::insert_statement::column_list::ColumnList` for `(comments::columns::post_id, comments::columns::body)`
+   --> tests/fail/insert_from_select_requires_valid_column_list.rs:78:23
+    |
+78  |         .into_columns((comments::post_id, comments::body));
+    |          ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `posts::table`, found struct `comments::table`
+    |          |
+    |          required by a bound introduced by this call
+    |
+    = note: required because of the requirements on the impl of `diesel::query_builder::insert_statement::column_list::ColumnList` for `(comments::columns::post_id, comments::columns::body)`
+note: required by a bound in `InsertStatement::<T, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<U, C>, Op, Ret>::into_columns`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         C2: ColumnList<Table = T> + Expression,
+    |                        ^^^^^^^^^ required by this bound in `InsertStatement::<T, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<U, C>, Op, Ret>::into_columns`
 
 error[E0271]: type mismatch resolving `<comments::columns::body as diesel::query_builder::insert_statement::column_list::ColumnList>::Table == posts::table`
-  --> $DIR/insert_from_select_requires_valid_column_list.rs:78:10
-   |
-78 |         .into_columns((comments::post_id, comments::body));
-   |          ^^^^^^^^^^^^ expected struct `comments::table`, found struct `posts::table`
-   |
-   = note: required because of the requirements on the impl of `diesel::query_builder::insert_statement::column_list::ColumnList` for `(comments::columns::post_id, comments::columns::body)`
+   --> tests/fail/insert_from_select_requires_valid_column_list.rs:78:23
+    |
+78  |         .into_columns((comments::post_id, comments::body));
+    |          ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `posts::table`, found struct `comments::table`
+    |          |
+    |          required by a bound introduced by this call
+    |
+    = note: required because of the requirements on the impl of `diesel::query_builder::insert_statement::column_list::ColumnList` for `(comments::columns::post_id, comments::columns::body)`
+note: required by a bound in `InsertStatement::<T, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<U, C>, Op, Ret>::into_columns`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         C2: ColumnList<Table = T> + Expression,
+    |                        ^^^^^^^^^ required by this bound in `InsertStatement::<T, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<U, C>, Op, Ret>::into_columns`
 
 error[E0271]: type mismatch resolving `<(posts::columns::user_id, posts::columns::body) as diesel::Expression>::SqlType == (diesel::sql_types::Integer, diesel::sql_types::Text)`
-  --> $DIR/insert_from_select_requires_valid_column_list.rs:83:10
+  --> tests/fail/insert_from_select_requires_valid_column_list.rs:83:10
    |
 83 |         .into_columns((user_id, body));
    |          ^^^^^^^^^^^^ expected struct `diesel::sql_types::Nullable`, found struct `diesel::sql_types::Text`
@@ -58,7 +98,7 @@ error[E0271]: type mismatch resolving `<(posts::columns::user_id, posts::columns
               found tuple `(diesel::sql_types::Integer, diesel::sql_types::Text)`
 
 error[E0271]: type mismatch resolving `<(posts::columns::title, posts::columns::body) as diesel::Expression>::SqlType == (diesel::sql_types::Integer, diesel::sql_types::Text)`
-  --> $DIR/insert_from_select_requires_valid_column_list.rs:88:10
+  --> tests/fail/insert_from_select_requires_valid_column_list.rs:88:10
    |
 88 |         .into_columns((title, body));
    |          ^^^^^^^^^^^^ expected struct `diesel::sql_types::Text`, found struct `diesel::sql_types::Integer`
diff --git a/diesel_compile_tests/tests/fail/insert_requires_value_of_same_type_as_column.stderr b/diesel_compile_tests/tests/fail/insert_requires_value_of_same_type_as_column.stderr
index cab95e1a46c7..f18667abfa59 100644
--- a/diesel_compile_tests/tests/fail/insert_requires_value_of_same_type_as_column.stderr
+++ b/diesel_compile_tests/tests/fail/insert_requires_value_of_same_type_as_column.stderr
@@ -2,12 +2,18 @@ error[E0277]: the trait bound `{integer}: diesel::Expression` is not satisfied
   --> tests/fail/insert_requires_value_of_same_type_as_column.rs:19:26
    |
 19 |         .values(&name.eq(1));
-   |                          ^ the trait `diesel::Expression` is not implemented for `{integer}`
+   |                       -- ^ the trait `diesel::Expression` is not implemented for `{integer}`
+   |                       |
+   |                       required by a bound introduced by this call
    |
-   = help: the following implementations were found:
-             <&'a T as diesel::Expression>
-             <(T0, T1) as diesel::Expression>
-             <(T0, T1, T2) as diesel::Expression>
-             <(T0, T1, T2, T3) as diesel::Expression>
-           and 127 others
+   = help: the following other types implement trait `diesel::Expression`:
+             &'a T
+             (T0, T1)
+             (T0, T1, T2)
+             (T0, T1, T2, T3)
+             (T0, T1, T2, T3, T4)
+             (T0, T1, T2, T3, T4, T5)
+             (T0, T1, T2, T3, T4, T5, T6)
+             (T0, T1, T2, T3, T4, T5, T6, T7)
+           and 124 others
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Text>` for `{integer}`
diff --git a/diesel_compile_tests/tests/fail/insert_statement_does_not_support_returning_methods_on_sqlite.stderr b/diesel_compile_tests/tests/fail/insert_statement_does_not_support_returning_methods_on_sqlite.stderr
index 24b19eff4876..4388ee89a00a 100644
--- a/diesel_compile_tests/tests/fail/insert_statement_does_not_support_returning_methods_on_sqlite.stderr
+++ b/diesel_compile_tests/tests/fail/insert_statement_does_not_support_returning_methods_on_sqlite.stderr
@@ -1,29 +1,39 @@
 error[E0277]: the trait bound `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>: QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not satisfied
-  --> tests/fail/insert_statement_does_not_support_returning_methods_on_sqlite.rs:29:10
-   |
-29 |         .get_result::<User>(&mut connection);
-   |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, User>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>>`
+    --> tests/fail/insert_statement_does_not_support_returning_methods_on_sqlite.rs:29:10
+     |
+29   |         .get_result::<User>(&mut connection);
+     |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, User>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `diesel::query_builder::returning_clause::ReturningClause<columns::name>: QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not satisfied
-  --> tests/fail/insert_statement_does_not_support_returning_methods_on_sqlite.rs:34:10
-   |
-34 |         .get_result::<String>(&mut connection);
-   |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, std::string::String>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
+    --> tests/fail/insert_statement_does_not_support_returning_methods_on_sqlite.rs:34:10
+     |
+34   |         .get_result::<String>(&mut connection);
+     |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, std::string::String>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
diff --git a/diesel_compile_tests/tests/fail/invalid_joins.rs b/diesel_compile_tests/tests/fail/invalid_joins.rs
new file mode 100644
index 000000000000..0ece4b0289ab
--- /dev/null
+++ b/diesel_compile_tests/tests/fail/invalid_joins.rs
@@ -0,0 +1,68 @@
+extern crate diesel;
+
+use diesel::*;
+
+table! {
+    users {
+        id -> Integer,
+        name -> VarChar,
+    }
+}
+
+table! {
+    posts {
+        id -> Integer,
+        title -> Text,
+        user_id -> Integer,
+    }
+}
+
+table! {
+    comments {
+        id -> Integer,
+        user_id -> Integer,
+        post_id -> Integer,
+        name -> Text,
+    }
+}
+
+joinable!(posts -> users (user_id));
+joinable!(comments -> users (user_id));
+joinable!(comments -> posts (post_id));
+allow_tables_to_appear_in_same_query!(posts, users, comments);
+
+fn main() {}
+
+fn invalid_inner_joins() {
+    // This is a valid join
+    let _ = users::table.inner_join(posts::table);
+
+    // This fails, because we join the same table more than once
+    let _ = users::table.inner_join(posts::table.inner_join(users::table));
+
+    // It also fails if we use an explicit on clause
+    let _ = users::table.inner_join(posts::table.inner_join(users::table.on(posts::user_id.eq(users::id))));
+
+    // Also if we put the on clause on the first join
+    let _ = users::table.inner_join(posts::table.on(users::id.eq(posts::user_id)).inner_join(users::table));
+
+    // it also fails if we join to another subjoin
+    let _ = users::table.inner_join(comments::table).inner_join(posts::table.inner_join(comments::table));
+}
+
+fn invalid_left_joins() {
+    // This is a valid join
+    let _ = users::table.left_join(posts::table);
+
+    // This fails, because we join the same table more than once
+    let _ = users::table.left_join(posts::table.left_join(users::table));
+
+    // It also fails if we use an explicit on clause
+    let _ = users::table.left_join(posts::table.left_join(users::table.on(posts::user_id.eq(users::id))));
+
+    // Also if we put the on clause on the first join
+    let _ = users::table.left_join(posts::table.on(users::id.eq(posts::user_id)).left_join(users::table));
+
+    // it also fails if we join to another subjoin
+    let _ = users::table.left_join(comments::table).left_join(posts::table.left_join(comments::table));
+}
diff --git a/diesel_compile_tests/tests/fail/invalid_joins.stderr b/diesel_compile_tests/tests/fail/invalid_joins.stderr
new file mode 100644
index 000000000000..97d7a562eed1
--- /dev/null
+++ b/diesel_compile_tests/tests/fail/invalid_joins.stderr
@@ -0,0 +1,493 @@
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:41:26
+   |
+41 |     let _ = users::table.inner_join(posts::table.inner_join(users::table));
+   |                          ^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `((users::columns::id, users::columns::name), query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), (users::columns::id, users::columns::name))>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:41:37
+   |
+41 |     let _ = users::table.inner_join(posts::table.inner_join(users::table));
+   |                          ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |                          |
+   |                          required by a bound introduced by this call
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `((users::columns::id, users::columns::name), query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), (users::columns::id, users::columns::name))>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `users::table`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner> as AppearsInFromClause<users::table>>::Count == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:41:26
+   |
+41 |     let _ = users::table.inner_join(posts::table.inner_join(users::table));
+   |                          ^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 3 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>`
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:44:26
+   |
+44 |     let _ = users::table.inner_join(posts::table.inner_join(users::table.on(posts::user_id.eq(users::id))));
+   |                          ^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner>>` for `((users::columns::id, users::columns::name), query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), (users::columns::id, users::columns::name))>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:44:37
+   |
+44 |     let _ = users::table.inner_join(posts::table.inner_join(users::table.on(posts::user_id.eq(users::id))));
+   |                          ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |                          |
+   |                          required by a bound introduced by this call
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner>>` for `((users::columns::id, users::columns::name), query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), (users::columns::id, users::columns::name))>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `users::table`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner> as AppearsInFromClause<users::table>>::Count == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:44:26
+   |
+44 |     let _ = users::table.inner_join(posts::table.inner_join(users::table.on(posts::user_id.eq(users::id))));
+   |                          ^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 3 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>`
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:47:26
+   |
+47 |     let _ = users::table.inner_join(posts::table.on(users::id.eq(posts::user_id)).inner_join(users::table));
+   |                          ^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `((users::columns::id, users::columns::name), query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), (users::columns::id, users::columns::name))>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:47:37
+   |
+47 |     let _ = users::table.inner_join(posts::table.on(users::id.eq(posts::user_id)).inner_join(users::table));
+   |                          ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |                          |
+   |                          required by a bound introduced by this call
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `((users::columns::id, users::columns::name), query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), (users::columns::id, users::columns::name))>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>` for `users::table`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner> as AppearsInFromClause<users::table>>::Count == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:47:26
+   |
+47 |     let _ = users::table.inner_join(posts::table.on(users::id.eq(posts::user_id)).inner_join(users::table));
+   |                          ^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>`
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:50:54
+   |
+50 |     let _ = users::table.inner_join(comments::table).inner_join(posts::table.inner_join(comments::table));
+   |                                                      ^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::user_id>, NullableExpression<users::columns::id>>>>, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>>` for `comments::columns::id`
+  --> tests/fail/invalid_joins.rs:20:1
+   |
+20 | / table! {
+21 | |     comments {
+22 | |         id -> Integer,
+23 | |         user_id -> Integer,
+...  |
+26 | |     }
+27 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::user_id>, NullableExpression<users::columns::id>>>>, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>>` for `((users::columns::id, users::columns::name), (comments::columns::id, comments::columns::user_id, comments::columns::post_id, comments::columns::name), query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), (comments::columns::id, comments::columns::user_id, comments::columns::post_id, comments::columns::name))>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::user_id>, NullableExpression<users::columns::id>>>>, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::user_id>, NullableExpression<users::columns::id>>>>, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:58:26
+   |
+58 |     let _ = users::table.left_join(posts::table.left_join(users::table));
+   |                          ^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `((users::columns::id, users::columns::name), NullableExpression<query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), NullableExpression<(users::columns::id, users::columns::name)>)>>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:58:36
+   |
+58 |     let _ = users::table.left_join(posts::table.left_join(users::table));
+   |                          --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |                          |
+   |                          required by a bound introduced by this call
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `((users::columns::id, users::columns::name), NullableExpression<query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), NullableExpression<(users::columns::id, users::columns::name)>)>>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `users::table`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter> as AppearsInFromClause<users::table>>::Count == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:58:26
+   |
+58 |     let _ = users::table.left_join(posts::table.left_join(users::table));
+   |                          ^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 3 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>`
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:61:26
+   |
+61 |     let _ = users::table.left_join(posts::table.left_join(users::table.on(posts::user_id.eq(users::id))));
+   |                          ^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter>>` for `((users::columns::id, users::columns::name), NullableExpression<query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), NullableExpression<(users::columns::id, users::columns::name)>)>>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:61:36
+   |
+61 |     let _ = users::table.left_join(posts::table.left_join(users::table.on(posts::user_id.eq(users::id))));
+   |                          --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |                          |
+   |                          required by a bound introduced by this call
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter>>` for `((users::columns::id, users::columns::name), NullableExpression<query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), NullableExpression<(users::columns::id, users::columns::name)>)>>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `users::table`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter> as AppearsInFromClause<users::table>>::Count == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:61:26
+   |
+61 |     let _ = users::table.left_join(posts::table.left_join(users::table.on(posts::user_id.eq(users::id))));
+   |                          ^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 3 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>`
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::user_id, users::columns::id>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:64:26
+   |
+64 |     let _ = users::table.left_join(posts::table.on(users::id.eq(posts::user_id)).left_join(users::table));
+   |                          ^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `((users::columns::id, users::columns::name), NullableExpression<query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), NullableExpression<(users::columns::id, users::columns::name)>)>>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:64:36
+   |
+64 |     let _ = users::table.left_join(posts::table.on(users::id.eq(posts::user_id)).left_join(users::table));
+   |                          --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |                          |
+   |                          required by a bound introduced by this call
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `((users::columns::id, users::columns::name), NullableExpression<query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), NullableExpression<(users::columns::id, users::columns::name)>)>>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>` for `users::table`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter> as AppearsInFromClause<users::table>>::Count == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:64:26
+   |
+64 |     let _ = users::table.left_join(posts::table.on(users::id.eq(posts::user_id)).left_join(users::table));
+   |                          ^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `users::columns::id`
+  --> tests/fail/invalid_joins.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>`
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, users::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, posts::columns::user_id>>>` for `SelectStatement<FromClause<users::table>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0271]: type mismatch resolving `<diesel::query_source::Once as Plus<diesel::query_source::Once>>::Output == diesel::query_source::Once`
+  --> tests/fail/invalid_joins.rs:67:53
+   |
+67 |     let _ = users::table.left_join(comments::table).left_join(posts::table.left_join(comments::table));
+   |                                                     ^^^^^^^^^ expected struct `MoreThanOnce`, found struct `diesel::query_source::Once`
+   |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, comments::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::user_id>, NullableExpression<users::columns::id>>>>, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, LeftOuter>>` for `comments::columns::id`
+  --> tests/fail/invalid_joins.rs:20:1
+   |
+20 | / table! {
+21 | |     comments {
+22 | |         id -> Integer,
+23 | |         user_id -> Integer,
+...  |
+26 | |     }
+27 | | }
+   | |_^
+   = note: 3 redundant requirements hidden
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, comments::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::user_id>, NullableExpression<users::columns::id>>>>, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, LeftOuter>>` for `((users::columns::id, users::columns::name), NullableExpression<(comments::columns::id, comments::columns::user_id, comments::columns::post_id, comments::columns::name)>, NullableExpression<query_source::joins::private::SkipSelectableExpressionBoundCheckWrapper<((posts::columns::id, posts::columns::title, posts::columns::user_id), NullableExpression<(comments::columns::id, comments::columns::user_id, comments::columns::post_id, comments::columns::name)>)>>)`
+   = note: required because of the requirements on the impl of `QuerySource` for `query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, comments::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::user_id>, NullableExpression<users::columns::id>>>>, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, LeftOuter>`
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, comments::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::user_id>, NullableExpression<users::columns::id>>>>, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>`
+   = note: required because of the requirements on the impl of `InternalJoinDsl<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, LeftOuter, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, comments::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/join_with_explicit_on_requires_valid_boolean_expression.stderr b/diesel_compile_tests/tests/fail/join_with_explicit_on_requires_valid_boolean_expression.stderr
index 83c8801a7be0..4c5f22872e3e 100644
--- a/diesel_compile_tests/tests/fail/join_with_explicit_on_requires_valid_boolean_expression.stderr
+++ b/diesel_compile_tests/tests/fail/join_with_explicit_on_requires_valid_boolean_expression.stderr
@@ -1,10 +1,10 @@
-error[E0271]: type mismatch resolving `<diesel::internal::table_macro::Join<users::table, posts::table, Inner> as AppearsInFromClause<comments::table>>::Count == diesel::query_source::Once`
+error[E0271]: type mismatch resolving `<query_source::joins::Join<users::table, posts::table, Inner> as AppearsInFromClause<comments::table>>::Count == diesel::query_source::Once`
   --> tests/fail/join_with_explicit_on_requires_valid_boolean_expression.rs:31:26
    |
 31 |     let _ = users::table.inner_join(posts::table.on(users::id.eq(comments::id)));
    |                          ^^^^^^^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
    |
-note: required because of the requirements on the impl of `AppearsOnTable<diesel::internal::table_macro::Join<users::table, posts::table, Inner>>` for `comments::columns::id`
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, posts::table, Inner>>` for `comments::columns::id`
   --> tests/fail/join_with_explicit_on_requires_valid_boolean_expression.rs:17:1
    |
 17 | / table! {
@@ -14,10 +14,10 @@ note: required because of the requirements on the impl of `AppearsOnTable<diesel
 21 | | }
    | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<diesel::internal::table_macro::Join<users::table, posts::table, Inner>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, comments::columns::id>>`
-   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, comments::columns::id>>>`
+   = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<users::table, posts::table, Inner>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, comments::columns::id>>`
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, comments::columns::id>>>`
    = note: required because of the requirements on the impl of `InternalJoinDsl<posts::table, Inner, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, comments::columns::id>>>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `diesel::sql_types::Integer: BoolOrNullableBool` is not satisfied
   --> tests/fail/join_with_explicit_on_requires_valid_boolean_expression.rs:33:26
@@ -25,5 +25,8 @@ error[E0277]: the trait bound `diesel::sql_types::Integer: BoolOrNullableBool` i
 33 |     let _ = users::table.inner_join(posts::table.on(users::id));
    |                          ^^^^^^^^^^ the trait `BoolOrNullableBool` is not implemented for `diesel::sql_types::Integer`
    |
-   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, Inner>, users::columns::id>`
+   = help: the following other types implement trait `BoolOrNullableBool`:
+             Bool
+             Nullable<Bool>
+   = note: required because of the requirements on the impl of `QuerySource` for `JoinOn<query_source::joins::Join<users::table, posts::table, Inner>, users::columns::id>`
    = note: required because of the requirements on the impl of `InternalJoinDsl<posts::table, Inner, users::columns::id>` for `SelectStatement<FromClause<users::table>>`
diff --git a/diesel_compile_tests/tests/fail/mysql_does_not_support_offset_without_limit.stderr b/diesel_compile_tests/tests/fail/mysql_does_not_support_offset_without_limit.stderr
index c07050afadff..2bcaa22c368c 100644
--- a/diesel_compile_tests/tests/fail/mysql_does_not_support_offset_without_limit.stderr
+++ b/diesel_compile_tests/tests/fail/mysql_does_not_support_offset_without_limit.stderr
@@ -1,28 +1,41 @@
-error[E0277]: the trait bound `diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::internal::derives::as_expression::Bound<BigInt, i64>>>: QueryFragment<Mysql>` is not satisfied
-  --> tests/fail/mysql_does_not_support_offset_without_limit.rs:16:29
-   |
-16 |     users::table.offset(42).get_result::<(i32, String)>(&mut connection);
-   |                             ^^^^^^^^^^ the trait `QueryFragment<Mysql>` is not implemented for `diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::internal::derives::as_expression::Bound<BigInt, i64>>>`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::limit_offset_clause::LimitOffsetClause<L, O> as QueryFragment<Pg>>
-             <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::LimitClause<L>, diesel::query_builder::offset_clause::NoOffsetClause> as QueryFragment<Mysql>>
-             <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::LimitClause<L>, diesel::query_builder::offset_clause::NoOffsetClause> as QueryFragment<Sqlite>>
-             <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::LimitClause<L>, diesel::query_builder::offset_clause::OffsetClause<O>> as QueryFragment<Mysql>>
-           and 4 others
-   = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, (i32, std::string::String)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>`
+error[E0277]: the trait bound `diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::expression::bound::Bound<BigInt, i64>>>: QueryFragment<Mysql>` is not satisfied
+    --> tests/fail/mysql_does_not_support_offset_without_limit.rs:16:29
+     |
+16   |     users::table.offset(42).get_result::<(i32, String)>(&mut connection);
+     |                             ^^^^^^^^^^ the trait `QueryFragment<Mysql>` is not implemented for `diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::expression::bound::Bound<BigInt, i64>>>`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::limit_offset_clause::LimitOffsetClause<L, O> as QueryFragment<Pg>>
+               <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::LimitClause<L>, diesel::query_builder::offset_clause::NoOffsetClause> as QueryFragment<Mysql>>
+               <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::LimitClause<L>, diesel::query_builder::offset_clause::NoOffsetClause> as QueryFragment<Sqlite>>
+               <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::LimitClause<L>, diesel::query_builder::offset_clause::OffsetClause<O>> as QueryFragment<Mysql>>
+               <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::LimitClause<L>, diesel::query_builder::offset_clause::OffsetClause<O>> as QueryFragment<Sqlite>>
+               <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause> as QueryFragment<Mysql>>
+               <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause> as QueryFragment<Sqlite>>
+               <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<O>> as QueryFragment<Sqlite>>
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql, backend::sql_dialect::select_statement_syntax::AnsiSqlSelectStatement>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::expression::bound::Bound<BigInt, i64>>>>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::expression::bound::Bound<BigInt, i64>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, (i32, std::string::String)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::expression::bound::Bound<BigInt, i64>>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
-error[E0277]: the trait bound `diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::internal::derives::as_expression::Bound<BigInt, i64>>>: IntoBoxedClause<'_, Mysql>` is not satisfied
+error[E0277]: the trait bound `diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::expression::bound::Bound<BigInt, i64>>>: IntoBoxedClause<'_, Mysql>` is not satisfied
   --> tests/fail/mysql_does_not_support_offset_without_limit.rs:18:29
    |
 18 |     users::table.offset(42).into_boxed().get_result::<(i32, String)>(&mut connection);
-   |                             ^^^^^^^^^^ the trait `IntoBoxedClause<'_, Mysql>` is not implemented for `diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::internal::derives::as_expression::Bound<BigInt, i64>>>`
+   |                             ^^^^^^^^^^ the trait `IntoBoxedClause<'_, Mysql>` is not implemented for `diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::expression::bound::Bound<BigInt, i64>>>`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `IntoBoxedClause<'a, DB>`:
              <diesel::query_builder::limit_offset_clause::LimitOffsetClause<L, O> as IntoBoxedClause<'a, Pg>>
              <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::LimitClause<L>, diesel::query_builder::offset_clause::NoOffsetClause> as IntoBoxedClause<'a, Mysql>>
              <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::LimitClause<L>, diesel::query_builder::offset_clause::NoOffsetClause> as IntoBoxedClause<'a, Sqlite>>
              <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::LimitClause<L>, diesel::query_builder::offset_clause::OffsetClause<O>> as IntoBoxedClause<'a, Mysql>>
-           and 4 others
-   = note: required because of the requirements on the impl of `BoxedDsl<'_, Mysql>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>`
+             <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::LimitClause<L>, diesel::query_builder::offset_clause::OffsetClause<O>> as IntoBoxedClause<'a, Sqlite>>
+             <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause> as IntoBoxedClause<'a, Mysql>>
+             <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause> as IntoBoxedClause<'a, Sqlite>>
+             <diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<O>> as IntoBoxedClause<'a, Sqlite>>
+   = note: required because of the requirements on the impl of `BoxedDsl<'_, Mysql>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::OffsetClause<diesel::expression::bound::Bound<BigInt, i64>>>>`
diff --git a/diesel_compile_tests/tests/fail/numeric_ops_require_numeric_column.stderr b/diesel_compile_tests/tests/fail/numeric_ops_require_numeric_column.stderr
index 953008246496..e38ccaeef8e8 100644
--- a/diesel_compile_tests/tests/fail/numeric_ops_require_numeric_column.stderr
+++ b/diesel_compile_tests/tests/fail/numeric_ops_require_numeric_column.stderr
@@ -1,9 +1,20 @@
 error[E0369]: cannot add `columns::name` to `columns::name`
-  --> $DIR/numeric_ops_require_numeric_column.rs:15:31
+  --> tests/fail/numeric_ops_require_numeric_column.rs:15:31
    |
 15 |     let _ = users.select(name + name);
    |                          ---- ^ ---- columns::name
    |                          |
    |                          columns::name
    |
-   = note: an implementation of `std::ops::Add` might be missing for `columns::name`
+note: an implementation of `std::ops::Add<_>` might be missing for `columns::name`
+  --> tests/fail/numeric_ops_require_numeric_column.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> VarChar,
+9  | |     }
+10 | | }
+   | |_^ must implement `std::ops::Add<_>`
+note: the following trait must be implemented
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/only_only_on_table.stderr b/diesel_compile_tests/tests/fail/only_only_on_table.stderr
index 1e1a56da201d..7a51eaa1efeb 100644
--- a/diesel_compile_tests/tests/fail/only_only_on_table.stderr
+++ b/diesel_compile_tests/tests/fail/only_only_on_table.stderr
@@ -6,17 +6,17 @@ error[E0599]: the method `only` exists for struct `SelectStatement<FromClause<fo
    |
   ::: $DIESEL/src/query_builder/select_statement/mod.rs
    |
-   | / pub struct SelectStatement<
-   | |     From,
-   | |     Select = DefaultSelectClause<From>,
-   | |     Distinct = NoDistinctClause,
+   | / #[diesel_derives::__diesel_public_if(
+   | |     feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes",
+   | |     public_fields(
+   | |         select,
 ...  |
-   | |     pub(crate) locking: Locking,
-   | | }
-   | | -
-   | | |
-   | |_doesn't satisfy `_: Table`
-   |   doesn't satisfy `_: diesel::dsl::OnlyDsl`
+   | |     )
+   | | )]
+   | |  -
+   | |  |
+   | |__doesn't satisfy `_: Table`
+   |    doesn't satisfy `_: diesel::dsl::OnlyDsl`
    |
    = note: the following trait bounds were not satisfied:
            `SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>>: Table`
@@ -26,33 +26,33 @@ error[E0599]: the method `only` exists for struct `SelectStatement<FromClause<fo
            `&mut SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>>: Table`
            which is required by `&mut SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>>: diesel::dsl::OnlyDsl`
 
-error[E0599]: the method `only` exists for struct `SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>>`, but its trait bounds were not satisfied
+error[E0599]: the method `only` exists for struct `SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<BigInt, i64>>>>>`, but its trait bounds were not satisfied
   --> tests/fail/only_only_on_table.rs:14:54
    |
 14 |       foo::table.select(foo::id).filter(foo::id.eq(1)).only();
-   |                                                        ^^^^ method cannot be called on `SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>>` due to unsatisfied trait bounds
+   |                                                        ^^^^ method cannot be called on `SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<BigInt, i64>>>>>` due to unsatisfied trait bounds
    |
   ::: $DIESEL/src/query_builder/select_statement/mod.rs
    |
-   | / pub struct SelectStatement<
-   | |     From,
-   | |     Select = DefaultSelectClause<From>,
-   | |     Distinct = NoDistinctClause,
+   | / #[diesel_derives::__diesel_public_if(
+   | |     feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes",
+   | |     public_fields(
+   | |         select,
 ...  |
-   | |     pub(crate) locking: Locking,
-   | | }
-   | | -
-   | | |
-   | |_doesn't satisfy `_: Table`
-   |   doesn't satisfy `_: diesel::dsl::OnlyDsl`
+   | |     )
+   | | )]
+   | |  -
+   | |  |
+   | |__doesn't satisfy `_: Table`
+   |    doesn't satisfy `_: diesel::dsl::OnlyDsl`
    |
    = note: the following trait bounds were not satisfied:
-           `SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>>: Table`
-           which is required by `SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>>: diesel::dsl::OnlyDsl`
-           `&SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>>: Table`
-           which is required by `&SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>>: diesel::dsl::OnlyDsl`
-           `&mut SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>>: Table`
-           which is required by `&mut SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<BigInt, i64>>>>>: diesel::dsl::OnlyDsl`
+           `SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<BigInt, i64>>>>>: Table`
+           which is required by `SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<BigInt, i64>>>>>: diesel::dsl::OnlyDsl`
+           `&SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<BigInt, i64>>>>>: Table`
+           which is required by `&SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<BigInt, i64>>>>>: diesel::dsl::OnlyDsl`
+           `&mut SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<BigInt, i64>>>>>: Table`
+           which is required by `&mut SelectStatement<FromClause<foo::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<BigInt, i64>>>>>: diesel::dsl::OnlyDsl`
 
 error[E0599]: the method `only` exists for struct `columns::id`, but its trait bounds were not satisfied
   --> tests/fail/only_only_on_table.rs:15:31
@@ -64,7 +64,7 @@ error[E0599]: the method `only` exists for struct `columns::id`, but its trait b
 10 | | }
    | | -
    | | |
-   | | method `only` not found for this
+   | | method `only` not found for this struct
    | |_doesn't satisfy `columns::id: Table`
    |   doesn't satisfy `columns::id: diesel::dsl::OnlyDsl`
 ...
@@ -78,19 +78,42 @@ error[E0599]: the method `only` exists for struct `columns::id`, but its trait b
            which is required by `&columns::id: diesel::dsl::OnlyDsl`
            `&mut columns::id: Table`
            which is required by `&mut columns::id: diesel::dsl::OnlyDsl`
-
-error[E0271]: type mismatch resolving `<diesel::SqliteConnection as diesel::Connection>::Backend == Pg`
-  --> tests/fail/only_only_on_table.rs:19:23
+note: the following trait must be implemented
+  --> $DIESEL/src/query_source/mod.rs
    |
-19 |     foo::table.only().load(&mut conn).unwrap();
-   |                       ^^^^ expected struct `Sqlite`, found struct `Pg`
-   |
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `Only<foo::table>`
+   | pub trait Table: QuerySource + AsQuery + Sized {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0271]: type mismatch resolving `<diesel::MysqlConnection as diesel::Connection>::Backend == Pg`
-  --> tests/fail/only_only_on_table.rs:23:23
-   |
-23 |     foo::table.only().load(&mut conn).unwrap();
-   |                       ^^^^ expected struct `Mysql`, found struct `Pg`
-   |
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, _>` for `Only<foo::table>`
+error[E0277]: the trait bound `Only<foo::table>: QueryFragment<Sqlite>` is not satisfied
+    --> tests/fail/only_only_on_table.rs:19:23
+     |
+19   |     foo::table.only().load(&mut conn).unwrap();
+     |                       ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `Only<foo::table>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `Only<S>`
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `FromClause<Only<foo::table>>`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<Only<foo::table>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `Only<foo::table>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+
+error[E0277]: the trait bound `Only<foo::table>: QueryFragment<Mysql>` is not satisfied
+    --> tests/fail/only_only_on_table.rs:23:23
+     |
+23   |     foo::table.only().load(&mut conn).unwrap();
+     |                       ^^^^ the trait `QueryFragment<Mysql>` is not implemented for `Only<foo::table>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `Only<S>`
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `FromClause<Only<foo::table>>`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `SelectStatement<FromClause<Only<foo::table>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, _>` for `Only<foo::table>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
diff --git a/diesel_compile_tests/tests/fail/order_requires_column_from_same_table.stderr b/diesel_compile_tests/tests/fail/order_requires_column_from_same_table.stderr
index e715e46d573c..0d1cf5376115 100644
--- a/diesel_compile_tests/tests/fail/order_requires_column_from_same_table.stderr
+++ b/diesel_compile_tests/tests/fail/order_requires_column_from_same_table.stderr
@@ -4,8 +4,7 @@ error[E0277]: the trait bound `FromClause<users::table>: AppearsInFromClause<pos
 18 |     let source = users::table.order(posts::id);
    |                               ^^^^^ the trait `AppearsInFromClause<posts::table>` is not implemented for `FromClause<users::table>`
    |
-   = help: the following implementations were found:
-             <FromClause<QS2> as AppearsInFromClause<QS1>>
+   = help: the trait `AppearsInFromClause<QS1>` is implemented for `FromClause<QS2>`
 note: required because of the requirements on the impl of `AppearsOnTable<FromClause<users::table>>` for `posts::columns::id`
   --> tests/fail/order_requires_column_from_same_table.rs:11:1
    |
@@ -16,4 +15,4 @@ note: required because of the requirements on the impl of `AppearsOnTable<FromCl
 15 | | }
    | |_^
    = note: required because of the requirements on the impl of `OrderDsl<posts::columns::id>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/ordering_functions_require_ord.stderr b/diesel_compile_tests/tests/fail/ordering_functions_require_ord.stderr
index 0a4cf3773654..ef5223754d57 100644
--- a/diesel_compile_tests/tests/fail/ordering_functions_require_ord.stderr
+++ b/diesel_compile_tests/tests/fail/ordering_functions_require_ord.stderr
@@ -4,6 +4,16 @@ error[E0277]: the trait bound `diesel::sql_types::Bool: SqlOrd` is not satisfied
 13 |     let source = stuff::table.select(max(stuff::b));
    |                                      ^^^ the trait `SqlOrd` is not implemented for `diesel::sql_types::Bool`
    |
+   = help: the following other types implement trait `SqlOrd`:
+             Array<T>
+             BigInt
+             Datetime
+             Interval
+             Nullable<T>
+             Unsigned<BigInt>
+             Unsigned<diesel::sql_types::Integer>
+             Unsigned<diesel::sql_types::SmallInt>
+           and 9 others
    = note: required because of the requirements on the impl of `diesel::expression::functions::aggregate_ordering::private::SqlOrdAggregate` for `diesel::sql_types::Bool`
 note: required by a bound in `diesel::dsl::max`
   --> $DIESEL/src/expression/functions/aggregate_ordering.rs
@@ -12,11 +22,21 @@ note: required by a bound in `diesel::dsl::max`
    |                ^^^^^^^^^^^^^^^ required by this bound in `diesel::dsl::max`
 
 error[E0277]: the trait bound `diesel::sql_types::Bool: SqlOrd` is not satisfied
-  --> tests/fail/ordering_functions_require_ord.rs:13:38
+  --> tests/fail/ordering_functions_require_ord.rs:13:31
    |
 13 |     let source = stuff::table.select(max(stuff::b));
-   |                                      ^^^^^^^^^^^^^ the trait `SqlOrd` is not implemented for `diesel::sql_types::Bool`
+   |                               ^^^^^^ the trait `SqlOrd` is not implemented for `diesel::sql_types::Bool`
    |
+   = help: the following other types implement trait `SqlOrd`:
+             Array<T>
+             BigInt
+             Datetime
+             Interval
+             Nullable<T>
+             Unsigned<BigInt>
+             Unsigned<diesel::sql_types::Integer>
+             Unsigned<diesel::sql_types::SmallInt>
+           and 9 others
    = note: required because of the requirements on the impl of `diesel::expression::functions::aggregate_ordering::private::SqlOrdAggregate` for `diesel::sql_types::Bool`
    = note: required because of the requirements on the impl of `diesel::Expression` for `diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Bool, columns::b>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Bool, columns::b>>` for `stuff::table`
@@ -27,6 +47,16 @@ error[E0277]: the trait bound `diesel::sql_types::Bool: SqlOrd` is not satisfied
 14 |     let source = stuff::table.select(min(stuff::b));
    |                                      ^^^ the trait `SqlOrd` is not implemented for `diesel::sql_types::Bool`
    |
+   = help: the following other types implement trait `SqlOrd`:
+             Array<T>
+             BigInt
+             Datetime
+             Interval
+             Nullable<T>
+             Unsigned<BigInt>
+             Unsigned<diesel::sql_types::Integer>
+             Unsigned<diesel::sql_types::SmallInt>
+           and 9 others
    = note: required because of the requirements on the impl of `diesel::expression::functions::aggregate_ordering::private::SqlOrdAggregate` for `diesel::sql_types::Bool`
 note: required by a bound in `diesel::dsl::min`
   --> $DIESEL/src/expression/functions/aggregate_ordering.rs
@@ -35,11 +65,21 @@ note: required by a bound in `diesel::dsl::min`
    |                ^^^^^^^^^^^^^^^ required by this bound in `diesel::dsl::min`
 
 error[E0277]: the trait bound `diesel::sql_types::Bool: SqlOrd` is not satisfied
-  --> tests/fail/ordering_functions_require_ord.rs:14:38
+  --> tests/fail/ordering_functions_require_ord.rs:14:31
    |
 14 |     let source = stuff::table.select(min(stuff::b));
-   |                                      ^^^^^^^^^^^^^ the trait `SqlOrd` is not implemented for `diesel::sql_types::Bool`
+   |                               ^^^^^^ the trait `SqlOrd` is not implemented for `diesel::sql_types::Bool`
    |
+   = help: the following other types implement trait `SqlOrd`:
+             Array<T>
+             BigInt
+             Datetime
+             Interval
+             Nullable<T>
+             Unsigned<BigInt>
+             Unsigned<diesel::sql_types::Integer>
+             Unsigned<diesel::sql_types::SmallInt>
+           and 9 others
    = note: required because of the requirements on the impl of `diesel::expression::functions::aggregate_ordering::private::SqlOrdAggregate` for `diesel::sql_types::Bool`
    = note: required because of the requirements on the impl of `diesel::Expression` for `diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Bool, columns::b>`
    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Bool, columns::b>>` for `stuff::table`
diff --git a/diesel_compile_tests/tests/fail/pg_on_conflict_requires_valid_conflict_target.stderr b/diesel_compile_tests/tests/fail/pg_on_conflict_requires_valid_conflict_target.stderr
index cf26e8fb8fe7..2a289056864d 100644
--- a/diesel_compile_tests/tests/fail/pg_on_conflict_requires_valid_conflict_target.stderr
+++ b/diesel_compile_tests/tests/fail/pg_on_conflict_requires_valid_conflict_target.stderr
@@ -1,21 +1,57 @@
 error[E0271]: type mismatch resolving `<posts::columns::id as Column>::Table == users::table`
-  --> $DIR/pg_on_conflict_requires_valid_conflict_target.rs:38:10
-   |
-38 |         .on_conflict(posts::id);
-   |          ^^^^^^^^^^^ expected struct `posts::table`, found struct `users::table`
+   --> tests/fail/pg_on_conflict_requires_valid_conflict_target.rs:38:10
+    |
+38  |         .on_conflict(posts::id);
+    |          ^^^^^^^^^^^ expected struct `users::table`, found struct `posts::table`
+    |
+note: required by a bound in `upsert::on_conflict_extension::<impl InsertStatement<T, U, Op, Ret>>::on_conflict`
+   --> $DIESEL/src/upsert/on_conflict_extension.rs
+    |
+    |         ConflictTarget<Target>: OnConflictTarget<T>,
+    |                                 ^^^^^^^^^^^^^^^^^^^ required by this bound in `upsert::on_conflict_extension::<impl InsertStatement<T, U, Op, Ret>>::on_conflict`
 
 error[E0277]: the trait bound `lower::lower<posts::columns::title>: Column` is not satisfied
-  --> $DIR/pg_on_conflict_requires_valid_conflict_target.rs:42:22
-   |
-42 |         .on_conflict(lower(posts::title));
-   |                      ^^^^^^^^^^^^^^^^^^^ the trait `Column` is not implemented for `lower::lower<posts::columns::title>`
-   |
-   = note: required because of the requirements on the impl of `diesel::query_builder::upsert::on_conflict_target::OnConflictTarget<users::table>` for `diesel::query_builder::upsert::on_conflict_target::ConflictTarget<lower::lower<posts::columns::title>>`
+   --> tests/fail/pg_on_conflict_requires_valid_conflict_target.rs:42:10
+    |
+42  |         .on_conflict(lower(posts::title));
+    |          ^^^^^^^^^^^ the trait `Column` is not implemented for `lower::lower<posts::columns::title>`
+    |
+    = help: the following other types implement trait `Column`:
+              pg::metadata_lookup::pg_namespace::columns::nspname
+              pg::metadata_lookup::pg_namespace::columns::oid
+              pg::metadata_lookup::pg_type::columns::oid
+              pg::metadata_lookup::pg_type::columns::typarray
+              pg::metadata_lookup::pg_type::columns::typname
+              pg::metadata_lookup::pg_type::columns::typnamespace
+              posts::columns::id
+              posts::columns::title
+            and 2 others
+    = note: required because of the requirements on the impl of `diesel::query_builder::upsert::on_conflict_target::OnConflictTarget<users::table>` for `diesel::query_builder::upsert::on_conflict_target::ConflictTarget<lower::lower<posts::columns::title>>`
+note: required by a bound in `upsert::on_conflict_extension::<impl InsertStatement<T, U, Op, Ret>>::on_conflict`
+   --> $DIESEL/src/upsert/on_conflict_extension.rs
+    |
+    |         ConflictTarget<Target>: OnConflictTarget<T>,
+    |                                 ^^^^^^^^^^^^^^^^^^^ required by this bound in `upsert::on_conflict_extension::<impl InsertStatement<T, U, Op, Ret>>::on_conflict`
 
 error[E0277]: the trait bound `&str: Column` is not satisfied
-  --> $DIR/pg_on_conflict_requires_valid_conflict_target.rs:46:22
-   |
-46 |         .on_conflict("id");
-   |                      ^^^^ the trait `Column` is not implemented for `&str`
-   |
-   = note: required because of the requirements on the impl of `diesel::query_builder::upsert::on_conflict_target::OnConflictTarget<users::table>` for `diesel::query_builder::upsert::on_conflict_target::ConflictTarget<&str>`
+   --> tests/fail/pg_on_conflict_requires_valid_conflict_target.rs:46:10
+    |
+46  |         .on_conflict("id");
+    |          ^^^^^^^^^^^ the trait `Column` is not implemented for `&str`
+    |
+    = help: the following other types implement trait `Column`:
+              pg::metadata_lookup::pg_namespace::columns::nspname
+              pg::metadata_lookup::pg_namespace::columns::oid
+              pg::metadata_lookup::pg_type::columns::oid
+              pg::metadata_lookup::pg_type::columns::typarray
+              pg::metadata_lookup::pg_type::columns::typname
+              pg::metadata_lookup::pg_type::columns::typnamespace
+              posts::columns::id
+              posts::columns::title
+            and 2 others
+    = note: required because of the requirements on the impl of `diesel::query_builder::upsert::on_conflict_target::OnConflictTarget<users::table>` for `diesel::query_builder::upsert::on_conflict_target::ConflictTarget<&str>`
+note: required by a bound in `upsert::on_conflict_extension::<impl InsertStatement<T, U, Op, Ret>>::on_conflict`
+   --> $DIESEL/src/upsert/on_conflict_extension.rs
+    |
+    |         ConflictTarget<Target>: OnConflictTarget<T>,
+    |                                 ^^^^^^^^^^^^^^^^^^^ required by this bound in `upsert::on_conflict_extension::<impl InsertStatement<T, U, Op, Ret>>::on_conflict`
diff --git a/diesel_compile_tests/tests/fail/pg_specific_binary_expressions_only_usable_with_pg.stderr b/diesel_compile_tests/tests/fail/pg_specific_binary_expressions_only_usable_with_pg.stderr
index 329e659f6af0..e0ae781403cf 100644
--- a/diesel_compile_tests/tests/fail/pg_specific_binary_expressions_only_usable_with_pg.stderr
+++ b/diesel_compile_tests/tests/fail/pg_specific_binary_expressions_only_usable_with_pg.stderr
@@ -1,15 +1,101 @@
-error[E0271]: type mismatch resolving `<diesel::SqliteConnection as diesel::Connection>::Backend == Pg`
-  --> tests/fail/pg_specific_binary_expressions_only_usable_with_pg.rs:21:10
-   |
-21 |         .get_result::<Vec<u8>>(&mut connection).unwrap();
-   |          ^^^^^^^^^^ expected struct `Sqlite`, found struct `Pg`
-   |
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, Vec<u8>>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
-
-error[E0271]: type mismatch resolving `<diesel::MysqlConnection as diesel::Connection>::Backend == Pg`
-  --> tests/fail/pg_specific_binary_expressions_only_usable_with_pg.rs:29:10
-   |
-29 |         .get_result::<Vec<u8>>(&mut connection).unwrap();
-   |          ^^^^^^^^^^ expected struct `Mysql`, found struct `Pg`
-   |
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, Vec<u8>>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+error[E0277]: the trait bound `diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>: QueryFragment<Sqlite>` is not satisfied
+    --> tests/fail/pg_specific_binary_expressions_only_usable_with_pg.rs:21:10
+     |
+21   |         .get_result::<Vec<u8>>(&mut connection).unwrap();
+     |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `diesel::pg::expression::operators::ConcatBinary<T, U>`
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>`
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, Vec<u8>>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
+
+error[E0277]: the trait bound `diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>: QueryFragment<Sqlite>` is not satisfied
+    --> tests/fail/pg_specific_binary_expressions_only_usable_with_pg.rs:21:10
+     |
+21   |         .get_result::<Vec<u8>>(&mut connection).unwrap();
+     |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `diesel::pg::expression::operators::LikeBinary<T, U>`
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>`
+     = note: 5 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, Vec<u8>>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
+
+error[E0277]: the trait bound `diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>: QueryFragment<Sqlite>` is not satisfied
+    --> tests/fail/pg_specific_binary_expressions_only_usable_with_pg.rs:21:10
+     |
+21   |         .get_result::<Vec<u8>>(&mut connection).unwrap();
+     |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `diesel::pg::expression::operators::NotLikeBinary<T, U>`
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>`
+     = note: 5 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, Vec<u8>>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
+
+error[E0277]: the trait bound `diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>: QueryFragment<Mysql>` is not satisfied
+    --> tests/fail/pg_specific_binary_expressions_only_usable_with_pg.rs:29:10
+     |
+29   |         .get_result::<Vec<u8>>(&mut connection).unwrap();
+     |          ^^^^^^^^^^ the trait `QueryFragment<Mysql>` is not implemented for `diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `diesel::pg::expression::operators::ConcatBinary<T, U>`
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>`
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, Vec<u8>>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
+
+error[E0277]: the trait bound `diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>: QueryFragment<Mysql>` is not satisfied
+    --> tests/fail/pg_specific_binary_expressions_only_usable_with_pg.rs:29:10
+     |
+29   |         .get_result::<Vec<u8>>(&mut connection).unwrap();
+     |          ^^^^^^^^^^ the trait `QueryFragment<Mysql>` is not implemented for `diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `diesel::pg::expression::operators::LikeBinary<T, U>`
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>`
+     = note: 5 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, Vec<u8>>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
+
+error[E0277]: the trait bound `diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>: QueryFragment<Mysql>` is not satisfied
+    --> tests/fail/pg_specific_binary_expressions_only_usable_with_pg.rs:29:10
+     |
+29   |         .get_result::<Vec<u8>>(&mut connection).unwrap();
+     |          ^^^^^^^^^^ the trait `QueryFragment<Mysql>` is not implemented for `diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `diesel::pg::expression::operators::NotLikeBinary<T, U>`
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>`
+     = note: 5 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Mysql>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::MysqlConnection, Vec<u8>>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::ConcatBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::And<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::LikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>, diesel::expression::grouped::Grouped<diesel::pg::expression::operators::NotLikeBinary<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Binary, Vec<u8>>>>>>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
diff --git a/diesel_compile_tests/tests/fail/pg_specific_expressions_cant_be_used_in_a_sqlite_query.stderr b/diesel_compile_tests/tests/fail/pg_specific_expressions_cant_be_used_in_a_sqlite_query.stderr
index 4fa6932778f3..c6f69c939f95 100644
--- a/diesel_compile_tests/tests/fail/pg_specific_expressions_cant_be_used_in_a_sqlite_query.stderr
+++ b/diesel_compile_tests/tests/fail/pg_specific_expressions_cant_be_used_in_a_sqlite_query.stderr
@@ -6,35 +6,62 @@ warning: use of deprecated function `diesel::dsl::any`: Use `ExpressionMethods::
    |
    = note: `#[warn(deprecated)]` on by default
 
-error[E0271]: type mismatch resolving `<diesel::SqliteConnection as diesel::Connection>::Backend == Pg`
-  --> tests/fail/pg_specific_expressions_cant_be_used_in_a_sqlite_query.rs:27:10
-   |
-27 |         .load::<i32>(&mut connection);
-   |          ^^^^ expected struct `Sqlite`, found struct `Pg`
-   |
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, i32>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::pg::expression::array_comparison::Any<diesel::internal::derives::as_expression::Bound<Array<diesel::sql_types::Text>, Vec<std::string::String>>>>>>>`
+error[E0277]: the trait bound `diesel::pg::expression::array_comparison::Any<diesel::expression::bound::Bound<Array<diesel::sql_types::Text>, Vec<std::string::String>>>: QueryFragment<Sqlite>` is not satisfied
+    --> tests/fail/pg_specific_expressions_cant_be_used_in_a_sqlite_query.rs:27:10
+     |
+27   |         .load::<i32>(&mut connection);
+     |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::pg::expression::array_comparison::Any<diesel::expression::bound::Bound<Array<diesel::sql_types::Text>, Vec<std::string::String>>>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `diesel::pg::expression::array_comparison::Any<Expr>`
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::expression::operators::Eq<columns::name, diesel::pg::expression::array_comparison::Any<diesel::expression::bound::Bound<Array<diesel::sql_types::Text>, Vec<std::string::String>>>>`
+     = note: 4 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::pg::expression::array_comparison::Any<diesel::expression::bound::Bound<Array<diesel::sql_types::Text>, Vec<std::string::String>>>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, i32>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::pg::expression::array_comparison::Any<diesel::expression::bound::Bound<Array<diesel::sql_types::Text>, Vec<std::string::String>>>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
-error[E0271]: type mismatch resolving `<diesel::SqliteConnection as diesel::Connection>::Backend == Pg`
-  --> tests/fail/pg_specific_expressions_cant_be_used_in_a_sqlite_query.rs:29:10
-   |
-29 |         .load::<i32>(&mut connection);
-   |          ^^^^ expected struct `Sqlite`, found struct `Pg`
-   |
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, i32>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::IsNotDistinctFrom<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>>>`
+error[E0277]: the trait bound `diesel::pg::expression::operators::IsNotDistinctFrom<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>: QueryFragment<Sqlite>` is not satisfied
+    --> tests/fail/pg_specific_expressions_cant_be_used_in_a_sqlite_query.rs:29:10
+     |
+29   |         .load::<i32>(&mut connection);
+     |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::pg::expression::operators::IsNotDistinctFrom<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `diesel::pg::expression::operators::IsNotDistinctFrom<T, U>`
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::expression::grouped::Grouped<diesel::pg::expression::operators::IsNotDistinctFrom<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>`
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::IsNotDistinctFrom<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, i32>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::pg::expression::operators::IsNotDistinctFrom<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
-error[E0271]: type mismatch resolving `<diesel::SqliteConnection as diesel::Connection>::Backend == Pg`
-  --> tests/fail/pg_specific_expressions_cant_be_used_in_a_sqlite_query.rs:31:10
-   |
-31 |         .load::<i32>(&mut connection);
-   |          ^^^^ expected struct `Sqlite`, found struct `Pg`
-   |
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, i32>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<diesel::dsl::now, diesel::expression::grouped::Grouped<diesel::pg::expression::date_and_time::AtTimeZone<diesel::dsl::now, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>>>>>`
+error[E0277]: the trait bound `diesel::pg::expression::date_and_time::AtTimeZone<diesel::dsl::now, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>: QueryFragment<Sqlite>` is not satisfied
+    --> tests/fail/pg_specific_expressions_cant_be_used_in_a_sqlite_query.rs:31:10
+     |
+31   |         .load::<i32>(&mut connection);
+     |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::pg::expression::date_and_time::AtTimeZone<diesel::dsl::now, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>`
+     |
+     = help: the trait `QueryFragment<Pg>` is implemented for `diesel::pg::expression::date_and_time::AtTimeZone<Ts, Tz>`
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::expression::grouped::Grouped<diesel::pg::expression::date_and_time::AtTimeZone<diesel::dsl::now, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>`
+     = note: 5 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<diesel::dsl::now, diesel::expression::grouped::Grouped<diesel::pg::expression::date_and_time::AtTimeZone<diesel::dsl::now, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, i32>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<diesel::dsl::now, diesel::expression::grouped::Grouped<diesel::pg::expression::date_and_time::AtTimeZone<diesel::dsl::now, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
-error[E0599]: the method `execute` exists for struct `IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>`, but its trait bounds were not satisfied
+error[E0599]: the method `execute` exists for struct `IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>`, but its trait bounds were not satisfied
    --> tests/fail/pg_specific_expressions_cant_be_used_in_a_sqlite_query.rs:34:10
     |
 34  |         .execute(&mut connection);
-    |          ^^^^^^^ method cannot be called on `IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>` due to unsatisfied trait bounds
+    |          ^^^^^^^ method cannot be called on `IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>` due to unsatisfied trait bounds
     |
    ::: $DIESEL/src/upsert/on_conflict_extension.rs
     |
@@ -45,9 +72,9 @@ error[E0599]: the method `execute` exists for struct `IncompleteOnConflict<Inser
     | doesn't satisfy `_: diesel::RunQueryDsl<_>`
     |
     = note: the following trait bounds were not satisfied:
-            `IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: Table`
-            which is required by `IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: diesel::RunQueryDsl<_>`
-            `&IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: Table`
-            which is required by `&IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: diesel::RunQueryDsl<_>`
-            `&mut IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: Table`
-            which is required by `&mut IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: diesel::RunQueryDsl<_>`
+            `IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: Table`
+            which is required by `IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: diesel::RunQueryDsl<_>`
+            `&IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: Table`
+            which is required by `&IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: diesel::RunQueryDsl<_>`
+            `&mut IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: Table`
+            which is required by `&mut IncompleteOnConflict<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<OnConstraint<'_>>>: diesel::RunQueryDsl<_>`
diff --git a/diesel_compile_tests/tests/fail/pg_upsert_do_update_requires_valid_update.stderr b/diesel_compile_tests/tests/fail/pg_upsert_do_update_requires_valid_update.stderr
index dcf5f71cc953..18e516cab0ed 100644
--- a/diesel_compile_tests/tests/fail/pg_upsert_do_update_requires_valid_update.stderr
+++ b/diesel_compile_tests/tests/fail/pg_upsert_do_update_requires_valid_update.stderr
@@ -1,8 +1,8 @@
-error[E0599]: the method `execute` exists for struct `IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>`, but its trait bounds were not satisfied
+error[E0599]: the method `execute` exists for struct `IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>`, but its trait bounds were not satisfied
    --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:42:10
     |
 42  |         .execute(&mut connection);
-    |          ^^^^^^^ method cannot be called on `IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>` due to unsatisfied trait bounds
+    |          ^^^^^^^ method cannot be called on `IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>` due to unsatisfied trait bounds
     |
    ::: $DIESEL/src/upsert/on_conflict_extension.rs
     |
@@ -13,24 +13,32 @@ error[E0599]: the method `execute` exists for struct `IncompleteDoUpdate<InsertS
     | doesn't satisfy `_: diesel::RunQueryDsl<_>`
     |
     = note: the following trait bounds were not satisfied:
-            `IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: Table`
-            which is required by `IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: diesel::RunQueryDsl<_>`
-            `&IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: Table`
-            which is required by `&IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: diesel::RunQueryDsl<_>`
-            `&mut IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: Table`
-            which is required by `&mut IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: diesel::RunQueryDsl<_>`
+            `IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: Table`
+            which is required by `IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: diesel::RunQueryDsl<_>`
+            `&IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: Table`
+            which is required by `&IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: diesel::RunQueryDsl<_>`
+            `&mut IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: Table`
+            which is required by `&mut IncompleteDoUpdate<InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &&str>>>,), users::table>>, diesel::query_builder::upsert::on_conflict_target::ConflictTarget<users::columns::id>>: diesel::RunQueryDsl<_>`
 
-error[E0271]: type mismatch resolving `<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>> as AsChangeset>::Target == users::table`
-  --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:49:10
-   |
-49 |         .set(posts::title.eq("Sean"));
-   |          ^^^ expected struct `posts::table`, found struct `users::table`
+error[E0271]: type mismatch resolving `<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>> as AsChangeset>::Target == users::table`
+   --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:49:10
+    |
+49  |         .set(posts::title.eq("Sean"));
+    |          ^^^ expected struct `users::table`, found struct `posts::table`
+    |
+note: required by a bound in `IncompleteDoUpdate::<InsertStatement<T, U, Op, Ret>, Target>::set`
+   --> $DIESEL/src/upsert/on_conflict_extension.rs
+    |
+    |         Changes: AsChangeset<Target = T>,
+    |                              ^^^^^^^^^^ required by this bound in `IncompleteDoUpdate::<InsertStatement<T, U, Op, Ret>, Target>::set`
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
-  --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:56:10
+  --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:56:14
    |
 56 |         .set(name.eq(posts::title));
-   |          ^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
+   |          --- ^^^^^^^^^^^^^^^^^^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
+   |          |
+   |          required by a bound introduced by this call
    |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::title`
   --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:13:1
@@ -43,14 +51,23 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 18 | | }
    | |_^
    = note: required because of the requirements on the impl of `AsChangeset` for `diesel::expression::operators::Eq<users::columns::name, posts::columns::title>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
-  --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:56:10
+  --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:56:14
    |
 56 |         .set(name.eq(posts::title));
-   |          ^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
+   |          --- ^^^^^^^^^^^^^^^^^^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
+   |          |
+   |          required by a bound introduced by this call
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::title`
   --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:13:1
@@ -63,20 +80,24 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 18 | | }
    | |_^
    = note: required because of the requirements on the impl of `AsChangeset` for `diesel::expression::operators::Eq<users::columns::name, posts::columns::title>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<posts::columns::title as Column>::Table == users::table`
-  --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:63:10
+  --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:63:14
    |
 63 |         .set(name.eq(excluded(posts::title)));
-   |          ^^^ expected struct `posts::table`, found struct `users::table`
+   |          --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `posts::table`, found struct `users::table`
+   |          |
+   |          required by a bound introduced by this call
    |
    = note: required because of the requirements on the impl of `AsChangeset` for `diesel::expression::operators::Eq<users::columns::name, diesel::query_builder::upsert::on_conflict_actions::Excluded<posts::columns::title>>`
 
 error[E0271]: type mismatch resolving `<diesel::query_builder::upsert::on_conflict_actions::Excluded<users::columns::id> as diesel::Expression>::SqlType == diesel::sql_types::Text`
-  --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:70:19
+  --> tests/fail/pg_upsert_do_update_requires_valid_update.rs:70:22
    |
 70 |         .set(name.eq(excluded(id)));
-   |                   ^^ expected struct `diesel::sql_types::Integer`, found struct `diesel::sql_types::Text`
+   |                   -- ^^^^^^^^^^^^ expected struct `diesel::sql_types::Integer`, found struct `diesel::sql_types::Text`
+   |                   |
+   |                   required by a bound introduced by this call
    |
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Text>` for `diesel::query_builder::upsert::on_conflict_actions::Excluded<users::columns::id>`
diff --git a/diesel_compile_tests/tests/fail/returning_cannot_be_called_twice.stderr b/diesel_compile_tests/tests/fail/returning_cannot_be_called_twice.stderr
index 8d45a187ee93..17fd16575f02 100644
--- a/diesel_compile_tests/tests/fail/returning_cannot_be_called_twice.stderr
+++ b/diesel_compile_tests/tests/fail/returning_cannot_be_called_twice.stderr
@@ -1,16 +1,16 @@
-error[E0599]: no method named `returning` found for struct `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>>, diesel::query_builder::returning_clause::ReturningClause<columns::id>>` in the current scope
+error[E0599]: no method named `returning` found for struct `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>, diesel::query_builder::returning_clause::ReturningClause<columns::id>>` in the current scope
   --> tests/fail/returning_cannot_be_called_twice.rs:22:11
    |
 22 |     query.returning(name);
    |           ^^^^^^^^^ private field, not a method
 
-error[E0599]: no method named `returning` found for struct `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<columns::id>>` in the current scope
+error[E0599]: no method named `returning` found for struct `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<columns::id>>` in the current scope
   --> tests/fail/returning_cannot_be_called_twice.rs:27:11
    |
 27 |     query.returning(name);
    |           ^^^^^^^^^ private field, not a method
 
-error[E0599]: no method named `returning` found for struct `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<columns::id>>` in the current scope
+error[E0599]: no method named `returning` found for struct `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<columns::id>>` in the current scope
   --> tests/fail/returning_cannot_be_called_twice.rs:30:11
    |
 30 |     query.returning(name);
diff --git a/diesel_compile_tests/tests/fail/returning_clause_requires_selectable_expression.stderr b/diesel_compile_tests/tests/fail/returning_clause_requires_selectable_expression.stderr
index 87b9615b99f0..16c49f3feb3b 100644
--- a/diesel_compile_tests/tests/fail/returning_clause_requires_selectable_expression.stderr
+++ b/diesel_compile_tests/tests/fail/returning_clause_requires_selectable_expression.stderr
@@ -1,40 +1,84 @@
-error[E0277]: the trait bound `non_users::columns::noname: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/returning_clause_requires_selectable_expression.rs:27:20
-   |
-27 |         .returning(non_users::columns::noname);
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `non_users::columns::noname`
-   |
-   = help: the following implementations were found:
-             <non_users::columns::noname as SelectableExpression<JoinOn<Join, On>>>
-             <non_users::columns::noname as SelectableExpression<Only<non_users::table>>>
-             <non_users::columns::noname as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <non_users::columns::noname as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+error[E0277]: Cannot select `non_users::columns::noname` from `users::table`
+   --> tests/fail/returning_clause_requires_selectable_expression.rs:27:20
+    |
+27  |         .returning(non_users::columns::noname);
+    |          --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `non_users::columns::noname`
+    |          |
+    |          required by a bound introduced by this call
+    |
+    = note: `non_users::columns::noname` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
+              <non_users::columns::noname as SelectableExpression<JoinOn<Join, On>>>
+              <non_users::columns::noname as SelectableExpression<Only<non_users::table>>>
+              <non_users::columns::noname as SelectableExpression<SelectStatement<FromClause<From>>>>
+              <non_users::columns::noname as SelectableExpression<non_users::table>>
+              <non_users::columns::noname as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <non_users::columns::noname as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required by a bound in `DeleteStatement::<T, U>::returning`
+   --> $DIESEL/src/query_builder/delete_statement/mod.rs
+    |
+    |         E: SelectableExpression<T>,
+    |            ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `DeleteStatement::<T, U>::returning`
 
-error[E0277]: the trait bound `non_users::columns::noname: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/returning_clause_requires_selectable_expression.rs:31:20
-   |
-31 |         .returning(non_users::columns::noname);
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `non_users::columns::noname`
-   |
-   = help: the following implementations were found:
-             <non_users::columns::noname as SelectableExpression<JoinOn<Join, On>>>
-             <non_users::columns::noname as SelectableExpression<Only<non_users::table>>>
-             <non_users::columns::noname as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <non_users::columns::noname as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
-   = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<non_users::columns::noname>>`
+error[E0277]: Cannot select `non_users::columns::noname` from `users::table`
+   --> tests/fail/returning_clause_requires_selectable_expression.rs:27:10
+    |
+27  |         .returning(non_users::columns::noname);
+    |          ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `non_users::columns::noname`
+    |
+    = note: `non_users::columns::noname` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
+              <non_users::columns::noname as SelectableExpression<JoinOn<Join, On>>>
+              <non_users::columns::noname as SelectableExpression<Only<non_users::table>>>
+              <non_users::columns::noname as SelectableExpression<SelectStatement<FromClause<From>>>>
+              <non_users::columns::noname as SelectableExpression<non_users::table>>
+              <non_users::columns::noname as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <non_users::columns::noname as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+    = note: required because of the requirements on the impl of `Query` for `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>, diesel::query_builder::returning_clause::ReturningClause<non_users::columns::noname>>`
+note: required by a bound in `DeleteStatement::<T, U>::returning`
+   --> $DIESEL/src/query_builder/delete_statement/mod.rs
+    |
+    |         DeleteStatement<T, U, ReturningClause<E>>: Query,
+    |                                                    ^^^^^ required by this bound in `DeleteStatement::<T, U>::returning`
 
-error[E0277]: the trait bound `non_users::columns::noname: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/returning_clause_requires_selectable_expression.rs:35:20
-   |
-35 |         .returning(non_users::columns::noname);
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `non_users::columns::noname`
-   |
-   = help: the following implementations were found:
-             <non_users::columns::noname as SelectableExpression<JoinOn<Join, On>>>
-             <non_users::columns::noname as SelectableExpression<Only<non_users::table>>>
-             <non_users::columns::noname as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <non_users::columns::noname as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
-   = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<non_users::columns::noname>>`
+error[E0277]: Cannot select `non_users::columns::noname` from `users::table`
+   --> tests/fail/returning_clause_requires_selectable_expression.rs:31:10
+    |
+31  |         .returning(non_users::columns::noname);
+    |          ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `non_users::columns::noname`
+    |
+    = note: `non_users::columns::noname` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
+              <non_users::columns::noname as SelectableExpression<JoinOn<Join, On>>>
+              <non_users::columns::noname as SelectableExpression<Only<non_users::table>>>
+              <non_users::columns::noname as SelectableExpression<SelectStatement<FromClause<From>>>>
+              <non_users::columns::noname as SelectableExpression<non_users::table>>
+              <non_users::columns::noname as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <non_users::columns::noname as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &std::string::String>>>,), users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<non_users::columns::noname>>`
+note: required by a bound in `InsertStatement::<T, U, Op>::returning`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         InsertStatement<T, U, Op, ReturningClause<E>>: Query,
+    |                                                        ^^^^^ required by this bound in `InsertStatement::<T, U, Op>::returning`
+
+error[E0277]: Cannot select `non_users::columns::noname` from `users::table`
+   --> tests/fail/returning_clause_requires_selectable_expression.rs:35:10
+    |
+35  |         .returning(non_users::columns::noname);
+    |          ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `non_users::columns::noname`
+    |
+    = note: `non_users::columns::noname` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
+              <non_users::columns::noname as SelectableExpression<JoinOn<Join, On>>>
+              <non_users::columns::noname as SelectableExpression<Only<non_users::table>>>
+              <non_users::columns::noname as SelectableExpression<SelectStatement<FromClause<From>>>>
+              <non_users::columns::noname as SelectableExpression<non_users::table>>
+              <non_users::columns::noname as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <non_users::columns::noname as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<non_users::columns::noname>>`
+note: required by a bound in `UpdateStatement::<T, U, V>::returning`
+   --> $DIESEL/src/query_builder/update_statement/mod.rs
+    |
+    |         UpdateStatement<T, U, V, ReturningClause<E>>: Query,
+    |                                                       ^^^^^ required by this bound in `UpdateStatement::<T, U, V>::returning`
diff --git a/diesel_compile_tests/tests/fail/right_side_of_left_join_requires_nullable.stderr b/diesel_compile_tests/tests/fail/right_side_of_left_join_requires_nullable.stderr
index ae51ed3ca634..da69e19d2c49 100644
--- a/diesel_compile_tests/tests/fail/right_side_of_left_join_requires_nullable.stderr
+++ b/diesel_compile_tests/tests/fail/right_side_of_left_join_requires_nullable.stderr
@@ -4,27 +4,51 @@ error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<post
 40 |     let _ = join.select(posts::title);
    |                  ^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
    |
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
-   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
+   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:40:25
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:40:18
    |
 40 |     let _ = join.select(posts::title);
-   |                         ^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+   |                  ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::title` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::title as SelectableExpression<Only<posts::table>>>
              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
-   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+             <posts::columns::title as SelectableExpression<posts::table>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
+   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Never`
   --> tests/fail/right_side_of_left_join_requires_nullable.rs:46:18
@@ -32,33 +56,59 @@ error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<post
 46 |     let _ = join.select(lower(posts::title));
    |                  ^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
    |
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
-   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
+   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:46:25
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:46:18
    |
 46 |     let _ = join.select(lower(posts::title));
-   |                         ^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+   |                  ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::title` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::title as SelectableExpression<Only<posts::table>>>
              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+             <posts::columns::title as SelectableExpression<posts::table>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
-   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
+   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<NullableExpression<posts::columns::title> as diesel::Expression>::SqlType == diesel::sql_types::Text`
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:48:25
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:48:31
    |
 48 |     let _ = join.select(lower(posts::title.nullable()));
-   |                         ^^^^^ expected struct `diesel::sql_types::Text`, found struct `Nullable`
+   |                         ----- ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `diesel::sql_types::Text`, found struct `Nullable`
+   |                         |
+   |                         required by a bound introduced by this call
    |
    = note: expected struct `diesel::sql_types::Text`
               found struct `Nullable<diesel::sql_types::Text>`
@@ -67,7 +117,7 @@ note: required by a bound in `lower`
   --> tests/fail/right_side_of_left_join_requires_nullable.rs:32:1
    |
 32 | sql_function!(fn lower(x: Text) -> Text);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `lower`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `lower`
    = note: this error originates in the macro `sql_function` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<NullableExpression<posts::columns::title> as diesel::Expression>::SqlType == diesel::sql_types::Text`
@@ -86,27 +136,51 @@ error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<post
 57 |     let _ = join.select(posts::title);
    |                  ^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
    |
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
-   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
+   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:57:25
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:57:18
    |
 57 |     let _ = join.select(posts::title);
-   |                         ^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+   |                  ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::title` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::title as SelectableExpression<Only<posts::table>>>
              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+             <posts::columns::title as SelectableExpression<posts::table>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
-   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
+   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Never`
   --> tests/fail/right_side_of_left_join_requires_nullable.rs:63:18
@@ -114,33 +188,59 @@ error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<post
 63 |     let _ = join.select(lower(posts::title));
    |                  ^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
    |
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 4 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
-   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
+   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:63:25
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:63:18
    |
 63 |     let _ = join.select(lower(posts::title));
-   |                         ^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+   |                  ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::title` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::title as SelectableExpression<Only<posts::table>>>
              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+             <posts::columns::title as SelectableExpression<posts::table>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 4 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
-   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
+   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<NullableExpression<posts::columns::title> as diesel::Expression>::SqlType == diesel::sql_types::Text`
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:65:25
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:65:31
    |
 65 |     let _ = join.select(lower(posts::title.nullable()));
-   |                         ^^^^^ expected struct `diesel::sql_types::Text`, found struct `Nullable`
+   |                         ----- ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `diesel::sql_types::Text`, found struct `Nullable`
+   |                         |
+   |                         required by a bound introduced by this call
    |
    = note: expected struct `diesel::sql_types::Text`
               found struct `Nullable<diesel::sql_types::Text>`
@@ -149,7 +249,7 @@ note: required by a bound in `lower`
   --> tests/fail/right_side_of_left_join_requires_nullable.rs:32:1
    |
 32 | sql_function!(fn lower(x: Text) -> Text);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `lower`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `lower`
    = note: this error originates in the macro `sql_function` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<NullableExpression<posts::columns::title> as diesel::Expression>::SqlType == diesel::sql_types::Text`
@@ -168,27 +268,51 @@ error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<post
 74 |     let _ = join.select(posts::title);
    |                  ^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
    |
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
-   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
+   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:74:25
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:74:18
    |
 74 |     let _ = join.select(posts::title);
-   |                         ^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+   |                  ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::title` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::title as SelectableExpression<Only<posts::table>>>
              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+             <posts::columns::title as SelectableExpression<posts::table>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
-   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
+   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Never`
   --> tests/fail/right_side_of_left_join_requires_nullable.rs:80:18
@@ -196,33 +320,59 @@ error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<post
 80 |     let _ = join.select(lower(posts::title));
    |                  ^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
    |
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 4 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
-   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
+   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:80:25
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:80:18
    |
 80 |     let _ = join.select(lower(posts::title));
-   |                         ^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+   |                  ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::title` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::title as SelectableExpression<Only<posts::table>>>
              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+             <posts::columns::title as SelectableExpression<posts::table>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 4 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
-   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
+   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>, pets::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<NullableExpression<posts::columns::title> as diesel::Expression>::SqlType == diesel::sql_types::Text`
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:82:25
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:82:31
    |
 82 |     let _ = join.select(lower(posts::title.nullable()));
-   |                         ^^^^^ expected struct `diesel::sql_types::Text`, found struct `Nullable`
+   |                         ----- ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `diesel::sql_types::Text`, found struct `Nullable`
+   |                         |
+   |                         required by a bound introduced by this call
    |
    = note: expected struct `diesel::sql_types::Text`
               found struct `Nullable<diesel::sql_types::Text>`
@@ -231,7 +381,7 @@ note: required by a bound in `lower`
   --> tests/fail/right_side_of_left_join_requires_nullable.rs:32:1
    |
 32 | sql_function!(fn lower(x: Text) -> Text);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `lower`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `lower`
    = note: this error originates in the macro `sql_function` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<NullableExpression<posts::columns::title> as diesel::Expression>::SqlType == diesel::sql_types::Text`
@@ -244,67 +394,117 @@ error[E0271]: type mismatch resolving `<NullableExpression<posts::columns::title
               found struct `diesel::sql_types::Text`
    = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Text>` for `NullableExpression<posts::columns::title>`
 
-error[E0271]: type mismatch resolving `<SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>> as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Never`
+error[E0271]: type mismatch resolving `<SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>> as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Never`
   --> tests/fail/right_side_of_left_join_requires_nullable.rs:89:18
    |
 89 |     let _ = join.select(posts::title);
    |                  ^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
    |
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `posts::columns::title`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
-   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
+   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<pets::table>` is not satisfied
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:89:25
+error[E0277]: Cannot select `posts::columns::title` from `pets::table`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:89:18
    |
 89 |     let _ = join.select(posts::title);
-   |                         ^^^^^^^^^^^^ the trait `SelectableExpression<pets::table>` is not implemented for `posts::columns::title`
+   |                  ^^^^^^ the trait `SelectableExpression<pets::table>` is not implemented for `posts::columns::title`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::title` is no valid selection for `pets::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::title as SelectableExpression<Only<posts::table>>>
              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `posts::columns::title`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
-   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+             <posts::columns::title as SelectableExpression<posts::table>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
+   = note: 1 redundant requirement hidden
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
+   = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0271]: type mismatch resolving `<SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>> as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Never`
+error[E0271]: type mismatch resolving `<SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>> as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Never`
   --> tests/fail/right_side_of_left_join_requires_nullable.rs:95:18
    |
 95 |     let _ = join.select(lower(posts::title));
    |                  ^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
    |
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `posts::columns::title`
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
-   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
+   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<pets::table>` is not satisfied
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:95:25
+error[E0277]: Cannot select `posts::columns::title` from `pets::table`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:95:18
    |
 95 |     let _ = join.select(lower(posts::title));
-   |                         ^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<pets::table>` is not implemented for `posts::columns::title`
+   |                  ^^^^^^ the trait `SelectableExpression<pets::table>` is not implemented for `posts::columns::title`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::title` is no valid selection for `pets::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::title as SelectableExpression<Only<posts::table>>>
              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
-   = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `posts::columns::title`
+             <posts::columns::title as SelectableExpression<posts::table>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>>` for `posts::columns::title`
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
-   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
+   = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<NullableExpression<posts::columns::title> as diesel::Expression>::SqlType == diesel::sql_types::Text`
-  --> tests/fail/right_side_of_left_join_requires_nullable.rs:97:25
+  --> tests/fail/right_side_of_left_join_requires_nullable.rs:97:31
    |
 97 |     let _ = join.select(lower(posts::title.nullable()));
-   |                         ^^^^^ expected struct `diesel::sql_types::Text`, found struct `Nullable`
+   |                         ----- ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `diesel::sql_types::Text`, found struct `Nullable`
+   |                         |
+   |                         required by a bound introduced by this call
    |
    = note: expected struct `diesel::sql_types::Text`
               found struct `Nullable<diesel::sql_types::Text>`
@@ -313,7 +513,7 @@ note: required by a bound in `lower`
   --> tests/fail/right_side_of_left_join_requires_nullable.rs:32:1
    |
 32 | sql_function!(fn lower(x: Text) -> Text);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `lower`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `lower`
    = note: this error originates in the macro `sql_function` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<NullableExpression<posts::columns::title> as diesel::Expression>::SqlType == diesel::sql_types::Text`
@@ -332,27 +532,51 @@ error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<post
 104 |     let _ = join.select(posts::title);
     |                  ^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
     |
-    = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+   --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+    |
+13  | / table! {
+14  | |     posts {
+15  | |         id -> Integer,
+16  | |         title -> Text,
+17  | |         user_id -> Integer,
+18  | |     }
+19  | | }
+    | |_^
     = note: 4 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
-    = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
+    = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/right_side_of_left_join_requires_nullable.rs:104:25
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+   --> tests/fail/right_side_of_left_join_requires_nullable.rs:104:18
     |
 104 |     let _ = join.select(posts::title);
-    |                         ^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+    |                  ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
     |
-    = help: the following implementations were found:
+    = note: `posts::columns::title` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
               <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
               <posts::columns::title as SelectableExpression<Only<posts::table>>>
               <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+              <posts::columns::title as SelectableExpression<posts::table>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+   --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+    |
+13  | / table! {
+14  | |     posts {
+15  | |         id -> Integer,
+16  | |         title -> Text,
+17  | |         user_id -> Integer,
+18  | |     }
+19  | | }
+    | |_^
     = note: 4 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
-    = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `posts::columns::title`
+    = note: required because of the requirements on the impl of `SelectDsl<posts::columns::title>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Never`
    --> tests/fail/right_side_of_left_join_requires_nullable.rs:110:18
@@ -360,33 +584,59 @@ error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<post
 110 |     let _ = join.select(lower(posts::title));
     |                  ^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
     |
-    = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+   --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+    |
+13  | / table! {
+14  | |     posts {
+15  | |         id -> Integer,
+16  | |         title -> Text,
+17  | |         user_id -> Integer,
+18  | |     }
+19  | | }
+    | |_^
     = note: 5 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
-    = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
+    = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/right_side_of_left_join_requires_nullable.rs:110:25
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+   --> tests/fail/right_side_of_left_join_requires_nullable.rs:110:18
     |
 110 |     let _ = join.select(lower(posts::title));
-    |                         ^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+    |                  ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
     |
-    = help: the following implementations were found:
+    = note: `posts::columns::title` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
               <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
               <posts::columns::title as SelectableExpression<Only<posts::table>>>
               <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+              <posts::columns::title as SelectableExpression<posts::table>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+   --> tests/fail/right_side_of_left_join_requires_nullable.rs:13:1
+    |
+13  | / table! {
+14  | |     posts {
+15  | |         id -> Integer,
+16  | |         title -> Text,
+17  | |         user_id -> Integer,
+18  | |     }
+19  | | }
+    | |_^
     = note: 5 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
-    = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<pets::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `lower::lower<posts::columns::title>`
+    = note: required because of the requirements on the impl of `SelectDsl<lower::lower<posts::columns::title>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<pets::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<pets::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<NullableExpression<posts::columns::title> as diesel::Expression>::SqlType == diesel::sql_types::Text`
-   --> tests/fail/right_side_of_left_join_requires_nullable.rs:112:25
+   --> tests/fail/right_side_of_left_join_requires_nullable.rs:112:31
     |
 112 |     let _ = join.select(lower(posts::title.nullable()));
-    |                         ^^^^^ expected struct `diesel::sql_types::Text`, found struct `Nullable`
+    |                         ----- ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `diesel::sql_types::Text`, found struct `Nullable`
+    |                         |
+    |                         required by a bound introduced by this call
     |
     = note: expected struct `diesel::sql_types::Text`
                found struct `Nullable<diesel::sql_types::Text>`
@@ -395,7 +645,7 @@ note: required by a bound in `lower`
    --> tests/fail/right_side_of_left_join_requires_nullable.rs:32:1
     |
 32  | sql_function!(fn lower(x: Text) -> Text);
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `lower`
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `lower`
     = note: this error originates in the macro `sql_function` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<NullableExpression<posts::columns::title> as diesel::Expression>::SqlType == diesel::sql_types::Text`
diff --git a/diesel_compile_tests/tests/fail/select_carries_correct_result_type_info.stderr b/diesel_compile_tests/tests/fail/select_carries_correct_result_type_info.stderr
index 8be4f743dc4d..5991e651d4db 100644
--- a/diesel_compile_tests/tests/fail/select_carries_correct_result_type_info.stderr
+++ b/diesel_compile_tests/tests/fail/select_carries_correct_result_type_info.stderr
@@ -1,31 +1,51 @@
 error[E0277]: the trait bound `i32: FromSql<diesel::sql_types::Text, _>` is not satisfied
-  --> tests/fail/select_carries_correct_result_type_info.rs:19:27
-   |
-19 |     let ids = select_name.load::<i32>(&mut connection);
-   |                           ^^^^ the trait `FromSql<diesel::sql_types::Text, _>` is not implemented for `i32`
-   |
-   = help: the following implementations were found:
-             <i32 as FromSql<diesel::sql_types::Integer, Mysql>>
-             <i32 as FromSql<diesel::sql_types::Integer, Pg>>
-             <i32 as FromSql<diesel::sql_types::Integer, Sqlite>>
-   = note: required because of the requirements on the impl of `Queryable<diesel::sql_types::Text, _>` for `i32`
-   = note: required because of the requirements on the impl of `FromSqlRow<diesel::sql_types::Text, _>` for `i32`
-   = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<i32, _>` for `diesel::sql_types::Text`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, i32>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::name>>`
+    --> tests/fail/select_carries_correct_result_type_info.rs:19:27
+     |
+19   |     let ids = select_name.load::<i32>(&mut connection);
+     |                           ^^^^ the trait `FromSql<diesel::sql_types::Text, _>` is not implemented for `i32`
+     |
+     = help: the following other types implement trait `FromSql<A, DB>`:
+               <f32 as FromSql<diesel::sql_types::Float, Mysql>>
+               <f32 as FromSql<diesel::sql_types::Float, Pg>>
+               <f32 as FromSql<diesel::sql_types::Float, Sqlite>>
+               <f64 as FromSql<diesel::sql_types::Double, Mysql>>
+               <f64 as FromSql<diesel::sql_types::Double, Pg>>
+               <f64 as FromSql<diesel::sql_types::Double, Sqlite>>
+               <i16 as FromSql<diesel::sql_types::SmallInt, Mysql>>
+               <i16 as FromSql<diesel::sql_types::SmallInt, Pg>>
+             and 13 others
+     = note: required because of the requirements on the impl of `Queryable<diesel::sql_types::Text, _>` for `i32`
+     = note: required because of the requirements on the impl of `FromSqlRow<diesel::sql_types::Text, _>` for `i32`
+     = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<i32, _>` for `diesel::sql_types::Text`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, i32>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::name>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `*const str: FromSql<diesel::sql_types::Integer, _>` is not satisfied
-  --> tests/fail/select_carries_correct_result_type_info.rs:20:27
-   |
-20 |     let names = select_id.load::<String>(&mut connection);
-   |                           ^^^^ the trait `FromSql<diesel::sql_types::Integer, _>` is not implemented for `*const str`
-   |
-   = help: the following implementations were found:
-             <*const [u8] as FromSql<diesel::sql_types::Binary, Pg>>
-             <*const [u8] as FromSql<diesel::sql_types::Binary, Sqlite>>
-             <*const str as FromSql<diesel::sql_types::Text, Pg>>
-             <*const str as FromSql<diesel::sql_types::Text, Sqlite>>
-   = note: required because of the requirements on the impl of `FromSql<diesel::sql_types::Integer, _>` for `std::string::String`
-   = note: required because of the requirements on the impl of `Queryable<diesel::sql_types::Integer, _>` for `std::string::String`
-   = note: required because of the requirements on the impl of `FromSqlRow<diesel::sql_types::Integer, _>` for `std::string::String`
-   = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<std::string::String, _>` for `diesel::sql_types::Integer`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, std::string::String>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>>`
+    --> tests/fail/select_carries_correct_result_type_info.rs:20:27
+     |
+20   |     let names = select_id.load::<String>(&mut connection);
+     |                           ^^^^ the trait `FromSql<diesel::sql_types::Integer, _>` is not implemented for `*const str`
+     |
+     = help: the following other types implement trait `FromSql<A, DB>`:
+               <*const str as FromSql<diesel::sql_types::Text, Mysql>>
+               <*const str as FromSql<diesel::sql_types::Text, Pg>>
+               <*const str as FromSql<diesel::sql_types::Text, Sqlite>>
+               <std::string::String as FromSql<ST, DB>>
+               <std::string::String as FromSql<TimestamptzSqlite, Sqlite>>
+               <std::string::String as FromSql<diesel::sql_types::Date, Sqlite>>
+               <std::string::String as FromSql<diesel::sql_types::Time, Sqlite>>
+               <std::string::String as FromSql<diesel::sql_types::Timestamp, Sqlite>>
+     = note: required because of the requirements on the impl of `FromSql<diesel::sql_types::Integer, _>` for `std::string::String`
+     = note: required because of the requirements on the impl of `Queryable<diesel::sql_types::Integer, _>` for `std::string::String`
+     = note: required because of the requirements on the impl of `FromSqlRow<diesel::sql_types::Integer, _>` for `std::string::String`
+     = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<std::string::String, _>` for `diesel::sql_types::Integer`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, std::string::String>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<columns::id>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
diff --git a/diesel_compile_tests/tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.stderr b/diesel_compile_tests/tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.stderr
index dc57f4f5fcc6..2cdbf2f5833b 100644
--- a/diesel_compile_tests/tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.stderr
+++ b/diesel_compile_tests/tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.stderr
@@ -14,6 +14,11 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 14 |     users.for_update().distinct();
    |                        ^^^^^^^^ the trait `Table` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
    |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             users::table
    = note: required because of the requirements on the impl of `DistinctDsl` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
 
 error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>: DistinctDsl` is not satisfied
@@ -22,8 +27,7 @@ error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromCl
 14 |     users.for_update().distinct();
    |                        ^^^^^^^^ the trait `DistinctDsl` is not implemented for `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<F, S, D, W, O, LOf, G, H> as DistinctDsl>
+   = help: the trait `DistinctDsl` is implemented for `SelectStatement<F, S, D, W, O, LOf, G, H>`
 
 error[E0271]: type mismatch resolving `<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::DistinctClause> as AsQuery>::Query == SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::DistinctClause>>>`
   --> tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.rs:15:22
@@ -41,6 +45,11 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 15 |     users.distinct().for_update();
    |                      ^^^^^^^^^^ the trait `Table` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::DistinctClause>`
    |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             users::table
    = note: required because of the requirements on the impl of `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::DistinctClause>`
 
 error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::DistinctClause>>>: LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not satisfied
@@ -49,8 +58,7 @@ error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromCl
 15 |     users.distinct().for_update();
    |                      ^^^^^^^^^^ the trait `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not implemented for `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::DistinctClause>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<F, S, diesel::query_builder::distinct_clause::NoDistinctClause, W, O, LOf> as LockingDsl<Lock>>
+   = help: the trait `LockingDsl<Lock>` is implemented for `SelectStatement<F, S, diesel::query_builder::distinct_clause::NoDistinctClause, W, O, LOf>`
 
 error[E0271]: type mismatch resolving `<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause> as AsQuery>::Query == SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>`
   --> tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.rs:16:24
@@ -68,6 +76,11 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 16 |     users.for_update().distinct_on(id);
    |                        ^^^^^^^^^^^ the trait `Table` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
    |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             users::table
    = note: required because of the requirements on the impl of `DistinctOnDsl<_>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
 
 error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>: DistinctOnDsl<_>` is not satisfied
@@ -76,22 +89,23 @@ error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromCl
 16 |     users.for_update().distinct_on(id);
    |                        ^^^^^^^^^^^ the trait `DistinctOnDsl<_>` is not implemented for `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H> as DistinctOnDsl<Selection>>
+   = help: the trait `DistinctOnDsl<Selection>` is implemented for `SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H>`
    = note: required because of the requirements on the impl of `DistinctOnDsl<_>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
 
-error[E0277]: the trait bound `columns::id: SelectableExpression<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>` is not satisfied
-  --> tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.rs:16:36
+error[E0277]: Cannot select `columns::id` from `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
+  --> tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.rs:16:24
    |
 16 |     users.for_update().distinct_on(id);
-   |                                    ^^ the trait `SelectableExpression<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>` is not implemented for `columns::id`
+   |                        ^^^^^^^^^^^ the trait `SelectableExpression<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>` is not implemented for `columns::id`
    |
-   = help: the following implementations were found:
+   = note: `columns::id` is no valid selection for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <columns::id as SelectableExpression<JoinOn<Join, On>>>
              <columns::id as SelectableExpression<Only<users::table>>>
              <columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+             <columns::id as SelectableExpression<users::table>>
    = note: required because of the requirements on the impl of `DistinctOnDsl<columns::id>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
 
 error[E0271]: type mismatch resolving `<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::id>> as AsQuery>::Query == SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::id>>>>`
@@ -110,6 +124,11 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 17 |     users.distinct_on(id).for_update();
    |                           ^^^^^^^^^^ the trait `Table` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::id>>`
    |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             users::table
    = note: required because of the requirements on the impl of `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::id>>`
 
 error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::id>>>>: LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not satisfied
@@ -118,8 +137,7 @@ error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromCl
 17 |     users.distinct_on(id).for_update();
    |                           ^^^^^^^^^^ the trait `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not implemented for `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::id>>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<F, S, diesel::query_builder::distinct_clause::NoDistinctClause, W, O, LOf> as LockingDsl<Lock>>
+   = help: the trait `LockingDsl<Lock>` is implemented for `SelectStatement<F, S, diesel::query_builder::distinct_clause::NoDistinctClause, W, O, LOf>`
 
 error[E0271]: type mismatch resolving `<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause> as AsQuery>::Query == SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>`
   --> tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.rs:19:24
@@ -137,6 +155,11 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 19 |     users.for_update().group_by(id);
    |                        ^^^^^^^^ the trait `Table` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
    |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             users::table
    = note: required because of the requirements on the impl of `GroupByDsl<_>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
 
 error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>: GroupByDsl<_>` is not satisfied
@@ -145,8 +168,7 @@ error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromCl
 19 |     users.for_update().group_by(id);
    |                        ^^^^^^^^ the trait `GroupByDsl<_>` is not implemented for `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<F, S, D, W, O, LOf, G, H> as GroupByDsl<Expr>>
+   = help: the trait `GroupByDsl<Expr>` is implemented for `SelectStatement<F, S, D, W, O, LOf, G, H>`
 
 error[E0271]: type mismatch resolving `<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>> as AsQuery>::Query == SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>>>>`
   --> tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.rs:20:24
@@ -164,6 +186,11 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 20 |     users.group_by(id).for_update();
    |                        ^^^^^^^^^^ the trait `Table` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>>`
    |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             users::table
    = note: required because of the requirements on the impl of `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>>`
 
 error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>>>>: LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not satisfied
@@ -172,8 +199,7 @@ error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromCl
 20 |     users.group_by(id).for_update();
    |                        ^^^^^^^^^^ the trait `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not implemented for `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<F, S, diesel::query_builder::distinct_clause::NoDistinctClause, W, O, LOf> as LockingDsl<Lock>>
+   = help: the trait `LockingDsl<Lock>` is implemented for `SelectStatement<F, S, diesel::query_builder::distinct_clause::NoDistinctClause, W, O, LOf>`
 
 error[E0271]: type mismatch resolving `<BoxedSelectStatement<'_, (diesel::sql_types::Integer,), FromClause<users::table>, _> as AsQuery>::Query == SelectStatement<FromClause<BoxedSelectStatement<'_, (diesel::sql_types::Integer,), FromClause<users::table>, _>>>`
   --> tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.rs:22:24
@@ -191,6 +217,11 @@ error[E0277]: the trait bound `BoxedSelectStatement<'_, (diesel::sql_types::Inte
 22 |     users.into_boxed().for_update();
    |                        ^^^^^^^^^^ the trait `Table` is not implemented for `BoxedSelectStatement<'_, (diesel::sql_types::Integer,), FromClause<users::table>, _>`
    |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             users::table
    = note: required because of the requirements on the impl of `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer,), FromClause<users::table>, _>`
 
 error[E0277]: the trait bound `SelectStatement<FromClause<BoxedSelectStatement<'_, (diesel::sql_types::Integer,), FromClause<users::table>, _>>>: LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not satisfied
@@ -199,8 +230,7 @@ error[E0277]: the trait bound `SelectStatement<FromClause<BoxedSelectStatement<'
 22 |     users.into_boxed().for_update();
    |                        ^^^^^^^^^^ the trait `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not implemented for `SelectStatement<FromClause<BoxedSelectStatement<'_, (diesel::sql_types::Integer,), FromClause<users::table>, _>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<F, S, diesel::query_builder::distinct_clause::NoDistinctClause, W, O, LOf> as LockingDsl<Lock>>
+   = help: the trait `LockingDsl<Lock>` is implemented for `SelectStatement<F, S, diesel::query_builder::distinct_clause::NoDistinctClause, W, O, LOf>`
 
 error[E0271]: type mismatch resolving `<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause> as AsQuery>::Query == SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>`
   --> tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.rs:23:24
@@ -218,6 +248,11 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 23 |     users.for_update().into_boxed();
    |                        ^^^^^^^^^^ the trait `Table` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
    |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             users::table
    = note: required because of the requirements on the impl of `BoxedDsl<'_, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
 
 error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>: BoxedDsl<'_, _>` is not satisfied
@@ -226,9 +261,9 @@ error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromCl
 23 |     users.for_update().into_boxed();
    |                        ^^^^^^^^^^ the trait `BoxedDsl<'_, _>` is not implemented for `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H> as BoxedDsl<'a, DB>>
-             <SelectStatement<NoFromClause, S, D, W, O, LOf, G, H> as BoxedDsl<'a, DB>>
+   = help: the following other types implement trait `BoxedDsl<'a, DB>`:
+             SelectStatement<FromClause<F>, S, D, W, O, LOf, G, H>
+             SelectStatement<NoFromClause, S, D, W, O, LOf, G, H>
    = note: required because of the requirements on the impl of `BoxedDsl<'_, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
 
 error[E0271]: type mismatch resolving `<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause> as AsQuery>::Query == SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>`
@@ -247,6 +282,11 @@ error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel:
 25 |     users.for_update().group_by(id).having(id.gt(1));
    |                        ^^^^^^^^ the trait `Table` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
    |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             users::table
    = note: required because of the requirements on the impl of `GroupByDsl<_>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
 
 error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>: GroupByDsl<_>` is not satisfied
@@ -255,32 +295,35 @@ error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromCl
 25 |     users.for_update().group_by(id).having(id.gt(1));
    |                        ^^^^^^^^ the trait `GroupByDsl<_>` is not implemented for `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<F, S, D, W, O, LOf, G, H> as GroupByDsl<Expr>>
+   = help: the trait `GroupByDsl<Expr>` is implemented for `SelectStatement<F, S, D, W, O, LOf, G, H>`
 
-error[E0271]: type mismatch resolving `<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>> as AsQuery>::Query == SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>>>`
+error[E0271]: type mismatch resolving `<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>> as AsQuery>::Query == SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>>>`
   --> tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.rs:26:41
    |
 26 |     users.group_by(id).having(id.gt(1)).for_update();
    |                                         ^^^^^^^^^^ expected struct `users::table`, found struct `SelectStatement`
    |
    = note: expected struct `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, _, _>`
-              found struct `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>>>, _, _>`
-   = note: required because of the requirements on the impl of `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
+              found struct `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>>>, _, _>`
+   = note: required because of the requirements on the impl of `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
 
-error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>: Table` is not satisfied
+error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>: Table` is not satisfied
   --> tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.rs:26:41
    |
 26 |     users.group_by(id).having(id.gt(1)).for_update();
-   |                                         ^^^^^^^^^^ the trait `Table` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
-   |
-   = note: required because of the requirements on the impl of `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
+   |                                         ^^^^^^^^^^ the trait `Table` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
+   |
+   = help: the following other types implement trait `Table`:
+             Only<S>
+             pg::metadata_lookup::pg_namespace::table
+             pg::metadata_lookup::pg_type::table
+             users::table
+   = note: required because of the requirements on the impl of `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
 
-error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>>>: LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not satisfied
+error[E0277]: the trait bound `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>>>: LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not satisfied
   --> tests/fail/select_for_update_cannot_be_mixed_with_some_clauses.rs:26:41
    |
 26 |     users.group_by(id).having(id.gt(1)).for_update();
-   |                                         ^^^^^^^^^^ the trait `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not implemented for `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>>>`
+   |                                         ^^^^^^^^^^ the trait `LockingDsl<diesel::query_builder::locking_clause::ForUpdate>` is not implemented for `SelectStatement<FromClause<SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>, diesel::query_builder::having_clause::HavingClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Gt<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<F, S, diesel::query_builder::distinct_clause::NoDistinctClause, W, O, LOf> as LockingDsl<Lock>>
+   = help: the trait `LockingDsl<Lock>` is implemented for `SelectStatement<F, S, diesel::query_builder::distinct_clause::NoDistinctClause, W, O, LOf>`
diff --git a/diesel_compile_tests/tests/fail/select_for_update_cannot_be_used_on_sqlite.stderr b/diesel_compile_tests/tests/fail/select_for_update_cannot_be_used_on_sqlite.stderr
index 6f2a63ac19c6..3ea0df60688b 100644
--- a/diesel_compile_tests/tests/fail/select_for_update_cannot_be_used_on_sqlite.stderr
+++ b/diesel_compile_tests/tests/fail/select_for_update_cannot_be_used_on_sqlite.stderr
@@ -1,27 +1,37 @@
 error[E0277]: the trait bound `diesel::query_builder::locking_clause::ForUpdate: QueryFragment<Sqlite>` is not satisfied
-  --> tests/fail/select_for_update_cannot_be_used_on_sqlite.rs:16:10
-   |
-16 |         .load(&mut conn)
-   |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::ForUpdate`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Mysql>>
-             <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Pg>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
+    --> tests/fail/select_for_update_cannot_be_used_on_sqlite.rs:16:10
+     |
+16   |         .load(&mut conn)
+     |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::ForUpdate`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Mysql>>
+               <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Pg>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `diesel::query_builder::locking_clause::NoModifier: QueryFragment<Sqlite>` is not satisfied
-  --> tests/fail/select_for_update_cannot_be_used_on_sqlite.rs:16:10
-   |
-16 |         .load(&mut conn)
-   |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::NoModifier`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::locking_clause::NoModifier as QueryFragment<Mysql>>
-             <diesel::query_builder::locking_clause::NoModifier as QueryFragment<Pg>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
+    --> tests/fail/select_for_update_cannot_be_used_on_sqlite.rs:16:10
+     |
+16   |         .load(&mut conn)
+     |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::NoModifier`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::locking_clause::NoModifier as QueryFragment<Mysql>>
+               <diesel::query_builder::locking_clause::NoModifier as QueryFragment<Pg>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
diff --git a/diesel_compile_tests/tests/fail/select_for_update_no_wait_cannot_be_used_on_sqlite.stderr b/diesel_compile_tests/tests/fail/select_for_update_no_wait_cannot_be_used_on_sqlite.stderr
index de2cfc9430a8..725b0221fbaf 100644
--- a/diesel_compile_tests/tests/fail/select_for_update_no_wait_cannot_be_used_on_sqlite.stderr
+++ b/diesel_compile_tests/tests/fail/select_for_update_no_wait_cannot_be_used_on_sqlite.stderr
@@ -1,27 +1,37 @@
 error[E0277]: the trait bound `diesel::query_builder::locking_clause::ForUpdate: QueryFragment<Sqlite>` is not satisfied
-  --> tests/fail/select_for_update_no_wait_cannot_be_used_on_sqlite.rs:17:10
-   |
-17 |         .load(&mut conn)
-   |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::ForUpdate`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Mysql>>
-             <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Pg>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>>`
+    --> tests/fail/select_for_update_no_wait_cannot_be_used_on_sqlite.rs:17:10
+     |
+17   |         .load(&mut conn)
+     |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::ForUpdate`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Mysql>>
+               <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Pg>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `diesel::query_builder::locking_clause::NoWait: QueryFragment<Sqlite>` is not satisfied
-  --> tests/fail/select_for_update_no_wait_cannot_be_used_on_sqlite.rs:17:10
-   |
-17 |         .load(&mut conn)
-   |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::NoWait`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::locking_clause::NoWait as QueryFragment<Mysql>>
-             <diesel::query_builder::locking_clause::NoWait as QueryFragment<Pg>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>>`
+    --> tests/fail/select_for_update_no_wait_cannot_be_used_on_sqlite.rs:17:10
+     |
+17   |         .load(&mut conn)
+     |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::NoWait`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::locking_clause::NoWait as QueryFragment<Mysql>>
+               <diesel::query_builder::locking_clause::NoWait as QueryFragment<Pg>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::NoWait>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
diff --git a/diesel_compile_tests/tests/fail/select_for_update_skip_locked_cannot_be_used_on_sqlite.stderr b/diesel_compile_tests/tests/fail/select_for_update_skip_locked_cannot_be_used_on_sqlite.stderr
index 0dd64eac118a..45e09f667aaa 100644
--- a/diesel_compile_tests/tests/fail/select_for_update_skip_locked_cannot_be_used_on_sqlite.stderr
+++ b/diesel_compile_tests/tests/fail/select_for_update_skip_locked_cannot_be_used_on_sqlite.stderr
@@ -1,27 +1,37 @@
 error[E0277]: the trait bound `diesel::query_builder::locking_clause::ForUpdate: QueryFragment<Sqlite>` is not satisfied
-  --> tests/fail/select_for_update_skip_locked_cannot_be_used_on_sqlite.rs:17:10
-   |
-17 |         .load(&mut conn)
-   |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::ForUpdate`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Mysql>>
-             <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Pg>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>>`
+    --> tests/fail/select_for_update_skip_locked_cannot_be_used_on_sqlite.rs:17:10
+     |
+17   |         .load(&mut conn)
+     |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::ForUpdate`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Mysql>>
+               <diesel::query_builder::locking_clause::ForUpdate as QueryFragment<Pg>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `diesel::query_builder::locking_clause::SkipLocked: QueryFragment<Sqlite>` is not satisfied
-  --> tests/fail/select_for_update_skip_locked_cannot_be_used_on_sqlite.rs:17:10
-   |
-17 |         .load(&mut conn)
-   |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::SkipLocked`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::locking_clause::SkipLocked as QueryFragment<Mysql>>
-             <diesel::query_builder::locking_clause::SkipLocked as QueryFragment<Pg>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>>`
+    --> tests/fail/select_for_update_skip_locked_cannot_be_used_on_sqlite.rs:17:10
+     |
+17   |         .load(&mut conn)
+     |          ^^^^ the trait `QueryFragment<Sqlite>` is not implemented for `diesel::query_builder::locking_clause::SkipLocked`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::locking_clause::SkipLocked as QueryFragment<Mysql>>
+               <diesel::query_builder::locking_clause::SkipLocked as QueryFragment<Pg>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, SqliteConnection, _>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::NoGroupByClause, diesel::query_builder::having_clause::NoHavingClause, diesel::query_builder::locking_clause::LockingClause<diesel::query_builder::locking_clause::ForUpdate, diesel::query_builder::locking_clause::SkipLocked>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
diff --git a/diesel_compile_tests/tests/fail/select_requires_column_from_same_table.stderr b/diesel_compile_tests/tests/fail/select_requires_column_from_same_table.stderr
index 125eefaa1c22..3ceaa4d43784 100644
--- a/diesel_compile_tests/tests/fail/select_requires_column_from_same_table.stderr
+++ b/diesel_compile_tests/tests/fail/select_requires_column_from_same_table.stderr
@@ -1,13 +1,15 @@
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/select_requires_column_from_same_table.rs:20:41
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+  --> tests/fail/select_requires_column_from_same_table.rs:20:34
    |
 20 |     let select_id = users::table.select(posts::id);
-   |                                         ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+   |                                  ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::id` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::id as SelectableExpression<Only<posts::table>>>
              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <posts::columns::id as SelectableExpression<posts::table>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
    = note: required because of the requirements on the impl of `SelectDsl<posts::columns::id>` for `SelectStatement<FromClause<users::table>>`
diff --git a/diesel_compile_tests/tests/fail/select_requires_valid_grouping.stderr b/diesel_compile_tests/tests/fail/select_requires_valid_grouping.stderr
index 8bde75ed07d2..27fba9c752a6 100644
--- a/diesel_compile_tests/tests/fail/select_requires_valid_grouping.stderr
+++ b/diesel_compile_tests/tests/fail/select_requires_valid_grouping.stderr
@@ -4,8 +4,19 @@ error[E0271]: type mismatch resolving `<users::columns::name as IsContainedInGro
 85 |     let source = users::table.group_by(users::name).select(users::id);
    |                                                     ^^^^^^ expected struct `diesel::expression::is_contained_in_group_by::No`, found struct `diesel::expression::is_contained_in_group_by::Yes`
    |
-   = note: required because of the requirements on the impl of `ValidGrouping<users::columns::name>` for `users::columns::id`
+note: required because of the requirements on the impl of `ValidGrouping<users::columns::name>` for `users::columns::id`
+  --> tests/fail/select_requires_valid_grouping.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> Text,
+9  | |         hair_color -> Nullable<Text>,
+10 | |     }
+11 | | }
+   | |_^
    = note: required because of the requirements on the impl of `SelectDsl<users::columns::id>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<users::columns::name>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<(users::columns::name, users::columns::hair_color) as IsContainedInGroupBy<users::columns::id>>::Output == diesel::expression::is_contained_in_group_by::Yes`
   --> tests/fail/select_requires_valid_grouping.rs:88:10
@@ -13,8 +24,19 @@ error[E0271]: type mismatch resolving `<(users::columns::name, users::columns::h
 88 |         .select(users::id);
    |          ^^^^^^ expected struct `diesel::expression::is_contained_in_group_by::No`, found struct `diesel::expression::is_contained_in_group_by::Yes`
    |
-   = note: required because of the requirements on the impl of `ValidGrouping<(users::columns::name, users::columns::hair_color)>` for `users::columns::id`
+note: required because of the requirements on the impl of `ValidGrouping<(users::columns::name, users::columns::hair_color)>` for `users::columns::id`
+  --> tests/fail/select_requires_valid_grouping.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> Text,
+9  | |         hair_color -> Nullable<Text>,
+10 | |     }
+11 | | }
+   | |_^
    = note: required because of the requirements on the impl of `SelectDsl<users::columns::id>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<(users::columns::name, users::columns::hair_color)>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<users::columns::name as IsContainedInGroupBy<users::columns::id>>::Output == diesel::expression::is_contained_in_group_by::Yes`
   --> tests/fail/select_requires_valid_grouping.rs:91:10
@@ -22,10 +44,21 @@ error[E0271]: type mismatch resolving `<users::columns::name as IsContainedInGro
 91 |         .select((users::name, users::id));
    |          ^^^^^^ expected struct `diesel::expression::is_contained_in_group_by::No`, found struct `diesel::expression::is_contained_in_group_by::Yes`
    |
-   = note: required because of the requirements on the impl of `ValidGrouping<users::columns::name>` for `users::columns::id`
-   = note: 1 redundant requirements hidden
+note: required because of the requirements on the impl of `ValidGrouping<users::columns::name>` for `users::columns::id`
+  --> tests/fail/select_requires_valid_grouping.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> Text,
+9  | |         hair_color -> Nullable<Text>,
+10 | |     }
+11 | | }
+   | |_^
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `ValidGrouping<users::columns::name>` for `(users::columns::name, users::columns::id)`
    = note: required because of the requirements on the impl of `SelectDsl<(users::columns::name, users::columns::id)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<users::columns::name>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<(users::columns::name, users::columns::hair_color) as IsContainedInGroupBy<users::columns::id>>::Output == diesel::expression::is_contained_in_group_by::Yes`
   --> tests/fail/select_requires_valid_grouping.rs:94:10
@@ -33,8 +66,19 @@ error[E0271]: type mismatch resolving `<(users::columns::name, users::columns::h
 94 |         .select(users::id);
    |          ^^^^^^ expected struct `diesel::expression::is_contained_in_group_by::No`, found struct `diesel::expression::is_contained_in_group_by::Yes`
    |
-   = note: required because of the requirements on the impl of `ValidGrouping<(users::columns::name, users::columns::hair_color)>` for `users::columns::id`
+note: required because of the requirements on the impl of `ValidGrouping<(users::columns::name, users::columns::hair_color)>` for `users::columns::id`
+  --> tests/fail/select_requires_valid_grouping.rs:5:1
+   |
+5  | / table! {
+6  | |     users {
+7  | |         id -> Integer,
+8  | |         name -> Text,
+9  | |         hair_color -> Nullable<Text>,
+10 | |     }
+11 | | }
+   | |_^
    = note: required because of the requirements on the impl of `SelectDsl<users::columns::id>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<(users::columns::name, users::columns::hair_color)>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<(users::columns::id, posts::columns::title) as IsContainedInGroupBy<posts::columns::id>>::Output == diesel::expression::is_contained_in_group_by::Yes`
   --> tests/fail/select_requires_valid_grouping.rs:98:10
@@ -42,45 +86,80 @@ error[E0271]: type mismatch resolving `<(users::columns::id, posts::columns::tit
 98 |         .select((users::all_columns, posts::id));
    |          ^^^^^^ expected struct `diesel::expression::is_contained_in_group_by::No`, found struct `diesel::expression::is_contained_in_group_by::Yes`
    |
-   = note: required because of the requirements on the impl of `ValidGrouping<(users::columns::id, posts::columns::title)>` for `posts::columns::id`
-   = note: 1 redundant requirements hidden
+note: required because of the requirements on the impl of `ValidGrouping<(users::columns::id, posts::columns::title)>` for `posts::columns::id`
+  --> tests/fail/select_requires_valid_grouping.rs:13:1
+   |
+13 | / table! {
+14 | |     posts {
+15 | |         id -> Integer,
+16 | |         title -> Text,
+17 | |         user_id -> Integer,
+18 | |     }
+19 | | }
+   | |_^
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `ValidGrouping<(users::columns::id, posts::columns::title)>` for `((users::columns::id, users::columns::name, users::columns::hair_color), posts::columns::id)`
-   = note: required because of the requirements on the impl of `SelectDsl<((users::columns::id, users::columns::name, users::columns::hair_color), posts::columns::id)>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<(users::columns::id, posts::columns::title)>>`
+   = note: required because of the requirements on the impl of `SelectDsl<((users::columns::id, users::columns::name, users::columns::hair_color), posts::columns::id)>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<(users::columns::id, posts::columns::title)>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::columns::id: IsContainedInGroupBy<comments::columns::id>` is not satisfied
-   --> tests/fail/select_requires_valid_grouping.rs:102:17
+   --> tests/fail/select_requires_valid_grouping.rs:102:10
     |
 102 |         .select((users::all_columns, posts::all_columns, comments::id));
-    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsContainedInGroupBy<comments::columns::id>` is not implemented for `users::columns::id`
+    |          ^^^^^^ the trait `IsContainedInGroupBy<comments::columns::id>` is not implemented for `users::columns::id`
     |
-    = help: the following implementations were found:
+    = help: the following other types implement trait `IsContainedInGroupBy<T>`:
               <users::columns::id as IsContainedInGroupBy<posts::columns::id>>
               <users::columns::id as IsContainedInGroupBy<posts::columns::title>>
               <users::columns::id as IsContainedInGroupBy<posts::columns::user_id>>
               <users::columns::id as IsContainedInGroupBy<users::columns::hair_color>>
-            and 2 others
+              <users::columns::id as IsContainedInGroupBy<users::columns::id>>
+              <users::columns::id as IsContainedInGroupBy<users::columns::name>>
     = note: required because of the requirements on the impl of `IsContainedInGroupBy<comments::columns::id>` for `(users::columns::id, posts::columns::id)`
-    = note: required because of the requirements on the impl of `ValidGrouping<(users::columns::id, posts::columns::id)>` for `comments::columns::id`
+note: required because of the requirements on the impl of `ValidGrouping<(users::columns::id, posts::columns::id)>` for `comments::columns::id`
+   --> tests/fail/select_requires_valid_grouping.rs:21:1
+    |
+21  | / table! {
+22  | |     comments {
+23  | |         id -> Integer,
+24  | |         text -> Text,
+25  | |         post_id -> Integer,
+26  | |     }
+27  | | }
+    | |_^
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `ValidGrouping<(users::columns::id, posts::columns::id)>` for `((users::columns::id, users::columns::name, users::columns::hair_color), (posts::columns::id, posts::columns::title, posts::columns::user_id), comments::columns::id)`
-    = note: required because of the requirements on the impl of `SelectDsl<((users::columns::id, users::columns::name, users::columns::hair_color), (posts::columns::id, posts::columns::title, posts::columns::user_id), comments::columns::id)>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<(users::columns::id, posts::columns::id)>>`
+    = note: required because of the requirements on the impl of `SelectDsl<((users::columns::id, users::columns::name, users::columns::hair_color), (posts::columns::id, posts::columns::title, posts::columns::user_id), comments::columns::id)>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<(users::columns::id, posts::columns::id)>>`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `posts::columns::id: IsContainedInGroupBy<comments::columns::id>` is not satisfied
-   --> tests/fail/select_requires_valid_grouping.rs:102:17
+   --> tests/fail/select_requires_valid_grouping.rs:102:10
     |
 102 |         .select((users::all_columns, posts::all_columns, comments::id));
-    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsContainedInGroupBy<comments::columns::id>` is not implemented for `posts::columns::id`
+    |          ^^^^^^ the trait `IsContainedInGroupBy<comments::columns::id>` is not implemented for `posts::columns::id`
     |
-    = help: the following implementations were found:
+    = help: the following other types implement trait `IsContainedInGroupBy<T>`:
               <posts::columns::id as IsContainedInGroupBy<posts::columns::id>>
               <posts::columns::id as IsContainedInGroupBy<posts::columns::title>>
               <posts::columns::id as IsContainedInGroupBy<posts::columns::user_id>>
               <posts::columns::id as IsContainedInGroupBy<users::columns::hair_color>>
-            and 2 others
+              <posts::columns::id as IsContainedInGroupBy<users::columns::id>>
+              <posts::columns::id as IsContainedInGroupBy<users::columns::name>>
     = note: required because of the requirements on the impl of `IsContainedInGroupBy<comments::columns::id>` for `(posts::columns::id,)`
-    = note: 1 redundant requirements hidden
+    = note: 1 redundant requirement hidden
     = note: required because of the requirements on the impl of `IsContainedInGroupBy<comments::columns::id>` for `(users::columns::id, posts::columns::id)`
-    = note: required because of the requirements on the impl of `ValidGrouping<(users::columns::id, posts::columns::id)>` for `comments::columns::id`
+note: required because of the requirements on the impl of `ValidGrouping<(users::columns::id, posts::columns::id)>` for `comments::columns::id`
+   --> tests/fail/select_requires_valid_grouping.rs:21:1
+    |
+21  | / table! {
+22  | |     comments {
+23  | |         id -> Integer,
+24  | |         text -> Text,
+25  | |         post_id -> Integer,
+26  | |     }
+27  | | }
+    | |_^
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `ValidGrouping<(users::columns::id, posts::columns::id)>` for `((users::columns::id, users::columns::name, users::columns::hair_color), (posts::columns::id, posts::columns::title, posts::columns::user_id), comments::columns::id)`
-    = note: required because of the requirements on the impl of `SelectDsl<((users::columns::id, users::columns::name, users::columns::hair_color), (posts::columns::id, posts::columns::title, posts::columns::user_id), comments::columns::id)>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<(users::columns::id, posts::columns::id)>>`
+    = note: required because of the requirements on the impl of `SelectDsl<((users::columns::id, users::columns::name, users::columns::hair_color), (posts::columns::id, posts::columns::title, posts::columns::user_id), comments::columns::id)>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<JoinOn<query_source::joins::Join<users::table, SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<(users::columns::id, posts::columns::id)>>`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/select_sql_still_ensures_result_type.stderr b/diesel_compile_tests/tests/fail/select_sql_still_ensures_result_type.stderr
index 41f1afd4dd3c..484774b0efdc 100644
--- a/diesel_compile_tests/tests/fail/select_sql_still_ensures_result_type.stderr
+++ b/diesel_compile_tests/tests/fail/select_sql_still_ensures_result_type.stderr
@@ -1,16 +1,25 @@
 error[E0277]: the trait bound `*const str: FromSql<BigInt, _>` is not satisfied
-  --> tests/fail/select_sql_still_ensures_result_type.rs:16:30
-   |
-16 |     let count = select_count.get_result::<String>(&mut connection).unwrap();
-   |                              ^^^^^^^^^^ the trait `FromSql<BigInt, _>` is not implemented for `*const str`
-   |
-   = help: the following implementations were found:
-             <*const [u8] as FromSql<diesel::sql_types::Binary, Pg>>
-             <*const [u8] as FromSql<diesel::sql_types::Binary, Sqlite>>
-             <*const str as FromSql<diesel::sql_types::Text, Pg>>
-             <*const str as FromSql<diesel::sql_types::Text, Sqlite>>
-   = note: required because of the requirements on the impl of `FromSql<BigInt, _>` for `std::string::String`
-   = note: required because of the requirements on the impl of `Queryable<BigInt, _>` for `std::string::String`
-   = note: required because of the requirements on the impl of `FromSqlRow<BigInt, _>` for `std::string::String`
-   = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<std::string::String, _>` for `BigInt`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, std::string::String>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<SqlLiteral<BigInt>>>`
+    --> tests/fail/select_sql_still_ensures_result_type.rs:16:30
+     |
+16   |     let count = select_count.get_result::<String>(&mut connection).unwrap();
+     |                              ^^^^^^^^^^ the trait `FromSql<BigInt, _>` is not implemented for `*const str`
+     |
+     = help: the following other types implement trait `FromSql<A, DB>`:
+               <*const str as FromSql<diesel::sql_types::Text, Mysql>>
+               <*const str as FromSql<diesel::sql_types::Text, Pg>>
+               <*const str as FromSql<diesel::sql_types::Text, Sqlite>>
+               <std::string::String as FromSql<ST, DB>>
+               <std::string::String as FromSql<TimestamptzSqlite, Sqlite>>
+               <std::string::String as FromSql<diesel::sql_types::Date, Sqlite>>
+               <std::string::String as FromSql<diesel::sql_types::Time, Sqlite>>
+               <std::string::String as FromSql<diesel::sql_types::Timestamp, Sqlite>>
+     = note: required because of the requirements on the impl of `FromSql<BigInt, _>` for `std::string::String`
+     = note: required because of the requirements on the impl of `Queryable<BigInt, _>` for `std::string::String`
+     = note: required because of the requirements on the impl of `FromSqlRow<BigInt, _>` for `std::string::String`
+     = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<std::string::String, _>` for `BigInt`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, std::string::String>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<SqlLiteral<BigInt>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
diff --git a/diesel_compile_tests/tests/fail/selectable.stderr b/diesel_compile_tests/tests/fail/selectable.stderr
index 3c0bbd52e2b3..cfb57b399723 100644
--- a/diesel_compile_tests/tests/fail/selectable.stderr
+++ b/diesel_compile_tests/tests/fail/selectable.stderr
@@ -22,95 +22,184 @@ error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<post
 149 |         .select(UserWithEmbeddedPost::as_select())
     |          ^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
     |
-    = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::id`
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::id`
+   --> tests/fail/selectable.rs:12:1
+    |
+12  | / table! {
+13  | |     posts {
+14  | |         id -> Integer,
+15  | |         title -> Text,
+16  | |         user_id -> Integer,
+17  | |     }
+18  | | }
+    | |_^
     = note: 4 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
    --> tests/fail/selectable.rs:149:10
     |
 149 |         .select(UserWithEmbeddedPost::as_select())
     |          ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
     |
-    = help: the following implementations were found:
+    = note: `posts::columns::id` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
               <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
               <posts::columns::id as SelectableExpression<Only<posts::table>>>
               <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::id`
+              <posts::columns::id as SelectableExpression<posts::table>>
+              <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::id`
+   --> tests/fail/selectable.rs:12:1
+    |
+12  | / table! {
+13  | |     posts {
+14  | |         id -> Integer,
+15  | |         title -> Text,
+16  | |         user_id -> Integer,
+17  | |     }
+18  | | }
+    | |_^
     = note: 4 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
    --> tests/fail/selectable.rs:149:10
     |
 149 |         .select(UserWithEmbeddedPost::as_select())
     |          ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
     |
-    = help: the following implementations were found:
+    = note: `posts::columns::title` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
               <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
               <posts::columns::title as SelectableExpression<Only<posts::table>>>
               <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
-    = note: 4 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
-
-error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Never`
-   --> tests/fail/selectable.rs:150:10
-    |
-150 |         .load(&mut conn)
-    |          ^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
-    |
-    = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::id`
-    = note: 4 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>` for `diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>`
-    = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/selectable.rs:150:10
-    |
-150 |         .load(&mut conn)
-    |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+              <posts::columns::title as SelectableExpression<posts::table>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+   --> tests/fail/selectable.rs:12:1
     |
-    = help: the following implementations were found:
-              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
-              <posts::columns::id as SelectableExpression<Only<posts::table>>>
-              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::id`
+12  | / table! {
+13  | |     posts {
+14  | |         id -> Integer,
+15  | |         title -> Text,
+16  | |         user_id -> Integer,
+17  | |     }
+18  | | }
+    | |_^
     = note: 4 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>` for `diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>`
-    = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/selectable.rs:150:10
-    |
-150 |         .load(&mut conn)
-    |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
-    |
-    = help: the following implementations were found:
-              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
-              <posts::columns::title as SelectableExpression<Only<posts::table>>>
-              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
-    = note: 4 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>` for `diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>`
-    = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+error[E0271]: type mismatch resolving `<posts::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Never`
+    --> tests/fail/selectable.rs:150:10
+     |
+150  |         .load(&mut conn)
+     |          ^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
+     |
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::id`
+    --> tests/fail/selectable.rs:12:1
+     |
+12   | / table! {
+13   | |     posts {
+14   | |         id -> Integer,
+15   | |         title -> Text,
+16   | |         user_id -> Integer,
+17   | |     }
+18   | | }
+     | |_^
+     = note: 4 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>` for `diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+    --> tests/fail/selectable.rs:150:10
+     |
+150  |         .load(&mut conn)
+     |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+     |
+     = note: `posts::columns::id` is no valid selection for `users::table`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
+               <posts::columns::id as SelectableExpression<Only<posts::table>>>
+               <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
+               <posts::columns::id as SelectableExpression<posts::table>>
+               <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+               <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::id`
+    --> tests/fail/selectable.rs:12:1
+     |
+12   | / table! {
+13   | |     posts {
+14   | |         id -> Integer,
+15   | |         title -> Text,
+16   | |         user_id -> Integer,
+17   | |     }
+18   | | }
+     | |_^
+     = note: 4 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>` for `diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+    --> tests/fail/selectable.rs:150:10
+     |
+150  |         .load(&mut conn)
+     |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+     |
+     = note: `posts::columns::title` is no valid selection for `users::table`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
+               <posts::columns::title as SelectableExpression<Only<posts::table>>>
+               <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
+               <posts::columns::title as SelectableExpression<posts::table>>
+               <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+               <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+note: required because of the requirements on the impl of `SelectableExpression<query_source::joins::Join<users::table, posts::table, LeftOuter>>` for `posts::columns::title`
+    --> tests/fail/selectable.rs:12:1
+     |
+12   | / table! {
+13   | |     posts {
+14   | |         id -> Integer,
+15   | |         title -> Text,
+16   | |         user_id -> Integer,
+17   | |     }
+18   | | }
+     | |_^
+     = note: 4 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::select_clause::SelectClauseExpression<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>` for `diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, LeftOuter>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `posts::columns::id: IsContainedInGroupBy<users::columns::id>` is not satisfied
    --> tests/fail/selectable.rs:157:10
@@ -118,14 +207,24 @@ error[E0277]: the trait bound `posts::columns::id: IsContainedInGroupBy<users::c
 157 |         .select(UserWithEmbeddedPost::as_select())
     |          ^^^^^^ the trait `IsContainedInGroupBy<users::columns::id>` is not implemented for `posts::columns::id`
     |
-    = help: the following implementations were found:
+    = help: the following other types implement trait `IsContainedInGroupBy<T>`:
               <posts::columns::id as IsContainedInGroupBy<posts::columns::id>>
               <posts::columns::id as IsContainedInGroupBy<posts::columns::title>>
               <posts::columns::id as IsContainedInGroupBy<posts::columns::user_id>>
-    = note: required because of the requirements on the impl of `ValidGrouping<posts::columns::id>` for `users::columns::id`
+note: required because of the requirements on the impl of `ValidGrouping<posts::columns::id>` for `users::columns::id`
+   --> tests/fail/selectable.rs:5:1
+    |
+5   | / table! {
+6   | |     users {
+7   | |         id -> Integer,
+8   | |         name -> Text,
+9   | |     }
+10  | | }
+    | |_^
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `ValidGrouping<posts::columns::id>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<posts::columns::id>>`
+    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<posts::columns::id>>`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `posts::columns::id: IsContainedInGroupBy<users::columns::name>` is not satisfied
    --> tests/fail/selectable.rs:157:10
@@ -133,14 +232,24 @@ error[E0277]: the trait bound `posts::columns::id: IsContainedInGroupBy<users::c
 157 |         .select(UserWithEmbeddedPost::as_select())
     |          ^^^^^^ the trait `IsContainedInGroupBy<users::columns::name>` is not implemented for `posts::columns::id`
     |
-    = help: the following implementations were found:
+    = help: the following other types implement trait `IsContainedInGroupBy<T>`:
               <posts::columns::id as IsContainedInGroupBy<posts::columns::id>>
               <posts::columns::id as IsContainedInGroupBy<posts::columns::title>>
               <posts::columns::id as IsContainedInGroupBy<posts::columns::user_id>>
-    = note: required because of the requirements on the impl of `ValidGrouping<posts::columns::id>` for `users::columns::name`
+note: required because of the requirements on the impl of `ValidGrouping<posts::columns::id>` for `users::columns::name`
+   --> tests/fail/selectable.rs:5:1
+    |
+5   | / table! {
+6   | |     users {
+7   | |         id -> Integer,
+8   | |         name -> Text,
+9   | |     }
+10  | | }
+    | |_^
     = note: 3 redundant requirements hidden
     = note: required because of the requirements on the impl of `ValidGrouping<posts::columns::id>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<posts::columns::id>>`
+    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<posts::columns::id>>`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `diesel::expression::is_aggregate::No: MixedAggregates<diesel::expression::is_aggregate::Yes>` is not satisfied
    --> tests/fail/selectable.rs:164:10
@@ -148,53 +257,67 @@ error[E0277]: the trait bound `diesel::expression::is_aggregate::No: MixedAggreg
 164 |         .select(UserWithPostCount::as_select())
     |          ^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::Yes>` is not implemented for `diesel::expression::is_aggregate::No`
     |
-    = help: the following implementations were found:
+    = help: the following other types implement trait `MixedAggregates<Other>`:
               <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::Never>>
               <diesel::expression::is_aggregate::No as MixedAggregates<diesel::expression::is_aggregate::No>>
     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(users::columns::name, diesel::expression::count::count::count<diesel::sql_types::Integer, posts::columns::id>)`
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::expression::select_by::SelectBy<UserWithPostCount, Pg>`
-    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithPostCount, Pg>>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
+    = note: required because of the requirements on the impl of `SelectDsl<diesel::expression::select_by::SelectBy<UserWithPostCount, Pg>>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>>`
 
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
    --> tests/fail/selectable.rs:172:10
     |
 172 |         .returning(UserWithEmbeddedPost::as_select())
     |          ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
     |
-    = help: the following implementations were found:
+    = note: `posts::columns::id` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
               <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
               <posts::columns::id as SelectableExpression<Only<posts::table>>>
               <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
+              <posts::columns::id as SelectableExpression<posts::table>>
+              <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `InsertStatement::<T, U, Op>::returning`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         InsertStatement<T, U, Op, ReturningClause<E>>: Query,
+    |                                                        ^^^^^ required by this bound in `InsertStatement::<T, U, Op>::returning`
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
    --> tests/fail/selectable.rs:172:10
     |
 172 |         .returning(UserWithEmbeddedPost::as_select())
     |          ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
     |
-    = help: the following implementations were found:
+    = note: `posts::columns::title` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
               <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
               <posts::columns::title as SelectableExpression<Only<posts::table>>>
               <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
+              <posts::columns::title as SelectableExpression<posts::table>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `InsertStatement::<T, U, Op>::returning`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         InsertStatement<T, U, Op, ReturningClause<E>>: Query,
+    |                                                        ^^^^^ required by this bound in `InsertStatement::<T, U, Op>::returning`
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
    --> tests/fail/selectable.rs:172:10
     |
 172 |         .returning(UserWithEmbeddedPost::as_select())
-    |          ^^^^^^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
+    |          ^^^^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
     |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
    --> tests/fail/selectable.rs:12:1
@@ -207,115 +330,153 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 17  | |     }
 18  | | }
     | |_^
-    = note: 1 redundant requirements hidden
+    = note: 1 redundant requirement hidden
     = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/selectable.rs:173:10
-    |
-173 |         .load(&mut conn)
-    |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
-    |
-    = help: the following implementations were found:
-              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
-              <posts::columns::id as SelectableExpression<Only<posts::table>>>
-              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: 2 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/selectable.rs:173:10
-    |
-173 |         .load(&mut conn)
-    |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
-    |
-    = help: the following implementations were found:
-              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
-              <posts::columns::title as SelectableExpression<Only<posts::table>>>
-              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: 2 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `InsertStatement::<T, U, Op>::returning`
+   --> $DIESEL/src/query_builder/insert_statement/mod.rs
+    |
+    |         InsertStatement<T, U, Op, ReturningClause<E>>: Query,
+    |                                                        ^^^^^ required by this bound in `InsertStatement::<T, U, Op>::returning`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+    --> tests/fail/selectable.rs:173:10
+     |
+173  |         .load(&mut conn)
+     |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+     |
+     = note: `posts::columns::id` is no valid selection for `users::table`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
+               <posts::columns::id as SelectableExpression<Only<posts::table>>>
+               <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
+               <posts::columns::id as SelectableExpression<posts::table>>
+               <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+               <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+    --> tests/fail/selectable.rs:173:10
+     |
+173  |         .load(&mut conn)
+     |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+     |
+     = note: `posts::columns::title` is no valid selection for `users::table`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
+               <posts::columns::title as SelectableExpression<Only<posts::table>>>
+               <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
+               <posts::columns::title as SelectableExpression<posts::table>>
+               <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+               <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
-   --> tests/fail/selectable.rs:173:10
-    |
-173 |         .load(&mut conn)
-    |          ^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-    |
+    --> tests/fail/selectable.rs:173:10
+     |
+173  |         .load(&mut conn)
+     |          ^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+     |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
-   --> tests/fail/selectable.rs:12:1
-    |
-12  | / table! {
-13  | |     posts {
-14  | |         id -> Integer,
-15  | |         title -> Text,
-16  | |         user_id -> Integer,
-17  | |     }
-18  | | }
-    | |_^
-    = note: 1 redundant requirements hidden
-    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: 2 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
+    --> tests/fail/selectable.rs:12:1
+     |
+12   | / table! {
+13   | |     posts {
+14   | |         id -> Integer,
+15   | |         title -> Text,
+16   | |         user_id -> Integer,
+17   | |     }
+18   | | }
+     | |_^
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `Query` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<users::columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, users::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
    --> tests/fail/selectable.rs:180:10
     |
 180 |         .returning(UserWithEmbeddedPost::as_select())
     |          ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
     |
-    = help: the following implementations were found:
+    = note: `posts::columns::id` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
               <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
               <posts::columns::id as SelectableExpression<Only<posts::table>>>
               <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
+              <posts::columns::id as SelectableExpression<posts::table>>
+              <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `UpdateStatement::<T, U, V>::returning`
+   --> $DIESEL/src/query_builder/update_statement/mod.rs
+    |
+    |         UpdateStatement<T, U, V, ReturningClause<E>>: Query,
+    |                                                       ^^^^^ required by this bound in `UpdateStatement::<T, U, V>::returning`
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
    --> tests/fail/selectable.rs:180:10
     |
 180 |         .returning(UserWithEmbeddedPost::as_select())
     |          ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
     |
-    = help: the following implementations were found:
+    = note: `posts::columns::title` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
               <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
               <posts::columns::title as SelectableExpression<Only<posts::table>>>
               <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
+              <posts::columns::title as SelectableExpression<posts::table>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `UpdateStatement::<T, U, V>::returning`
+   --> $DIESEL/src/query_builder/update_statement/mod.rs
+    |
+    |         UpdateStatement<T, U, V, ReturningClause<E>>: Query,
+    |                                                       ^^^^^ required by this bound in `UpdateStatement::<T, U, V>::returning`
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
    --> tests/fail/selectable.rs:180:10
     |
 180 |         .returning(UserWithEmbeddedPost::as_select())
-    |          ^^^^^^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
+    |          ^^^^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
     |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
    --> tests/fail/selectable.rs:12:1
@@ -328,113 +489,157 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 17  | |     }
 18  | | }
     | |_^
-    = note: 1 redundant requirements hidden
+    = note: 1 redundant requirement hidden
     = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/selectable.rs:181:10
-    |
-181 |         .load(&mut conn)
-    |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
-    |
-    = help: the following implementations were found:
-              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
-              <posts::columns::id as SelectableExpression<Only<posts::table>>>
-              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: 2 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/selectable.rs:181:10
-    |
-181 |         .load(&mut conn)
-    |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
-    |
-    = help: the following implementations were found:
-              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
-              <posts::columns::title as SelectableExpression<Only<posts::table>>>
-              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: 2 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `UpdateStatement::<T, U, V>::returning`
+   --> $DIESEL/src/query_builder/update_statement/mod.rs
+    |
+    |         UpdateStatement<T, U, V, ReturningClause<E>>: Query,
+    |                                                       ^^^^^ required by this bound in `UpdateStatement::<T, U, V>::returning`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+    --> tests/fail/selectable.rs:181:10
+     |
+181  |         .load(&mut conn)
+     |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+     |
+     = note: `posts::columns::id` is no valid selection for `users::table`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
+               <posts::columns::id as SelectableExpression<Only<posts::table>>>
+               <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
+               <posts::columns::id as SelectableExpression<posts::table>>
+               <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+               <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+    --> tests/fail/selectable.rs:181:10
+     |
+181  |         .load(&mut conn)
+     |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+     |
+     = note: `posts::columns::title` is no valid selection for `users::table`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
+               <posts::columns::title as SelectableExpression<Only<posts::table>>>
+               <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
+               <posts::columns::title as SelectableExpression<posts::table>>
+               <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+               <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
-   --> tests/fail/selectable.rs:181:10
-    |
-181 |         .load(&mut conn)
-    |          ^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-    |
+    --> tests/fail/selectable.rs:181:10
+     |
+181  |         .load(&mut conn)
+     |          ^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+     |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
-   --> tests/fail/selectable.rs:12:1
-    |
-12  | / table! {
-13  | |     posts {
-14  | |         id -> Integer,
-15  | |         title -> Text,
-16  | |         user_id -> Integer,
-17  | |     }
-18  | | }
-    | |_^
-    = note: 1 redundant requirements hidden
-    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: 2 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/selectable.rs:187:10
+    --> tests/fail/selectable.rs:12:1
+     |
+12   | / table! {
+13   | |     posts {
+14   | |         id -> Integer,
+15   | |         title -> Text,
+16   | |         user_id -> Integer,
+17   | |     }
+18   | | }
+     | |_^
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `Query` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+   --> tests/fail/selectable.rs:187:20
     |
 187 |         .returning(UserWithEmbeddedPost::as_select())
-    |          ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+    |          --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+    |          |
+    |          required by a bound introduced by this call
     |
-    = help: the following implementations were found:
+    = note: `posts::columns::id` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
               <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
               <posts::columns::id as SelectableExpression<Only<posts::table>>>
               <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
+              <posts::columns::id as SelectableExpression<posts::table>>
+              <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+note: required by a bound in `DeleteStatement::<T, U>::returning`
+   --> $DIESEL/src/query_builder/delete_statement/mod.rs
+    |
+    |         E: SelectableExpression<T>,
+    |            ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `DeleteStatement::<T, U>::returning`
 
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/selectable.rs:187:10
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+   --> tests/fail/selectable.rs:187:20
     |
 187 |         .returning(UserWithEmbeddedPost::as_select())
-    |          ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+    |          --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+    |          |
+    |          required by a bound introduced by this call
     |
-    = help: the following implementations were found:
+    = note: `posts::columns::title` is no valid selection for `users::table`
+    = help: the following other types implement trait `SelectableExpression<QS>`:
               <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
               <posts::columns::title as SelectableExpression<Only<posts::table>>>
               <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
+              <posts::columns::title as SelectableExpression<posts::table>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+              <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+note: required by a bound in `DeleteStatement::<T, U>::returning`
+   --> $DIESEL/src/query_builder/delete_statement/mod.rs
+    |
+    |         E: SelectableExpression<T>,
+    |            ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `DeleteStatement::<T, U>::returning`
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
-   --> tests/fail/selectable.rs:187:10
+   --> tests/fail/selectable.rs:187:20
     |
 187 |         .returning(UserWithEmbeddedPost::as_select())
-    |          ^^^^^^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
+    |          --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+    |          |
+    |          required by a bound introduced by this call
     |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
    --> tests/fail/selectable.rs:12:1
@@ -447,74 +652,98 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 17  | |     }
 18  | | }
     | |_^
-    = note: 1 redundant requirements hidden
+    = note: 1 redundant requirement hidden
     = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
     = note: 2 redundant requirements hidden
     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/selectable.rs:188:10
-    |
-188 |         .load(&mut conn)
-    |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
-    |
-    = help: the following implementations were found:
-              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
-              <posts::columns::id as SelectableExpression<Only<posts::table>>>
-              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: 2 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-
-error[E0277]: the trait bound `posts::columns::title: SelectableExpression<users::table>` is not satisfied
-   --> tests/fail/selectable.rs:188:10
-    |
-188 |         .load(&mut conn)
-    |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
-    |
-    = help: the following implementations were found:
-              <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
-              <posts::columns::title as SelectableExpression<Only<posts::table>>>
-              <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
-              <posts::columns::title as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-            and 2 others
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: 2 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `DeleteStatement::<T, U>::returning`
+   --> $DIESEL/src/query_builder/delete_statement/mod.rs
+    |
+    |         E: SelectableExpression<T>,
+    |            ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `DeleteStatement::<T, U>::returning`
+    = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+    --> tests/fail/selectable.rs:188:10
+     |
+188  |         .load(&mut conn)
+     |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+     |
+     = note: `posts::columns::id` is no valid selection for `users::table`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
+               <posts::columns::id as SelectableExpression<Only<posts::table>>>
+               <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
+               <posts::columns::id as SelectableExpression<posts::table>>
+               <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+               <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `Query` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+
+error[E0277]: Cannot select `posts::columns::title` from `users::table`
+    --> tests/fail/selectable.rs:188:10
+     |
+188  |         .load(&mut conn)
+     |          ^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::title`
+     |
+     = note: `posts::columns::title` is no valid selection for `users::table`
+     = help: the following other types implement trait `SelectableExpression<QS>`:
+               <posts::columns::title as SelectableExpression<JoinOn<Join, On>>>
+               <posts::columns::title as SelectableExpression<Only<posts::table>>>
+               <posts::columns::title as SelectableExpression<SelectStatement<FromClause<From>>>>
+               <posts::columns::title as SelectableExpression<posts::table>>
+               <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+               <posts::columns::title as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `Query` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
-   --> tests/fail/selectable.rs:188:10
-    |
-188 |         .load(&mut conn)
-    |          ^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-    |
+    --> tests/fail/selectable.rs:188:10
+     |
+188  |         .load(&mut conn)
+     |          ^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+     |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
-   --> tests/fail/selectable.rs:12:1
-    |
-12  | / table! {
-13  | |     posts {
-14  | |         id -> Integer,
-15  | |         title -> Text,
-16  | |         user_id -> Integer,
-17  | |     }
-18  | | }
-    | |_^
-    = note: 1 redundant requirements hidden
-    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
-    = note: 2 redundant requirements hidden
-    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
-    = note: required because of the requirements on the impl of `Query` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
-    = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+    --> tests/fail/selectable.rs:12:1
+     |
+12   | / table! {
+13   | |     posts {
+14   | |         id -> Integer,
+15   | |         title -> Text,
+16   | |         user_id -> Integer,
+17   | |     }
+18   | | }
+     | |_^
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::title)`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>`
+     = note: required because of the requirements on the impl of `Query` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, UserWithEmbeddedPost>` for `DeleteStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<UserWithEmbeddedPost, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0599]: the function or associated item `as_select` exists for struct `UserWithoutSelectable`, but its trait bounds were not satisfied
    --> tests/fail/selectable.rs:192:56
@@ -522,7 +751,7 @@ error[E0599]: the function or associated item `as_select` exists for struct `Use
 80  | struct UserWithoutSelectable {
     | ----------------------------
     | |
-    | function or associated item `as_select` not found for this
+    | function or associated item `as_select` not found for this struct
     | doesn't satisfy `UserWithoutSelectable: diesel::Selectable<_>`
     | doesn't satisfy `UserWithoutSelectable: diesel::SelectableHelper<_>`
 ...
@@ -536,89 +765,191 @@ error[E0599]: the function or associated item `as_select` exists for struct `Use
             which is required by `&UserWithoutSelectable: diesel::SelectableHelper<_>`
             `&mut UserWithoutSelectable: diesel::Selectable<_>`
             which is required by `&mut UserWithoutSelectable: diesel::SelectableHelper<_>`
+note: the following trait must be implemented
+   --> $DIESEL/src/expression/mod.rs
+    |
+    | pub trait Selectable<DB: Backend> {
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `diesel::expression::select_by::SelectBy<Post, _>: SingleValue` is not satisfied
-   --> tests/fail/selectable.rs:195:52
-    |
-195 |     let _ = posts::table.select(Post::as_select()).load::<(i32, String)>(&mut conn).unwrap();
-    |                                                    ^^^^ the trait `SingleValue` is not implemented for `diesel::expression::select_by::SelectBy<Post, _>`
-    |
-    = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String)>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<Post, _>>>`
+    --> tests/fail/selectable.rs:195:52
+     |
+195  |     let _ = posts::table.select(Post::as_select()).load::<(i32, String)>(&mut conn).unwrap();
+     |                                                    ^^^^ the trait `SingleValue` is not implemented for `diesel::expression::select_by::SelectBy<Post, _>`
+     |
+     = help: the following other types implement trait `SingleValue`:
+               Array<ST>
+               BigInt
+               Bool
+               Cidr
+               Datetime
+               Inet
+               Interval
+               Json
+             and 22 others
+     = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String)>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<Post, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `(i32, std::string::String): diesel::Queryable<diesel::expression::select_by::SelectBy<Post, _>, _>` is not satisfied
-   --> tests/fail/selectable.rs:195:52
-    |
-195 |     let _ = posts::table.select(Post::as_select()).load::<(i32, String)>(&mut conn).unwrap();
-    |                                                    ^^^^ the trait `diesel::Queryable<diesel::expression::select_by::SelectBy<Post, _>, _>` is not implemented for `(i32, std::string::String)`
-    |
-    = help: the following implementations were found:
-              <(T0, T1) as diesel::Queryable<(ST0, ST1), __DB>>
-              <(T0, T1) as diesel::Queryable<Record<(ST0, ST1)>, Pg>>
-              <(std::collections::Bound<T>, std::collections::Bound<T>) as diesel::Queryable<diesel::sql_types::Range<ST>, Pg>>
-    = note: required because of the requirements on the impl of `FromSqlRow<diesel::expression::select_by::SelectBy<Post, _>, _>` for `(i32, std::string::String)`
-    = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String)>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<Post, _>>>`
+    --> tests/fail/selectable.rs:195:52
+     |
+195  |     let _ = posts::table.select(Post::as_select()).load::<(i32, String)>(&mut conn).unwrap();
+     |                                                    ^^^^ the trait `diesel::Queryable<diesel::expression::select_by::SelectBy<Post, _>, _>` is not implemented for `(i32, std::string::String)`
+     |
+     = help: the following other types implement trait `diesel::Queryable<ST, DB>`:
+               <(T0, T1) as diesel::Queryable<(ST0, ST1), __DB>>
+               <(T0, T1) as diesel::Queryable<Record<(ST0, ST1)>, Pg>>
+               <(T0, T1, T2) as diesel::Queryable<(ST0, ST1, ST2), __DB>>
+               <(T0, T1, T2) as diesel::Queryable<Record<(ST0, ST1, ST2)>, Pg>>
+               <(T0, T1, T2, T3) as diesel::Queryable<(ST0, ST1, ST2, ST3), __DB>>
+               <(T0, T1, T2, T3) as diesel::Queryable<Record<(ST0, ST1, ST2, ST3)>, Pg>>
+               <(T0, T1, T2, T3, T4) as diesel::Queryable<(ST0, ST1, ST2, ST3, ST4), __DB>>
+               <(T0, T1, T2, T3, T4) as diesel::Queryable<Record<(ST0, ST1, ST2, ST3, ST4)>, Pg>>
+             and 25 others
+     = note: required because of the requirements on the impl of `FromSqlRow<diesel::expression::select_by::SelectBy<Post, _>, _>` for `(i32, std::string::String)`
+     = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String)>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<Post, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `diesel::expression::select_by::SelectBy<Post, _>: SingleValue` is not satisfied
-   --> tests/fail/selectable.rs:196:65
-    |
-196 |     let _ = posts::table.select(Post::as_select()).into_boxed().load::<(i32, String)>(&mut conn).unwrap();
-    |                                                                 ^^^^ the trait `SingleValue` is not implemented for `diesel::expression::select_by::SelectBy<Post, _>`
-    |
-    = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String)>` for `BoxedSelectStatement<'_, diesel::expression::select_by::SelectBy<Post, _>, FromClause<posts::table>, _>`
+    --> tests/fail/selectable.rs:196:65
+     |
+196  |     let _ = posts::table.select(Post::as_select()).into_boxed().load::<(i32, String)>(&mut conn).unwrap();
+     |                                                                 ^^^^ the trait `SingleValue` is not implemented for `diesel::expression::select_by::SelectBy<Post, _>`
+     |
+     = help: the following other types implement trait `SingleValue`:
+               Array<ST>
+               BigInt
+               Bool
+               Cidr
+               Datetime
+               Inet
+               Interval
+               Json
+             and 22 others
+     = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String)>` for `BoxedSelectStatement<'_, diesel::expression::select_by::SelectBy<Post, _>, FromClause<posts::table>, _>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `(i32, std::string::String): diesel::Queryable<diesel::expression::select_by::SelectBy<Post, _>, _>` is not satisfied
-   --> tests/fail/selectable.rs:196:65
-    |
-196 |     let _ = posts::table.select(Post::as_select()).into_boxed().load::<(i32, String)>(&mut conn).unwrap();
-    |                                                                 ^^^^ the trait `diesel::Queryable<diesel::expression::select_by::SelectBy<Post, _>, _>` is not implemented for `(i32, std::string::String)`
-    |
-    = help: the following implementations were found:
-              <(T0, T1) as diesel::Queryable<(ST0, ST1), __DB>>
-              <(T0, T1) as diesel::Queryable<Record<(ST0, ST1)>, Pg>>
-              <(std::collections::Bound<T>, std::collections::Bound<T>) as diesel::Queryable<diesel::sql_types::Range<ST>, Pg>>
-    = note: required because of the requirements on the impl of `FromSqlRow<diesel::expression::select_by::SelectBy<Post, _>, _>` for `(i32, std::string::String)`
-    = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String)>` for `BoxedSelectStatement<'_, diesel::expression::select_by::SelectBy<Post, _>, FromClause<posts::table>, _>`
+    --> tests/fail/selectable.rs:196:65
+     |
+196  |     let _ = posts::table.select(Post::as_select()).into_boxed().load::<(i32, String)>(&mut conn).unwrap();
+     |                                                                 ^^^^ the trait `diesel::Queryable<diesel::expression::select_by::SelectBy<Post, _>, _>` is not implemented for `(i32, std::string::String)`
+     |
+     = help: the following other types implement trait `diesel::Queryable<ST, DB>`:
+               <(T0, T1) as diesel::Queryable<(ST0, ST1), __DB>>
+               <(T0, T1) as diesel::Queryable<Record<(ST0, ST1)>, Pg>>
+               <(T0, T1, T2) as diesel::Queryable<(ST0, ST1, ST2), __DB>>
+               <(T0, T1, T2) as diesel::Queryable<Record<(ST0, ST1, ST2)>, Pg>>
+               <(T0, T1, T2, T3) as diesel::Queryable<(ST0, ST1, ST2, ST3), __DB>>
+               <(T0, T1, T2, T3) as diesel::Queryable<Record<(ST0, ST1, ST2, ST3)>, Pg>>
+               <(T0, T1, T2, T3, T4) as diesel::Queryable<(ST0, ST1, ST2, ST3, ST4), __DB>>
+               <(T0, T1, T2, T3, T4) as diesel::Queryable<Record<(ST0, ST1, ST2, ST3, ST4)>, Pg>>
+             and 25 others
+     = note: required because of the requirements on the impl of `FromSqlRow<diesel::expression::select_by::SelectBy<Post, _>, _>` for `(i32, std::string::String)`
+     = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String)>` for `BoxedSelectStatement<'_, diesel::expression::select_by::SelectBy<Post, _>, FromClause<posts::table>, _>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `(diesel::expression::select_by::SelectBy<Post, _>, diesel::sql_types::Text): load_dsl::private::CompatibleType<((i32, std::string::String), std::string::String), _>` is not satisfied
-   --> tests/fail/selectable.rs:197:68
-    |
-197 |     let _ = posts::table.select((Post::as_select(), posts::title)).load::<((i32, String), String)>(&mut conn).unwrap();
-    |                                                                    ^^^^ the trait `load_dsl::private::CompatibleType<((i32, std::string::String), std::string::String), _>` is not implemented for `(diesel::expression::select_by::SelectBy<Post, _>, diesel::sql_types::Text)`
-    |
-    = help: the following implementations were found:
-              <(ST0, ST1) as load_dsl::private::CompatibleType<__T, __DB>>
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, ((i32, std::string::String), std::string::String)>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<(diesel::expression::select_by::SelectBy<Post, _>, posts::columns::title)>>`
+    --> tests/fail/selectable.rs:197:68
+     |
+197  |     let _ = posts::table.select((Post::as_select(), posts::title)).load::<((i32, String), String)>(&mut conn).unwrap();
+     |                                                                    ^^^^ the trait `load_dsl::private::CompatibleType<((i32, std::string::String), std::string::String), _>` is not implemented for `(diesel::expression::select_by::SelectBy<Post, _>, diesel::sql_types::Text)`
+     |
+     = help: the following other types implement trait `load_dsl::private::CompatibleType<U, DB>`:
+               (ST0, ST1)
+               (ST0, ST1, ST2)
+               (ST0, ST1, ST2, ST3)
+               (ST0, ST1, ST2, ST3, ST4)
+               (ST0, ST1, ST2, ST3, ST4, ST5)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7)
+               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8)
+             and 8 others
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, ((i32, std::string::String), std::string::String)>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<(diesel::expression::select_by::SelectBy<Post, _>, posts::columns::title)>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `diesel::expression::select_by::SelectBy<Post, _>: SingleValue` is not satisfied
-   --> tests/fail/selectable.rs:201:10
-    |
-201 |         .load::<(i32, String, i32)>(&mut conn)
-    |          ^^^^ the trait `SingleValue` is not implemented for `diesel::expression::select_by::SelectBy<Post, _>`
-    |
-    = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String, i32), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String, i32)>` for `InsertStatement<posts::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<posts::columns::title, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, posts::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<Post, _>>>`
+    --> tests/fail/selectable.rs:201:10
+     |
+201  |         .load::<(i32, String, i32)>(&mut conn)
+     |          ^^^^ the trait `SingleValue` is not implemented for `diesel::expression::select_by::SelectBy<Post, _>`
+     |
+     = help: the following other types implement trait `SingleValue`:
+               Array<ST>
+               BigInt
+               Bool
+               Cidr
+               Datetime
+               Inet
+               Interval
+               Json
+             and 22 others
+     = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String, i32), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String, i32)>` for `InsertStatement<posts::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<posts::columns::title, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, posts::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<Post, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0277]: the trait bound `(i32, std::string::String, i32): diesel::Queryable<diesel::expression::select_by::SelectBy<Post, _>, _>` is not satisfied
-   --> tests/fail/selectable.rs:201:10
-    |
-201 |         .load::<(i32, String, i32)>(&mut conn)
-    |          ^^^^ the trait `diesel::Queryable<diesel::expression::select_by::SelectBy<Post, _>, _>` is not implemented for `(i32, std::string::String, i32)`
-    |
-    = help: the following implementations were found:
-              <(T0, T1, T2) as diesel::Queryable<(ST0, ST1, ST2), __DB>>
-              <(T0, T1, T2) as diesel::Queryable<Record<(ST0, ST1, ST2)>, Pg>>
-    = note: required because of the requirements on the impl of `FromSqlRow<diesel::expression::select_by::SelectBy<Post, _>, _>` for `(i32, std::string::String, i32)`
-    = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String, i32), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String, i32)>` for `InsertStatement<posts::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<posts::columns::title, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, posts::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<Post, _>>>`
+    --> tests/fail/selectable.rs:201:10
+     |
+201  |         .load::<(i32, String, i32)>(&mut conn)
+     |          ^^^^ the trait `diesel::Queryable<diesel::expression::select_by::SelectBy<Post, _>, _>` is not implemented for `(i32, std::string::String, i32)`
+     |
+     = help: the following other types implement trait `diesel::Queryable<ST, DB>`:
+               <(T0, T1) as diesel::Queryable<(ST0, ST1), __DB>>
+               <(T0, T1) as diesel::Queryable<Record<(ST0, ST1)>, Pg>>
+               <(T0, T1, T2) as diesel::Queryable<(ST0, ST1, ST2), __DB>>
+               <(T0, T1, T2) as diesel::Queryable<Record<(ST0, ST1, ST2)>, Pg>>
+               <(T0, T1, T2, T3) as diesel::Queryable<(ST0, ST1, ST2, ST3), __DB>>
+               <(T0, T1, T2, T3) as diesel::Queryable<Record<(ST0, ST1, ST2, ST3)>, Pg>>
+               <(T0, T1, T2, T3, T4) as diesel::Queryable<(ST0, ST1, ST2, ST3, ST4), __DB>>
+               <(T0, T1, T2, T3, T4) as diesel::Queryable<Record<(ST0, ST1, ST2, ST3, ST4)>, Pg>>
+             and 25 others
+     = note: required because of the requirements on the impl of `FromSqlRow<diesel::expression::select_by::SelectBy<Post, _>, _>` for `(i32, std::string::String, i32)`
+     = note: required because of the requirements on the impl of `load_dsl::private::CompatibleType<(i32, std::string::String, i32), _>` for `diesel::expression::select_by::SelectBy<Post, _>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32, std::string::String, i32)>` for `InsertStatement<posts::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<posts::columns::title, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, posts::table>, diesel::query_builder::insert_statement::private::Insert, diesel::query_builder::returning_clause::ReturningClause<diesel::expression::select_by::SelectBy<Post, _>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0271]: type mismatch resolving `<diesel::SqliteConnection as diesel::Connection>::Backend == Pg`
-   --> tests/fail/selectable.rs:210:10
-    |
-210 |         .load(&mut conn)
-    |          ^^^^ expected struct `Sqlite`, found struct `Pg`
-    |
-    = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, UserWithPostCount>` for `SelectStatement<FromClause<JoinOn<diesel::internal::table_macro::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithPostCount, Pg>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<users::columns::id>>`
+    --> tests/fail/selectable.rs:210:10
+     |
+210  |         .load(&mut conn)
+     |          ^^^^ expected struct `Pg`, found struct `Sqlite`
+     |
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, UserWithPostCount>` for `SelectStatement<FromClause<JoinOn<query_source::joins::Join<users::table, posts::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<posts::columns::user_id>, NullableExpression<users::columns::id>>>>>, diesel::query_builder::select_clause::SelectClause<diesel::expression::select_by::SelectBy<UserWithPostCount, Pg>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<users::columns::id>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
diff --git a/diesel_compile_tests/tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.stderr b/diesel_compile_tests/tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.stderr
index 6916480d9bfc..020e1e1ee8cd 100644
--- a/diesel_compile_tests/tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.stderr
+++ b/diesel_compile_tests/tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.stderr
@@ -1,30 +1,34 @@
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.rs:21:37
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+  --> tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.rs:21:30
    |
 21 |     let stuff = users::table.select((posts::id, posts::user_id));
-   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+   |                              ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::id` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::id as SelectableExpression<Only<posts::table>>>
              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <posts::columns::id as SelectableExpression<posts::table>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::user_id)`
    = note: required because of the requirements on the impl of `SelectDsl<(posts::columns::id, posts::columns::user_id)>` for `SelectStatement<FromClause<users::table>>`
 
-error[E0277]: the trait bound `posts::columns::user_id: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.rs:21:37
+error[E0277]: Cannot select `posts::columns::user_id` from `users::table`
+  --> tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.rs:21:30
    |
 21 |     let stuff = users::table.select((posts::id, posts::user_id));
-   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::user_id`
+   |                              ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::user_id`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::user_id` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::user_id as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::user_id as SelectableExpression<Only<posts::table>>>
              <posts::columns::user_id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::user_id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <posts::columns::user_id as SelectableExpression<posts::table>>
+             <posts::columns::user_id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::user_id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::user_id)`
    = note: required because of the requirements on the impl of `SelectDsl<(posts::columns::id, posts::columns::user_id)>` for `SelectStatement<FromClause<users::table>>`
 
@@ -45,11 +49,11 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 17 | |     }
 18 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, posts::columns::user_id)`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::user_id)`
    = note: required because of the requirements on the impl of `SelectDsl<(posts::columns::id, posts::columns::user_id)>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
   --> tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.rs:21:30
@@ -57,6 +61,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
 21 |     let stuff = users::table.select((posts::id, posts::user_id));
    |                              ^^^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
   --> tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.rs:12:1
@@ -69,24 +80,26 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 17 | |     }
 18 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, posts::columns::user_id)`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, posts::columns::user_id)`
    = note: required because of the requirements on the impl of `SelectDsl<(posts::columns::id, posts::columns::user_id)>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `posts::columns::id: SelectableExpression<users::table>` is not satisfied
-  --> tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.rs:22:37
+error[E0277]: Cannot select `posts::columns::id` from `users::table`
+  --> tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.rs:22:30
    |
 22 |     let stuff = users::table.select((posts::id, users::name));
-   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
+   |                              ^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
    |
-   = help: the following implementations were found:
+   = note: `posts::columns::id` is no valid selection for `users::table`
+   = help: the following other types implement trait `SelectableExpression<QS>`:
              <posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
              <posts::columns::id as SelectableExpression<Only<posts::table>>>
              <posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
-             <posts::columns::id as SelectableExpression<diesel::internal::table_macro::Join<Left, Right, Inner>>>
-           and 2 others
+             <posts::columns::id as SelectableExpression<posts::table>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
+             <posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, users::columns::name)`
    = note: required because of the requirements on the impl of `SelectDsl<(posts::columns::id, users::columns::name)>` for `SelectStatement<FromClause<users::table>>`
 
@@ -107,11 +120,11 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 17 | |     }
 18 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, users::columns::name)`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, users::columns::name)`
    = note: required because of the requirements on the impl of `SelectDsl<(posts::columns::id, users::columns::name)>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
   --> tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.rs:22:30
@@ -119,6 +132,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
 22 |     let stuff = users::table.select((posts::id, users::name));
    |                              ^^^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
   --> tests/fail/selecting_multiple_columns_requires_all_must_be_from_selectable_table.rs:12:1
@@ -131,8 +151,8 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 17 | |     }
 18 | | }
    | |_^
-   = note: 1 redundant requirements hidden
+   = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `(posts::columns::id, users::columns::name)`
    = note: required because of the requirements on the impl of `SelectableExpression<users::table>` for `(posts::columns::id, users::columns::name)`
    = note: required because of the requirements on the impl of `SelectDsl<(posts::columns::id, users::columns::name)>` for `SelectStatement<FromClause<users::table>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/sqlite_insert_or_ignore_cannot_be_used_on_pg.stderr b/diesel_compile_tests/tests/fail/sqlite_insert_or_ignore_cannot_be_used_on_pg.stderr
index e93f1b78fbb2..c1bbeee7c771 100644
--- a/diesel_compile_tests/tests/fail/sqlite_insert_or_ignore_cannot_be_used_on_pg.stderr
+++ b/diesel_compile_tests/tests/fail/sqlite_insert_or_ignore_cannot_be_used_on_pg.stderr
@@ -1,11 +1,16 @@
 error[E0277]: the trait bound `diesel::query_builder::insert_statement::private::InsertOrIgnore: QueryFragment<Pg>` is not satisfied
-  --> tests/fail/sqlite_insert_or_ignore_cannot_be_used_on_pg.rs:21:10
-   |
-21 |         .execute(&mut connection)
-   |          ^^^^^^^ the trait `QueryFragment<Pg>` is not implemented for `diesel::query_builder::insert_statement::private::InsertOrIgnore`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::insert_statement::private::InsertOrIgnore as QueryFragment<Mysql>>
-             <diesel::query_builder::insert_statement::private::InsertOrIgnore as QueryFragment<Sqlite>>
-   = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, users::table>, diesel::query_builder::insert_statement::private::InsertOrIgnore>`
-   = note: required because of the requirements on the impl of `ExecuteDsl<diesel::PgConnection, Pg>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, users::table>, diesel::query_builder::insert_statement::private::InsertOrIgnore>`
+    --> tests/fail/sqlite_insert_or_ignore_cannot_be_used_on_pg.rs:21:10
+     |
+21   |         .execute(&mut connection)
+     |          ^^^^^^^ the trait `QueryFragment<Pg>` is not implemented for `diesel::query_builder::insert_statement::private::InsertOrIgnore`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::insert_statement::private::InsertOrIgnore as QueryFragment<Mysql>>
+               <diesel::query_builder::insert_statement::private::InsertOrIgnore as QueryFragment<Sqlite>>
+     = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, users::table>, diesel::query_builder::insert_statement::private::InsertOrIgnore>`
+     = note: required because of the requirements on the impl of `ExecuteDsl<diesel::PgConnection, Pg>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, users::table>, diesel::query_builder::insert_statement::private::InsertOrIgnore>`
+note: required by a bound in `diesel::RunQueryDsl::execute`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: methods::ExecuteDsl<Conn>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::execute`
diff --git a/diesel_compile_tests/tests/fail/sqlite_upsert_cannot_be_used_on_pg.stderr b/diesel_compile_tests/tests/fail/sqlite_upsert_cannot_be_used_on_pg.stderr
index a23988aa7133..329493a36d69 100644
--- a/diesel_compile_tests/tests/fail/sqlite_upsert_cannot_be_used_on_pg.stderr
+++ b/diesel_compile_tests/tests/fail/sqlite_upsert_cannot_be_used_on_pg.stderr
@@ -1,11 +1,16 @@
 error[E0277]: the trait bound `diesel::query_builder::insert_statement::private::Replace: QueryFragment<Pg>` is not satisfied
-  --> tests/fail/sqlite_upsert_cannot_be_used_on_pg.rs:21:10
-   |
-21 |         .execute(&mut connection);
-   |          ^^^^^^^ the trait `QueryFragment<Pg>` is not implemented for `diesel::query_builder::insert_statement::private::Replace`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::insert_statement::private::Replace as QueryFragment<Mysql>>
-             <diesel::query_builder::insert_statement::private::Replace as QueryFragment<Sqlite>>
-   = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, &i32>>>,), users::table>, diesel::query_builder::insert_statement::private::Replace>`
-   = note: required because of the requirements on the impl of `ExecuteDsl<diesel::PgConnection, Pg>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, &i32>>>,), users::table>, diesel::query_builder::insert_statement::private::Replace>`
+    --> tests/fail/sqlite_upsert_cannot_be_used_on_pg.rs:21:10
+     |
+21   |         .execute(&mut connection);
+     |          ^^^^^^^ the trait `QueryFragment<Pg>` is not implemented for `diesel::query_builder::insert_statement::private::Replace`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::insert_statement::private::Replace as QueryFragment<Mysql>>
+               <diesel::query_builder::insert_statement::private::Replace as QueryFragment<Sqlite>>
+     = note: required because of the requirements on the impl of `QueryFragment<Pg>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, &i32>>>,), users::table>, diesel::query_builder::insert_statement::private::Replace>`
+     = note: required because of the requirements on the impl of `ExecuteDsl<diesel::PgConnection, Pg>` for `InsertStatement<users::table, diesel::query_builder::insert_statement::ValuesClause<(DefaultableColumnInsertValue<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, &i32>>>,), users::table>, diesel::query_builder::insert_statement::private::Replace>`
+note: required by a bound in `diesel::RunQueryDsl::execute`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: methods::ExecuteDsl<Conn>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::execute`
diff --git a/diesel_compile_tests/tests/fail/subselect_cannot_reference_random_tables.stderr b/diesel_compile_tests/tests/fail/subselect_cannot_reference_random_tables.stderr
index cbc2c9f96843..91f6f395aec3 100644
--- a/diesel_compile_tests/tests/fail/subselect_cannot_reference_random_tables.stderr
+++ b/diesel_compile_tests/tests/fail/subselect_cannot_reference_random_tables.stderr
@@ -12,77 +12,92 @@ warning: use of deprecated function `diesel::dsl::any`: Use `ExpressionMethods::
 26 |     use diesel::dsl::{any, exists};
    |                       ^^^
 
-error[E0271]: type mismatch resolving `<diesel::internal::table_macro::Join<posts::table, users::table, Inner> as AppearsInFromClause<comments::table>>::Count == diesel::query_source::Once`
-  --> tests/fail/subselect_cannot_reference_random_tables.rs:32:10
-   |
-32 |         .load::<(i32,)>(&mut conn);
-   |          ^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-   |
-note: required because of the requirements on the impl of `AppearsOnTable<diesel::internal::table_macro::Join<posts::table, users::table, Inner>>` for `comments::columns::id`
-  --> tests/fail/subselect_cannot_reference_random_tables.rs:17:1
-   |
-17 | / table! {
-18 | |     comments {
-19 | |         id -> Integer,
-20 | |     }
-21 | | }
-   | |_^
-   = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<diesel::internal::table_macro::Join<posts::table, users::table, Inner>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<diesel::internal::table_macro::Join<posts::table, users::table, Inner>>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>`
-   = note: required because of the requirements on the impl of `diesel::expression::subselect::ValidSubselect<users::table>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
-   = note: 4 redundant requirements hidden
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::array_comparison::In<users::columns::id, diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>, diesel::sql_types::Integer>>>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::array_comparison::In<users::columns::id, diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>, diesel::sql_types::Integer>>>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32,)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::array_comparison::In<users::columns::id, diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>, diesel::sql_types::Integer>>>>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+error[E0271]: type mismatch resolving `<query_source::joins::Join<posts::table, users::table, Inner> as AppearsInFromClause<comments::table>>::Count == diesel::query_source::Once`
+    --> tests/fail/subselect_cannot_reference_random_tables.rs:32:10
+     |
+32   |         .load::<(i32,)>(&mut conn);
+     |          ^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+     |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<posts::table, users::table, Inner>>` for `comments::columns::id`
+    --> tests/fail/subselect_cannot_reference_random_tables.rs:17:1
+     |
+17   | / table! {
+18   | |     comments {
+19   | |         id -> Integer,
+20   | |     }
+21   | | }
+     | |_^
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<posts::table, users::table, Inner>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<query_source::joins::Join<posts::table, users::table, Inner>>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>`
+     = note: required because of the requirements on the impl of `diesel::expression::subselect::ValidSubselect<users::table>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
+     = note: 4 redundant requirements hidden
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::array_comparison::In<users::columns::id, diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>, diesel::sql_types::Integer>>>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::array_comparison::In<users::columns::id, diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>, diesel::sql_types::Integer>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32,)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::array_comparison::In<users::columns::id, diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>, diesel::sql_types::Integer>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0271]: type mismatch resolving `<diesel::internal::table_macro::Join<posts::table, users::table, Inner> as AppearsInFromClause<comments::table>>::Count == diesel::query_source::Once`
-  --> tests/fail/subselect_cannot_reference_random_tables.rs:38:10
-   |
-38 |         .load::<(i32,)>(&mut conn);
-   |          ^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-   |
-note: required because of the requirements on the impl of `AppearsOnTable<diesel::internal::table_macro::Join<posts::table, users::table, Inner>>` for `comments::columns::id`
-  --> tests/fail/subselect_cannot_reference_random_tables.rs:17:1
-   |
-17 | / table! {
-18 | |     comments {
-19 | |         id -> Integer,
-20 | |     }
-21 | | }
-   | |_^
-   = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<diesel::internal::table_macro::Join<posts::table, users::table, Inner>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<diesel::internal::table_macro::Join<posts::table, users::table, Inner>>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>`
-   = note: required because of the requirements on the impl of `diesel::expression::subselect::ValidSubselect<users::table>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
-   = note: 5 redundant requirements hidden
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::pg::expression::array_comparison::Any<diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>, Array<diesel::sql_types::Integer>>>>>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::pg::expression::array_comparison::Any<diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>, Array<diesel::sql_types::Integer>>>>>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32,)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::pg::expression::array_comparison::Any<diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>, Array<diesel::sql_types::Integer>>>>>>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+error[E0271]: type mismatch resolving `<query_source::joins::Join<posts::table, users::table, Inner> as AppearsInFromClause<comments::table>>::Count == diesel::query_source::Once`
+    --> tests/fail/subselect_cannot_reference_random_tables.rs:38:10
+     |
+38   |         .load::<(i32,)>(&mut conn);
+     |          ^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+     |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<posts::table, users::table, Inner>>` for `comments::columns::id`
+    --> tests/fail/subselect_cannot_reference_random_tables.rs:17:1
+     |
+17   | / table! {
+18   | |     comments {
+19   | |         id -> Integer,
+20   | |     }
+21   | | }
+     | |_^
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<posts::table, users::table, Inner>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<query_source::joins::Join<posts::table, users::table, Inner>>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>`
+     = note: required because of the requirements on the impl of `diesel::expression::subselect::ValidSubselect<users::table>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
+     = note: 5 redundant requirements hidden
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::pg::expression::array_comparison::Any<diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>, Array<diesel::sql_types::Integer>>>>>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::pg::expression::array_comparison::Any<diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>, Array<diesel::sql_types::Integer>>>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32,)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::pg::expression::array_comparison::Any<diesel::expression::subselect::Subselect<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::SelectClause<posts::columns::id>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>, Array<diesel::sql_types::Integer>>>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0271]: type mismatch resolving `<diesel::internal::table_macro::Join<posts::table, users::table, Inner> as AppearsInFromClause<comments::table>>::Count == diesel::query_source::Once`
-  --> tests/fail/subselect_cannot_reference_random_tables.rs:42:10
-   |
-42 |         .load::<(i32,)>(&mut conn);
-   |          ^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-   |
-note: required because of the requirements on the impl of `AppearsOnTable<diesel::internal::table_macro::Join<posts::table, users::table, Inner>>` for `comments::columns::id`
-  --> tests/fail/subselect_cannot_reference_random_tables.rs:17:1
-   |
-17 | / table! {
-18 | |     comments {
-19 | |         id -> Integer,
-20 | |     }
-21 | | }
-   | |_^
-   = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<diesel::internal::table_macro::Join<posts::table, users::table, Inner>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<diesel::internal::table_macro::Join<posts::table, users::table, Inner>>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>`
-   = note: required because of the requirements on the impl of `diesel::expression::subselect::ValidSubselect<users::table>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<posts::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
-   = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::exists::Exists<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<posts::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::exists::Exists<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<posts::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32,)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::exists::Exists<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<posts::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>>>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+error[E0271]: type mismatch resolving `<query_source::joins::Join<posts::table, users::table, Inner> as AppearsInFromClause<comments::table>>::Count == diesel::query_source::Once`
+    --> tests/fail/subselect_cannot_reference_random_tables.rs:42:10
+     |
+42   |         .load::<(i32,)>(&mut conn);
+     |          ^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+     |
+note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<posts::table, users::table, Inner>>` for `comments::columns::id`
+    --> tests/fail/subselect_cannot_reference_random_tables.rs:17:1
+     |
+17   | / table! {
+18   | |     comments {
+19   | |         id -> Integer,
+20   | |     }
+21   | | }
+     | |_^
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<query_source::joins::Join<posts::table, users::table, Inner>>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<query_source::joins::Join<posts::table, users::table, Inner>>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>`
+     = note: required because of the requirements on the impl of `diesel::expression::subselect::ValidSubselect<users::table>` for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<posts::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::exists::Exists<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<posts::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::exists::Exists<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<posts::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, (i32,)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::exists::Exists<SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<posts::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<comments::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/subselect_requires_correct_type.stderr b/diesel_compile_tests/tests/fail/subselect_requires_correct_type.stderr
index ecd27af7d743..1a89f130fa80 100644
--- a/diesel_compile_tests/tests/fail/subselect_requires_correct_type.stderr
+++ b/diesel_compile_tests/tests/fail/subselect_requires_correct_type.stderr
@@ -1,8 +1,14 @@
-error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>: diesel::expression::array_comparison::AsInExpression<diesel::sql_types::Integer>` is not satisfied
+error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>: diesel::expression::array_comparison::AsInExpression<diesel::sql_types::Integer>` is not satisfied
   --> tests/fail/subselect_requires_correct_type.rs:22:59
    |
 22 |     let query = posts::table.filter(posts::user_id.eq_any(subquery));
-   |                                                           ^^^^^^^^ the trait `diesel::expression::array_comparison::AsInExpression<diesel::sql_types::Integer>` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
+   |                                                    ------ ^^^^^^^^ the trait `diesel::expression::array_comparison::AsInExpression<diesel::sql_types::Integer>` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
+   |                                                    |
+   |                                                    required by a bound introduced by this call
    |
-   = help: the following implementations were found:
-             <SelectStatement<F, S, D, W, O, LOf, G, H, LC> as diesel::expression::array_comparison::AsInExpression<ST>>
+   = help: the trait `diesel::expression::array_comparison::AsInExpression<ST>` is implemented for `SelectStatement<F, S, D, W, O, LOf, G, H, LC>`
+note: required by a bound in `eq_any`
+  --> $DIESEL/src/expression_methods/global_expression_methods.rs
+   |
+   |         T: AsInExpression<Self::SqlType>,
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `eq_any`
diff --git a/diesel_compile_tests/tests/fail/table_column_names.stderr b/diesel_compile_tests/tests/fail/table_column_names.stderr
index f6a5f1309f42..91db45517ec2 100644
--- a/diesel_compile_tests/tests/fail/table_column_names.stderr
+++ b/diesel_compile_tests/tests/fail/table_column_names.stderr
@@ -1,7 +1,6 @@
 error: Column `users` cannot be named the same as its table.
- You may use `#[sql_name = "users"]` to reference the table's `users` column.
- Docs available at: `https://docs.diesel.rs/diesel/macro.table.html`
-
+        You may use `#[sql_name = "users"]` to reference the table's `users` column.
+        Docs available at: `https://docs.diesel.rs/diesel/macro.table.html`
  --> tests/fail/table_column_names.rs:3:1
   |
 3 | / table! {
@@ -12,4 +11,4 @@ error: Column `users` cannot be named the same as its table.
 8 | | }
   | |_^
   |
-  = note: this error originates in the macro `__static_cond` (in Nightly builds, run with -Z macro-backtrace for more info)
+  = note: this error originates in the macro `__static_cond` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/table_invalid_syntax_1.stderr b/diesel_compile_tests/tests/fail/table_invalid_syntax_1.stderr
index 0ddcec410d68..79bf2cb4dabc 100644
--- a/diesel_compile_tests/tests/fail/table_invalid_syntax_1.stderr
+++ b/diesel_compile_tests/tests/fail/table_invalid_syntax_1.stderr
@@ -6,4 +6,4 @@ error: Invalid `table!` syntax. Please see the `table!` macro docs for more info
 5 | | }
   | |_^
   |
-  = note: this error originates in the macro `$crate::__diesel_invalid_table_syntax` (in Nightly builds, run with -Z macro-backtrace for more info)
+  = note: this error originates in the macro `$crate::__diesel_invalid_table_syntax` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/table_invalid_syntax_2.stderr b/diesel_compile_tests/tests/fail/table_invalid_syntax_2.stderr
index b93fb39c0e17..a6219b1766c5 100644
--- a/diesel_compile_tests/tests/fail/table_invalid_syntax_2.stderr
+++ b/diesel_compile_tests/tests/fail/table_invalid_syntax_2.stderr
@@ -6,4 +6,4 @@ error: Invalid `table!` syntax. Please see the `table!` macro docs for more info
 5 | | }
   | |_^
   |
-  = note: this error originates in the macro `$crate::__diesel_invalid_table_syntax` (in Nightly builds, run with -Z macro-backtrace for more info)
+  = note: this error originates in the macro `$crate::__diesel_invalid_table_syntax` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/update_requires_column_be_from_same_table.stderr b/diesel_compile_tests/tests/fail/update_requires_column_be_from_same_table.stderr
index e8d40b3fb94c..b0cfaaae5a2e 100644
--- a/diesel_compile_tests/tests/fail/update_requires_column_be_from_same_table.stderr
+++ b/diesel_compile_tests/tests/fail/update_requires_column_be_from_same_table.stderr
@@ -1,14 +1,22 @@
-error[E0271]: type mismatch resolving `<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>> as AsChangeset>::Target == users::table`
+error[E0271]: type mismatch resolving `<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::title, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>> as AsChangeset>::Target == users::table`
   --> tests/fail/update_requires_column_be_from_same_table.rs:22:33
    |
 22 |     let command = update(users).set(posts::title.eq("Hello"));
-   |                                 ^^^ expected struct `posts::table`, found struct `users::table`
+   |                                 ^^^ expected struct `users::table`, found struct `posts::table`
+   |
+note: required by a bound in `UpdateStatement::<T, U>::set`
+  --> $DIESEL/src/query_builder/update_statement/mod.rs
+   |
+   |         V: changeset::AsChangeset<Target = T>,
+   |                                   ^^^^^^^^^^ required by this bound in `UpdateStatement::<T, U>::set`
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
-  --> tests/fail/update_requires_column_be_from_same_table.rs:23:33
+  --> tests/fail/update_requires_column_be_from_same_table.rs:23:37
    |
 23 |     let command = update(users).set(name.eq(posts::title));
-   |                                 ^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
+   |                                 --- ^^^^^^^^^^^^^^^^^^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
+   |                                 |
+   |                                 required by a bound introduced by this call
    |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::title`
   --> tests/fail/update_requires_column_be_from_same_table.rs:12:1
@@ -21,14 +29,23 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 17 | | }
    | |_^
    = note: required because of the requirements on the impl of `AsChangeset` for `diesel::expression::operators::Eq<users::columns::name, posts::columns::title>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
-  --> tests/fail/update_requires_column_be_from_same_table.rs:23:33
+  --> tests/fail/update_requires_column_be_from_same_table.rs:23:37
    |
 23 |     let command = update(users).set(name.eq(posts::title));
-   |                                 ^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
+   |                                 --- ^^^^^^^^^^^^^^^^^^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
+   |                                 |
+   |                                 required by a bound introduced by this call
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::title`
   --> tests/fail/update_requires_column_be_from_same_table.rs:12:1
@@ -41,4 +58,4 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 17 | | }
    | |_^
    = note: required because of the requirements on the impl of `AsChangeset` for `diesel::expression::operators::Eq<users::columns::name, posts::columns::title>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/update_requires_left_side_of_eq_to_be_a_column.stderr b/diesel_compile_tests/tests/fail/update_requires_left_side_of_eq_to_be_a_column.stderr
index 258a06b52f82..9f8d440ff964 100644
--- a/diesel_compile_tests/tests/fail/update_requires_left_side_of_eq_to_be_a_column.stderr
+++ b/diesel_compile_tests/tests/fail/update_requires_left_side_of_eq_to_be_a_column.stderr
@@ -1,8 +1,19 @@
-error[E0277]: the trait bound `diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>: Column` is not satisfied
+error[E0277]: the trait bound `diesel::expression::bound::Bound<diesel::sql_types::Text, &str>: Column` is not satisfied
   --> tests/fail/update_requires_left_side_of_eq_to_be_a_column.rs:16:37
    |
 16 |     let command = update(users).set(foo.eq(name));
-   |                                     ^^^^^^^^^^^^ the trait `Column` is not implemented for `diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>`
+   |                                 --- ^^^^^^^^^^^^ the trait `Column` is not implemented for `diesel::expression::bound::Bound<diesel::sql_types::Text, &str>`
+   |                                 |
+   |                                 required by a bound introduced by this call
    |
-   = note: required because of the requirements on the impl of `diesel::query_builder::update_statement::changeset::AssignmentTarget` for `diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>`
-   = note: required because of the requirements on the impl of `AsChangeset` for `diesel::expression::operators::Eq<diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>, columns::name>`
+   = help: the following other types implement trait `Column`:
+             columns::id
+             columns::name
+             pg::metadata_lookup::pg_namespace::columns::nspname
+             pg::metadata_lookup::pg_namespace::columns::oid
+             pg::metadata_lookup::pg_type::columns::oid
+             pg::metadata_lookup::pg_type::columns::typarray
+             pg::metadata_lookup::pg_type::columns::typname
+             pg::metadata_lookup::pg_type::columns::typnamespace
+   = note: required because of the requirements on the impl of `diesel::query_builder::update_statement::changeset::AssignmentTarget` for `diesel::expression::bound::Bound<diesel::sql_types::Text, &str>`
+   = note: required because of the requirements on the impl of `AsChangeset` for `diesel::expression::operators::Eq<diesel::expression::bound::Bound<diesel::sql_types::Text, &str>, columns::name>`
diff --git a/diesel_compile_tests/tests/fail/update_requires_set.stderr b/diesel_compile_tests/tests/fail/update_requires_set.stderr
index afc0573f9bba..bed14ad7425c 100644
--- a/diesel_compile_tests/tests/fail/update_requires_set.stderr
+++ b/diesel_compile_tests/tests/fail/update_requires_set.stderr
@@ -1,8 +1,23 @@
 error[E0277]: the trait bound `diesel::query_builder::update_statement::SetNotCalled: QueryFragment<_>` is not satisfied
-  --> $DIR/update_requires_set.rs:14:10
-   |
-14 |         .execute(&mut conn);
-   |          ^^^^^^^ the trait `QueryFragment<_>` is not implemented for `diesel::query_builder::update_statement::SetNotCalled`
-   |
-   = note: required because of the requirements on the impl of `QueryFragment<_>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause>`
-   = note: required because of the requirements on the impl of `ExecuteDsl<_, _>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause>`
+    --> tests/fail/update_requires_set.rs:14:10
+     |
+14   |         .execute(&mut conn);
+     |          ^^^^^^^ the trait `QueryFragment<_>` is not implemented for `diesel::query_builder::update_statement::SetNotCalled`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <&'a T as QueryFragment<DB>>
+               <() as QueryFragment<DB>>
+               <(T0, T1) as QueryFragment<__DB>>
+               <(T0, T1, T2) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4, T5) as QueryFragment<__DB>>
+               <(T0, T1, T2, T3, T4, T5, T6) as QueryFragment<__DB>>
+             and 271 others
+     = note: required because of the requirements on the impl of `QueryFragment<_>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause>`
+     = note: required because of the requirements on the impl of `ExecuteDsl<_, _>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause>`
+note: required by a bound in `diesel::RunQueryDsl::execute`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: methods::ExecuteDsl<Conn>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::execute`
diff --git a/diesel_compile_tests/tests/fail/update_requires_valid_where_clause.stderr b/diesel_compile_tests/tests/fail/update_requires_valid_where_clause.stderr
index 8110c25f6fd2..44c0ef6d50bd 100644
--- a/diesel_compile_tests/tests/fail/update_requires_valid_where_clause.stderr
+++ b/diesel_compile_tests/tests/fail/update_requires_valid_where_clause.stderr
@@ -1,11 +1,12 @@
-error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>: IntoUpdateTarget` is not satisfied
+error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>: IntoUpdateTarget` is not satisfied
   --> tests/fail/update_requires_valid_where_clause.rs:21:12
    |
 21 |     update(users::table.filter(posts::id.eq(1)));
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoUpdateTarget` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
+   |     ------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoUpdateTarget` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
+   |     |
+   |     required by a bound introduced by this call
    |
-   = help: the following implementations were found:
-             <SelectStatement<FromClause<F>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<F>>, diesel::query_builder::distinct_clause::NoDistinctClause, W> as IntoUpdateTarget>
+   = help: the trait `IntoUpdateTarget` is implemented for `SelectStatement<FromClause<F>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<F>>, diesel::query_builder::distinct_clause::NoDistinctClause, W>`
 note: required by a bound in `diesel::update`
   --> $DIESEL/src/query_builder/functions.rs
    |
@@ -28,9 +29,9 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 15 | | }
    | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
   --> tests/fail/update_requires_valid_where_clause.rs:23:26
@@ -38,6 +39,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
 23 |     update(users::table).filter(posts::id.eq(1));
    |                          ^^^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
   --> tests/fail/update_requires_valid_where_clause.rs:11:1
@@ -49,9 +57,9 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 15 | | }
    | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
   --> tests/fail/update_requires_valid_where_clause.rs:26:10
@@ -69,9 +77,9 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 15 | | }
    | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::id>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::id>, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
   --> tests/fail/update_requires_valid_where_clause.rs:26:10
@@ -79,6 +87,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
 26 |         .filter(posts::id.eq(1));
    |          ^^^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
    |
+   = help: the following other types implement trait `TableNotEqual<T>`:
+             <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+             <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+             <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
    = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::id`
   --> tests/fail/update_requires_valid_where_clause.rs:11:1
@@ -90,15 +105,14 @@ note: required because of the requirements on the impl of `AppearsOnTable<users:
 15 | | }
    | |_^
    = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::id>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+   = note: required because of the requirements on the impl of `FilterDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<users::columns::id>, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>`
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>: IntoUpdateTarget` is not satisfied
+error[E0277]: the trait bound `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>: IntoUpdateTarget` is not satisfied
   --> tests/fail/update_requires_valid_where_clause.rs:21:5
    |
 21 |     update(users::table.filter(posts::id.eq(1)));
-   |     ^^^^^^ the trait `IntoUpdateTarget` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>>`
+   |     ^^^^^^ the trait `IntoUpdateTarget` is not implemented for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>>`
    |
-   = help: the following implementations were found:
-             <SelectStatement<FromClause<F>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<F>>, diesel::query_builder::distinct_clause::NoDistinctClause, W> as IntoUpdateTarget>
+   = help: the trait `IntoUpdateTarget` is implemented for `SelectStatement<FromClause<F>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<F>>, diesel::query_builder::distinct_clause::NoDistinctClause, W>`
diff --git a/diesel_compile_tests/tests/fail/update_statement_does_not_support_returning_methods_on_sqlite.stderr b/diesel_compile_tests/tests/fail/update_statement_does_not_support_returning_methods_on_sqlite.stderr
index 064735246522..1f2a3cc6c7f6 100644
--- a/diesel_compile_tests/tests/fail/update_statement_does_not_support_returning_methods_on_sqlite.stderr
+++ b/diesel_compile_tests/tests/fail/update_statement_does_not_support_returning_methods_on_sqlite.stderr
@@ -1,29 +1,39 @@
 error[E0277]: the trait bound `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>: QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not satisfied
-  --> tests/fail/update_statement_does_not_support_returning_methods_on_sqlite.rs:18:10
-   |
-18 |         .get_result(&mut connection);
-   |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>>`
+    --> tests/fail/update_statement_does_not_support_returning_methods_on_sqlite.rs:18:10
+     |
+18   |         .get_result(&mut connection);
+     |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<(columns::id, columns::name)>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
 
 error[E0277]: the trait bound `diesel::query_builder::returning_clause::ReturningClause<columns::name>: QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not satisfied
-  --> tests/fail/update_statement_does_not_support_returning_methods_on_sqlite.rs:23:10
-   |
-23 |         .get_result(&mut connection);
-   |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
-             <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
+    --> tests/fail/update_statement_does_not_support_returning_methods_on_sqlite.rs:23:10
+     |
+23   |         .get_result(&mut connection);
+     |          ^^^^^^^^^^ the trait `QueryFragment<Sqlite, backend::sql_dialect::returning_clause::DoesNotSupportReturningClause>` is not implemented for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, backend::sql_dialect::returning_clause::PgLikeReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB, sqlite::backend::SqliteReturningClause>>
+               <diesel::query_builder::returning_clause::ReturningClause<Expr> as QueryFragment<DB>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::returning_clause::ReturningClause<columns::name>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, diesel::SqliteConnection, _>` for `UpdateStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>, diesel::query_builder::update_statement::changeset::Assign<diesel::query_builder::update_statement::changeset::ColumnWrapperForUpdate<columns::name>, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>, diesel::query_builder::returning_clause::ReturningClause<columns::name>>`
+note: required by a bound in `get_result`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `get_result`
diff --git a/diesel_compile_tests/tests/fail/upsert_with_multiple_values_not_supported_on_sqlite.stderr b/diesel_compile_tests/tests/fail/upsert_with_multiple_values_not_supported_on_sqlite.stderr
index d2a4fd7f0d4f..7b676737d14e 100644
--- a/diesel_compile_tests/tests/fail/upsert_with_multiple_values_not_supported_on_sqlite.stderr
+++ b/diesel_compile_tests/tests/fail/upsert_with_multiple_values_not_supported_on_sqlite.stderr
@@ -1,25 +1,35 @@
-error[E0277]: the trait bound `diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>: QueryFragment<Sqlite, sqlite::backend::SqliteBatchInsert>` is not satisfied
-  --> tests/fail/upsert_with_multiple_values_not_supported_on_sqlite.rs:17:10
-   |
-17 |         .execute(&mut connection);
-   |          ^^^^^^^ the trait `QueryFragment<Sqlite, sqlite::backend::SqliteBatchInsert>` is not implemented for `diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>`
-   |
-   = help: the following implementations were found:
-             <diesel::query_builder::insert_statement::batch_insert::BatchInsert<V, Tab, QId, HAS_STATIC_QUERY_ID> as QueryFragment<DB>>
-             <diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<V, Tab>>, Tab, QId, HAS_STATIC_QUERY_ID> as QueryFragment<DB, backend::sql_dialect::batch_insert_support::PostgresLikeBatchInsertSupport>>
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>`
-   = note: 2 redundant requirements hidden
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `InsertStatement<users::table, diesel::query_builder::upsert::on_conflict_clause::OnConflictValues<diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>, diesel::query_builder::upsert::on_conflict_target::NoConflictTarget, diesel::query_builder::upsert::on_conflict_actions::DoNothing>>`
-   = note: required because of the requirements on the impl of `ExecuteDsl<diesel::SqliteConnection, Sqlite>` for `InsertStatement<users::table, diesel::query_builder::upsert::on_conflict_clause::OnConflictValues<diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>, diesel::query_builder::upsert::on_conflict_target::NoConflictTarget, diesel::query_builder::upsert::on_conflict_actions::DoNothing>>`
+error[E0277]: the trait bound `diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>: QueryFragment<Sqlite, sqlite::backend::SqliteBatchInsert>` is not satisfied
+    --> tests/fail/upsert_with_multiple_values_not_supported_on_sqlite.rs:17:10
+     |
+17   |         .execute(&mut connection);
+     |          ^^^^^^^ the trait `QueryFragment<Sqlite, sqlite::backend::SqliteBatchInsert>` is not implemented for `diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>`
+     |
+     = help: the following other types implement trait `QueryFragment<DB, SP>`:
+               <diesel::query_builder::insert_statement::batch_insert::BatchInsert<V, Tab, QId, HAS_STATIC_QUERY_ID> as QueryFragment<DB>>
+               <diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<V, Tab>>, Tab, QId, HAS_STATIC_QUERY_ID> as QueryFragment<DB, backend::sql_dialect::batch_insert_support::PostgresLikeBatchInsertSupport>>
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>`
+     = note: 2 redundant requirements hidden
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `InsertStatement<users::table, diesel::query_builder::upsert::on_conflict_clause::OnConflictValues<diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>, diesel::query_builder::upsert::on_conflict_target::NoConflictTarget, diesel::query_builder::upsert::on_conflict_actions::DoNothing>>`
+     = note: required because of the requirements on the impl of `ExecuteDsl<diesel::SqliteConnection, Sqlite>` for `InsertStatement<users::table, diesel::query_builder::upsert::on_conflict_clause::OnConflictValues<diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>, diesel::query_builder::upsert::on_conflict_target::NoConflictTarget, diesel::query_builder::upsert::on_conflict_actions::DoNothing>>`
+note: required by a bound in `diesel::RunQueryDsl::execute`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: methods::ExecuteDsl<Conn>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::execute`
 
 error[E0271]: type mismatch resolving `<Sqlite as SqlDialect>::InsertWithDefaultKeyword == backend::sql_dialect::default_keyword_for_insert::IsoSqlDefaultKeyword`
-  --> tests/fail/upsert_with_multiple_values_not_supported_on_sqlite.rs:17:10
-   |
-17 |         .execute(&mut connection);
-   |          ^^^^^^^ expected struct `backend::sql_dialect::default_keyword_for_insert::DoesNotSupportDefaultKeyword`, found struct `backend::sql_dialect::default_keyword_for_insert::IsoSqlDefaultKeyword`
-   |
-   = note: required because of the requirements on the impl of `CanInsertInSingleQuery<Sqlite>` for `diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>`
-   = note: 1 redundant requirements hidden
-   = note: required because of the requirements on the impl of `CanInsertInSingleQuery<Sqlite>` for `diesel::query_builder::upsert::on_conflict_clause::OnConflictValues<diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>, diesel::query_builder::upsert::on_conflict_target::NoConflictTarget, diesel::query_builder::upsert::on_conflict_actions::DoNothing>`
-   = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `InsertStatement<users::table, diesel::query_builder::upsert::on_conflict_clause::OnConflictValues<diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>, diesel::query_builder::upsert::on_conflict_target::NoConflictTarget, diesel::query_builder::upsert::on_conflict_actions::DoNothing>>`
-   = note: required because of the requirements on the impl of `ExecuteDsl<diesel::SqliteConnection, Sqlite>` for `InsertStatement<users::table, diesel::query_builder::upsert::on_conflict_clause::OnConflictValues<diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>, diesel::query_builder::upsert::on_conflict_target::NoConflictTarget, diesel::query_builder::upsert::on_conflict_actions::DoNothing>>`
+    --> tests/fail/upsert_with_multiple_values_not_supported_on_sqlite.rs:17:10
+     |
+17   |         .execute(&mut connection);
+     |          ^^^^^^^ expected struct `backend::sql_dialect::default_keyword_for_insert::IsoSqlDefaultKeyword`, found struct `backend::sql_dialect::default_keyword_for_insert::DoesNotSupportDefaultKeyword`
+     |
+     = note: required because of the requirements on the impl of `CanInsertInSingleQuery<Sqlite>` for `diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>`
+     = note: 1 redundant requirement hidden
+     = note: required because of the requirements on the impl of `CanInsertInSingleQuery<Sqlite>` for `diesel::query_builder::upsert::on_conflict_clause::OnConflictValues<diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>, diesel::query_builder::upsert::on_conflict_target::NoConflictTarget, diesel::query_builder::upsert::on_conflict_actions::DoNothing>`
+     = note: required because of the requirements on the impl of `QueryFragment<Sqlite>` for `InsertStatement<users::table, diesel::query_builder::upsert::on_conflict_clause::OnConflictValues<diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>, diesel::query_builder::upsert::on_conflict_target::NoConflictTarget, diesel::query_builder::upsert::on_conflict_actions::DoNothing>>`
+     = note: required because of the requirements on the impl of `ExecuteDsl<diesel::SqliteConnection, Sqlite>` for `InsertStatement<users::table, diesel::query_builder::upsert::on_conflict_clause::OnConflictValues<diesel::query_builder::insert_statement::batch_insert::BatchInsert<Vec<diesel::query_builder::insert_statement::ValuesClause<ColumnInsertValue<columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, users::table>>, users::table, (), false>, diesel::query_builder::upsert::on_conflict_target::NoConflictTarget, diesel::query_builder::upsert::on_conflict_actions::DoNothing>>`
+note: required by a bound in `diesel::RunQueryDsl::execute`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: methods::ExecuteDsl<Conn>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::execute`
diff --git a/diesel_compile_tests/tests/fail/user_defined_functions_follow_same_selection_rules.stderr b/diesel_compile_tests/tests/fail/user_defined_functions_follow_same_selection_rules.stderr
index 188ac616c7c7..f5e708a49697 100644
--- a/diesel_compile_tests/tests/fail/user_defined_functions_follow_same_selection_rules.stderr
+++ b/diesel_compile_tests/tests/fail/user_defined_functions_follow_same_selection_rules.stderr
@@ -1,54 +1,73 @@
-error[E0271]: type mismatch resolving `<foo::foo<diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>> as diesel::Expression>::SqlType == diesel::sql_types::Text`
-  --> tests/fail/user_defined_functions_follow_same_selection_rules.rs:35:38
+error[E0271]: type mismatch resolving `<foo::foo<diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>> as diesel::Expression>::SqlType == diesel::sql_types::Text`
+  --> tests/fail/user_defined_functions_follow_same_selection_rules.rs:35:41
    |
 35 |     let _ = users::table.filter(name.eq(foo(1)));
-   |                                      ^^ expected struct `diesel::sql_types::Integer`, found struct `diesel::sql_types::Text`
+   |                                      -- ^^^^^^ expected struct `diesel::sql_types::Integer`, found struct `diesel::sql_types::Text`
+   |                                      |
+   |                                      required by a bound introduced by this call
    |
-   = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Text>` for `foo::foo<diesel::internal::derives::as_expression::Bound<diesel::sql_types::Integer, i32>>`
+   = note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Text>` for `foo::foo<diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>`
 
 error[E0271]: type mismatch resolving `<users::table as AppearsInFromClause<posts::table>>::Count == diesel::query_source::Once`
-  --> tests/fail/user_defined_functions_follow_same_selection_rules.rs:38:10
-   |
-38 |         .load::<User>(&mut conn);
-   |          ^^^^ expected struct `diesel::query_source::Never`, found struct `diesel::query_source::Once`
-   |
+    --> tests/fail/user_defined_functions_follow_same_selection_rules.rs:38:10
+     |
+38   |         .load::<User>(&mut conn);
+     |          ^^^^ expected struct `diesel::query_source::Once`, found struct `diesel::query_source::Never`
+     |
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::title`
-  --> tests/fail/user_defined_functions_follow_same_selection_rules.rs:13:1
-   |
-13 | / table! {
-14 | |     posts {
-15 | |         id -> Integer,
-16 | |         title -> VarChar,
-17 | |     }
-18 | | }
-   | |_^
-   = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>`
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, User>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+    --> tests/fail/user_defined_functions_follow_same_selection_rules.rs:13:1
+     |
+13   | / table! {
+14   | |     posts {
+15   | |         id -> Integer,
+16   | |         title -> VarChar,
+17   | |     }
+18   | | }
+     | |_^
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, User>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not satisfied
-  --> tests/fail/user_defined_functions_follow_same_selection_rules.rs:38:10
-   |
-38 |         .load::<User>(&mut conn);
-   |          ^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
-   |
-   = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
+    --> tests/fail/user_defined_functions_follow_same_selection_rules.rs:38:10
+     |
+38   |         .load::<User>(&mut conn);
+     |          ^^^^ the trait `TableNotEqual<posts::table>` is not implemented for `users::table`
+     |
+     = help: the following other types implement trait `TableNotEqual<T>`:
+               <Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+               <Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+               <pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
+               <pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
+               <pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
+               <pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
+     = note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `users::table`
 note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `posts::columns::title`
-  --> tests/fail/user_defined_functions_follow_same_selection_rules.rs:13:1
-   |
-13 | / table! {
-14 | |     posts {
-15 | |         id -> Integer,
-16 | |         title -> VarChar,
-17 | |     }
-18 | | }
-   | |_^
-   = note: 3 redundant requirements hidden
-   = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>`
-   = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, User>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>>`
-   = note: this error originates in the macro `$crate::__diesel_column` (in Nightly builds, run with -Z macro-backtrace for more info)
+    --> tests/fail/user_defined_functions_follow_same_selection_rules.rs:13:1
+     |
+13   | / table! {
+14   | |     posts {
+15   | |         id -> Integer,
+16   | |         title -> VarChar,
+17   | |     }
+18   | | }
+     | |_^
+     = note: 3 redundant requirements hidden
+     = note: required because of the requirements on the impl of `AppearsOnTable<users::table>` for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>`
+     = note: required because of the requirements on the impl of `diesel::query_builder::where_clause::ValidWhereClause<FromClause<users::table>>` for `diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, User>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<users::columns::name, bar::bar<posts::columns::title>>>>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
+     = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/diesel_compile_tests/tests/fail/valid_grouping_and_boxed_expressions.stderr b/diesel_compile_tests/tests/fail/valid_grouping_and_boxed_expressions.stderr
index ab375cb2a9f7..528b22a9b0ac 100644
--- a/diesel_compile_tests/tests/fail/valid_grouping_and_boxed_expressions.stderr
+++ b/diesel_compile_tests/tests/fail/valid_grouping_and_boxed_expressions.stderr
@@ -7,27 +7,30 @@ warning: unused import: `MixedAggregates`
   = note: `#[warn(unused_imports)]` on by default
 
 error[E0277]: the trait bound `dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>: ValidGrouping<columns::id>` is not satisfied
-  --> tests/fail/valid_grouping_and_boxed_expressions.rs:71:17
+  --> tests/fail/valid_grouping_and_boxed_expressions.rs:71:10
    |
 71 |         .select(some_ungrouped_expression(true))
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `ValidGrouping<columns::id>` is not implemented for `dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>`
+   |          ^^^^^^ the trait `ValidGrouping<columns::id>` is not implemented for `dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>`
    |
-   = help: the following implementations were found:
-             <(dyn diesel::BoxableExpression<QS, DB, GB, IsAggregate, SqlType = ST> + 'a) as ValidGrouping<GB>>
+   = help: the trait `ValidGrouping<GB>` is implemented for `(dyn diesel::BoxableExpression<QS, DB, GB, IsAggregate, SqlType = ST> + 'a)`
    = note: required because of the requirements on the impl of `ValidGrouping<columns::id>` for `Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>`
    = note: required because of the requirements on the impl of `SelectDsl<Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>>`
 
 error[E0277]: the trait bound `dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>: ValidGrouping<columns::id>` is not satisfied
-  --> tests/fail/valid_grouping_and_boxed_expressions.rs:72:10
-   |
-72 |         .load::<i32>(&mut conn);
-   |          ^^^^ the trait `ValidGrouping<columns::id>` is not implemented for `dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>`
-   |
-   = help: the following implementations were found:
-             <(dyn diesel::BoxableExpression<QS, DB, GB, IsAggregate, SqlType = ST> + 'a) as ValidGrouping<GB>>
-   = note: required because of the requirements on the impl of `ValidGrouping<columns::id>` for `Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>`
-   = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>>`
-   = note: required because of the requirements on the impl of `LoadQuery<'_, _, i32>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>>`
+    --> tests/fail/valid_grouping_and_boxed_expressions.rs:72:10
+     |
+72   |         .load::<i32>(&mut conn);
+     |          ^^^^ the trait `ValidGrouping<columns::id>` is not implemented for `dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>`
+     |
+     = help: the trait `ValidGrouping<GB>` is implemented for `(dyn diesel::BoxableExpression<QS, DB, GB, IsAggregate, SqlType = ST> + 'a)`
+     = note: required because of the requirements on the impl of `ValidGrouping<columns::id>` for `Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, i32>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::NoWhereClause, diesel::query_builder::order_clause::NoOrderClause, diesel::query_builder::limit_offset_clause::LimitOffsetClause<diesel::query_builder::limit_clause::NoLimitClause, diesel::query_builder::offset_clause::NoOffsetClause>, diesel::query_builder::group_by_clause::GroupByClause<columns::id>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
 
 error[E0271]: type mismatch resolving `<columns::name as IsContainedInGroupBy<columns::id>>::Output == diesel::expression::is_contained_in_group_by::Yes`
   --> tests/fail/valid_grouping_and_boxed_expressions.rs:88:17
@@ -35,33 +38,44 @@ error[E0271]: type mismatch resolving `<columns::name as IsContainedInGroupBy<co
 88 |         .select(maybe_grouped(true))
    |                 ^^^^^^^^^^^^^ expected struct `diesel::expression::is_contained_in_group_by::No`, found struct `diesel::expression::is_contained_in_group_by::Yes`
    |
-   = note: required because of the requirements on the impl of `ValidGrouping<columns::name>` for `columns::id`
+note: required because of the requirements on the impl of `ValidGrouping<columns::name>` for `columns::id`
+  --> tests/fail/valid_grouping_and_boxed_expressions.rs:8:1
+   |
+8  | / table! {
+9  | |     users {
+10 | |         id -> Integer,
+11 | |         name -> Text,
+12 | |     }
+13 | | }
+   | |_^
+   = note: this error originates in the macro `$crate::__diesel_column` which comes from the expansion of the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `diesel::expression::is_aggregate::Yes: MixedAggregates<diesel::expression::is_aggregate::No>` is not satisfied
-   --> tests/fail/valid_grouping_and_boxed_expressions.rs:104:17
+   --> tests/fail/valid_grouping_and_boxed_expressions.rs:104:10
     |
-104 |           .select((
-    |  _________________^
-105 | |             something_that_is_aggregate(),
-106 | |             some_ungrouped_expression(false),
-107 | |         ))
-    | |_________^ the trait `MixedAggregates<diesel::expression::is_aggregate::No>` is not implemented for `diesel::expression::is_aggregate::Yes`
+104 |         .select((
+    |          ^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::No>` is not implemented for `diesel::expression::is_aggregate::Yes`
     |
-    = help: the following implementations were found:
+    = help: the following other types implement trait `MixedAggregates<Other>`:
               <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Never>>
               <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Yes>>
     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(Box<dyn diesel::BoxableExpression<users::table, Pg, (), diesel::expression::is_aggregate::Yes, SqlType = Nullable<diesel::sql_types::Integer>>>, Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>)`
     = note: required because of the requirements on the impl of `SelectDsl<(Box<dyn diesel::BoxableExpression<users::table, Pg, (), diesel::expression::is_aggregate::Yes, SqlType = Nullable<diesel::sql_types::Integer>>>, Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>)>` for `SelectStatement<FromClause<users::table>>`
 
 error[E0277]: the trait bound `diesel::expression::is_aggregate::Yes: MixedAggregates<diesel::expression::is_aggregate::No>` is not satisfied
-   --> tests/fail/valid_grouping_and_boxed_expressions.rs:108:10
-    |
-108 |         .load::<(Option<i32>, i32)>(&mut conn);
-    |          ^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::No>` is not implemented for `diesel::expression::is_aggregate::Yes`
-    |
-    = help: the following implementations were found:
-              <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Never>>
-              <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Yes>>
-    = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(Box<dyn diesel::BoxableExpression<users::table, Pg, (), diesel::expression::is_aggregate::Yes, SqlType = Nullable<diesel::sql_types::Integer>>>, Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>)`
-    = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<(Box<dyn diesel::BoxableExpression<users::table, Pg, (), diesel::expression::is_aggregate::Yes, SqlType = Nullable<diesel::sql_types::Integer>>>, Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>)>>`
-    = note: required because of the requirements on the impl of `LoadQuery<'_, _, (Option<i32>, i32)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<(Box<dyn diesel::BoxableExpression<users::table, Pg, (), diesel::expression::is_aggregate::Yes, SqlType = Nullable<diesel::sql_types::Integer>>>, Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>)>>`
+    --> tests/fail/valid_grouping_and_boxed_expressions.rs:108:10
+     |
+108  |         .load::<(Option<i32>, i32)>(&mut conn);
+     |          ^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::No>` is not implemented for `diesel::expression::is_aggregate::Yes`
+     |
+     = help: the following other types implement trait `MixedAggregates<Other>`:
+               <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Never>>
+               <diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Yes>>
+     = note: required because of the requirements on the impl of `ValidGrouping<()>` for `(Box<dyn diesel::BoxableExpression<users::table, Pg, (), diesel::expression::is_aggregate::Yes, SqlType = Nullable<diesel::sql_types::Integer>>>, Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>)`
+     = note: required because of the requirements on the impl of `Query` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<(Box<dyn diesel::BoxableExpression<users::table, Pg, (), diesel::expression::is_aggregate::Yes, SqlType = Nullable<diesel::sql_types::Integer>>>, Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>)>>`
+     = note: required because of the requirements on the impl of `LoadQuery<'_, _, (Option<i32>, i32)>` for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::SelectClause<(Box<dyn diesel::BoxableExpression<users::table, Pg, (), diesel::expression::is_aggregate::Yes, SqlType = Nullable<diesel::sql_types::Integer>>>, Box<dyn diesel::BoxableExpression<users::table, Pg, SqlType = diesel::sql_types::Integer>>)>>`
+note: required by a bound in `diesel::RunQueryDsl::load`
+    --> $DIESEL/src/query_dsl/mod.rs
+     |
+     |         Self: LoadQuery<'query, Conn, U>,
+     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`
diff --git a/diesel_derives/tests/associations.rs b/diesel_derives/tests/associations.rs
index ea043826b2ba..b0f7e2583fff 100644
--- a/diesel_derives/tests/associations.rs
+++ b/diesel_derives/tests/associations.rs
@@ -294,7 +294,7 @@ fn foreign_key_field_with_column_rename() {
         id: i32,
     }
 
-    #[derive(Associations, Identifiable, Clone, Copy, PartialEq, Debug)]
+    #[derive(Associations, Identifiable, Clone, Copy, PartialEq, Debug, Eq)]
     #[diesel(belongs_to(User))]
     pub struct Post {
         id: i32,
diff --git a/diesel_derives/tests/selectable.rs b/diesel_derives/tests/selectable.rs
index 76272cdcbf94..d69c9950668f 100644
--- a/diesel_derives/tests/selectable.rs
+++ b/diesel_derives/tests/selectable.rs
@@ -114,3 +114,34 @@ fn embedded_option_with_nullable_field() {
     let data = my_structs::table.select(A::as_select()).get_result(conn);
     assert!(data.is_err());
 }
+
+#[test]
+fn manually_specified_expression() {
+    table! {
+        my_structs (foo) {
+            foo -> Integer,
+            bar -> Nullable<Text>,
+            some_int -> Nullable<Integer>,
+        }
+    }
+
+    #[derive(Debug, Clone, Copy, PartialEq, Eq, Queryable, Selectable)]
+    #[diesel(table_name = my_structs)]
+    struct A {
+        foo: i32,
+        #[diesel(
+            select_expression = (my_structs::bar.is_not_null(), my_structs::some_int),
+            select_expression_type = (dsl::IsNotNull<my_structs::bar>, my_structs::some_int),
+        )]
+        bar_is_set_and_some_int: (bool, Option<i32>),
+        #[diesel(
+            select_expression = my_structs::bar.is_not_null(),
+            select_expression_type = dsl::IsNotNull<my_structs::bar>,
+        )]
+        bar_is_set: bool,
+    }
+
+    let conn = &mut connection();
+    let data = my_structs::table.select(A::as_select()).get_result(conn);
+    assert!(data.is_err());
+}
diff --git a/diesel_tests/Cargo.toml b/diesel_tests/Cargo.toml
index c9206f559ebc..4cd1ec98ee1d 100644
--- a/diesel_tests/Cargo.toml
+++ b/diesel_tests/Cargo.toml
@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
 autotests = false
 autobenches = false
 edition = "2018"
+publish = false
 
 [dependencies]
 assert_matches = "1.0.1"
diff --git a/diesel_tests/tests/associations.rs b/diesel_tests/tests/associations.rs
index fa204ce0ec8d..cf7f2265c970 100644
--- a/diesel_tests/tests/associations.rs
+++ b/diesel_tests/tests/associations.rs
@@ -65,12 +65,12 @@ mod eager_loading_with_string_keys {
     table! { posts { id -> Text, user_id -> Text, } }
     allow_tables_to_appear_in_same_query!(users, posts);
 
-    #[derive(Queryable, Identifiable, Debug, PartialEq, Clone)]
+    #[derive(Queryable, Identifiable, Debug, PartialEq, Clone, Eq)]
     pub struct User {
         id: String,
     }
 
-    #[derive(Queryable, Identifiable, Debug, PartialEq, Clone, Associations)]
+    #[derive(Queryable, Identifiable, Debug, PartialEq, Clone, Associations, Eq)]
     #[diesel(belongs_to(User))]
     pub struct Post {
         id: String,
@@ -300,14 +300,14 @@ fn custom_foreign_key() {
 
     allow_tables_to_appear_in_same_query!(users1, posts1);
 
-    #[derive(Clone, Debug, PartialEq, Identifiable, Queryable)]
+    #[derive(Clone, Debug, PartialEq, Identifiable, Queryable, Eq)]
     #[diesel(table_name = users1)]
     pub struct User {
         id: i32,
         name: String,
     }
 
-    #[derive(Clone, Debug, PartialEq, Associations, Identifiable, Queryable)]
+    #[derive(Clone, Debug, PartialEq, Associations, Identifiable, Queryable, Eq)]
     #[diesel(belongs_to(User, foreign_key = belongs_to_user))]
     #[diesel(table_name = posts1)]
     pub struct Post {
diff --git a/diesel_tests/tests/custom_types.rs b/diesel_tests/tests/custom_types.rs
index 314ce8551b73..0b782229e92e 100644
--- a/diesel_tests/tests/custom_types.rs
+++ b/diesel_tests/tests/custom_types.rs
@@ -19,7 +19,7 @@ table! {
 #[diesel(postgres_type(name = "My_Type"))]
 pub struct MyType;
 
-#[derive(Debug, PartialEq, FromSqlRow, AsExpression)]
+#[derive(Debug, PartialEq, FromSqlRow, AsExpression, Eq)]
 #[diesel(sql_type = MyType)]
 pub enum MyEnum {
     Foo,
@@ -98,7 +98,7 @@ table! {
 #[diesel(postgres_type(name = "My_Type", schema = "custom_schema"))]
 pub struct MyTypeInCustomSchema;
 
-#[derive(Debug, PartialEq, FromSqlRow, AsExpression)]
+#[derive(Debug, PartialEq, FromSqlRow, AsExpression, Eq)]
 #[diesel(sql_type = MyTypeInCustomSchema)]
 pub enum MyEnumInCustomSchema {
     Foo,
diff --git a/diesel_tests/tests/errors.rs b/diesel_tests/tests/errors.rs
index 4a683e34fc54..2a13d9b0e432 100644
--- a/diesel_tests/tests/errors.rs
+++ b/diesel_tests/tests/errors.rs
@@ -188,12 +188,11 @@ fn isolation_errors_are_detected() {
 #[test]
 #[cfg(not(feature = "sqlite"))]
 fn read_only_errors_are_detected() {
+    use diesel::connection::SimpleConnection;
     use diesel::result::DatabaseErrorKind::ReadOnlyTransaction;
 
     let conn = &mut connection_without_transaction();
-    diesel::sql_query("START TRANSACTION READ ONLY")
-        .execute(conn)
-        .unwrap();
+    conn.batch_execute("START TRANSACTION READ ONLY").unwrap();
 
     let result = users::table.for_update().load::<User>(conn);
 
diff --git a/diesel_tests/tests/group_by.rs b/diesel_tests/tests/group_by.rs
index d4506f700299..c261c26691ba 100644
--- a/diesel_tests/tests/group_by.rs
+++ b/diesel_tests/tests/group_by.rs
@@ -94,7 +94,10 @@ fn check_group_by_primary_key_allows_other_columns_in_select_clause() {
         expected_sql = expected_sql.replace('`', "\"");
     }
 
-    assert_eq!(expected_sql, debug_query(&source).to_string());
+    assert_eq!(
+        expected_sql,
+        debug_query::<TestBackend, _>(&source).to_string()
+    );
 
     let conn = &mut connection();
 
@@ -118,7 +121,10 @@ fn check_group_by_multiple_columns_in_group_by_clause_single_select() {
         expected_sql = expected_sql.replace('`', "\"");
     }
 
-    assert_eq!(expected_sql, debug_query(&source).to_string());
+    assert_eq!(
+        expected_sql,
+        debug_query::<TestBackend, _>(&source).to_string()
+    );
 
     let conn = &mut connection();
 
@@ -142,7 +148,10 @@ fn check_group_by_multiple_columns_in_group_by_clause_complex_select() {
         expected_sql = expected_sql.replace('`', "\"");
     }
 
-    assert_eq!(expected_sql, debug_query(&source).to_string());
+    assert_eq!(
+        expected_sql,
+        debug_query::<TestBackend, _>(&source).to_string()
+    );
 
     let conn = &mut connection();
 
@@ -178,7 +187,10 @@ fn check_group_by_multiple_tables() {
         expected_sql = expected_sql.replace('`', "\"");
     }
 
-    assert_eq!(expected_sql, debug_query(&source).to_string());
+    assert_eq!(
+        expected_sql,
+        debug_query::<TestBackend, _>(&source).to_string()
+    );
 
     let conn = &mut connection();
 
@@ -218,7 +230,10 @@ fn check_filter_with_group_by_subselect() {
             .to_string()
     };
 
-    assert_eq!(expected_sql, debug_query(&source).to_string());
+    assert_eq!(
+        expected_sql,
+        debug_query::<TestBackend, _>(&source).to_string()
+    );
 
     let conn = &mut connection();
 
@@ -260,7 +275,10 @@ fn check_filter_with_boxed_group_by_subselect() {
             .to_string()
     };
 
-    assert_eq!(expected_sql, debug_query(&source).to_string());
+    assert_eq!(
+        expected_sql,
+        debug_query::<TestBackend, _>(&source).to_string()
+    );
 
     let conn = &mut connection();
 
diff --git a/diesel_tests/tests/types_roundtrip.rs b/diesel_tests/tests/types_roundtrip.rs
index ca2c237609f2..cf700fa5cb87 100644
--- a/diesel_tests/tests/types_roundtrip.rs
+++ b/diesel_tests/tests/types_roundtrip.rs
@@ -625,10 +625,8 @@ fn mk_bigdecimal(data: (i64, u64)) -> bigdecimal::BigDecimal {
 
 #[cfg(feature = "postgres")]
 pub fn mk_naive_date(days: u32) -> NaiveDate {
-    use chrono::naive::MAX_DATE;
-
     let earliest_pg_date = NaiveDate::from_ymd(-4713, 11, 24);
-    let latest_chrono_date = MAX_DATE;
+    let latest_chrono_date = NaiveDate::MAX;
     let num_days_representable = latest_chrono_date
         .signed_duration_since(earliest_pg_date)
         .num_days();
@@ -647,10 +645,8 @@ pub fn mk_naive_date(days: u32) -> NaiveDate {
 
 #[cfg(feature = "sqlite")]
 pub fn mk_naive_date(days: u32) -> NaiveDate {
-    use chrono::naive::{MAX_DATE, MIN_DATE};
-
-    let earliest_sqlite_date = MIN_DATE;
-    let latest_sqlite_date = MAX_DATE;
+    let earliest_sqlite_date = NaiveDate::MIN;
+    let latest_sqlite_date = NaiveDate::MAX;
     let num_days_representable = latest_sqlite_date
         .signed_duration_since(earliest_sqlite_date)
         .num_days();
diff --git a/examples/mysql/test_all b/examples/mysql/test_all
index 77b23a8aa043..98f743108206 100755
--- a/examples/mysql/test_all
+++ b/examples/mysql/test_all
@@ -1,23 +1,23 @@
 #!/bin/sh
 set -e
 
-SCRIPTPATH=`dirname $0`
+SCRIPTPATH=$(dirname "$0")
 
-cd $SCRIPTPATH
+cd "$SCRIPTPATH"
 
 set -a
 if [ -f ../../.env ]; then . ../../.env; fi
-DATABASE_URL=${MYSQL_EXAMPLE_DATABASE_URL}
+export DATABASE_URL="${MYSQL_EXAMPLE_DATABASE_URL}"
 if [ -z "$BACKEND" ]; then
     export BACKEND="mysql"
 fi
 set +a
 
 if [ -z "${BACKEND##*mysql*}" ]; then
-  for dir in $(find . -maxdepth 1 -mindepth 1 -type d); do
-    cd $dir
-    ../../../bin/diesel database reset
-    cargo build
-    cd ..
-  done
+    find . -maxdepth 1 -mindepth 1 -type d | while read -r dir; do
+        cd "$dir"
+        ../../../bin/diesel database reset
+        cargo build
+        cd ..
+    done
 fi
diff --git a/examples/postgres/test_all b/examples/postgres/test_all
index 782aad45f8bc..4c3ba49249f4 100755
--- a/examples/postgres/test_all
+++ b/examples/postgres/test_all
@@ -1,27 +1,27 @@
 #!/bin/sh
 set -e
 
-SCRIPTPATH=`dirname $0`
+SCRIPTPATH=$(dirname "$0")
 
-cd $SCRIPTPATH
+cd "$SCRIPTPATH"
 
 set -a
 if [ -f ../../.env ]; then . ../../.env; fi
-DATABASE_URL=${PG_EXAMPLE_DATABASE_URL}
+export DATABASE_URL="${PG_EXAMPLE_DATABASE_URL}"
 if [ -z "$BACKEND" ]; then
     export BACKEND="postgres"
 fi
 set +a
 
 if [ -z "${BACKEND##*postgres*}" ]; then
-  for dir in $(find . -maxdepth 1 -mindepth 1 -type d); do
-    cd $dir
-  
-    if [ -d "migrations" ]; then
-      ../../../bin/diesel database reset
-    fi
+    find . -maxdepth 1 -mindepth 1 -type d | while read -r dir; do
+        cd "$dir"
 
-    cargo test
-    cd ..
-  done
+        if [ -d "migrations" ]; then
+            ../../../bin/diesel database reset
+        fi
+
+        cargo test
+        cd ..
+    done
 fi
diff --git a/examples/sqlite/test_all b/examples/sqlite/test_all
index b1964a0ead8a..236135e79e59 100755
--- a/examples/sqlite/test_all
+++ b/examples/sqlite/test_all
@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-SCRIPTPATH=`dirname $0`
+SCRIPTPATH=$(dirname "$0")
 
 export DATABASE_URL="/tmp/test_examples.db"
 
@@ -9,13 +9,13 @@ if [ -z "$BACKEND" ]; then
     export BACKEND="sqlite"
 fi
 
-cd $SCRIPTPATH
+cd "$SCRIPTPATH"
 
 if [ -z "${BACKEND##*sqlite*}" ]; then
-  for dir in $(find . -maxdepth 1 -mindepth 1 -type d); do
-    cd $dir
-    ../../../bin/diesel database reset
-    cargo build
-    cd ..
-  done
+    find . -maxdepth 1 -mindepth 1 -type d | while read -r dir; do
+        cd "$dir"
+        ../../../bin/diesel database reset
+        cargo build
+        cd ..
+    done
 fi
diff --git a/examples/test_all b/examples/test_all
index 0191a6d1d868..b2305e1ff1d5 100755
--- a/examples/test_all
+++ b/examples/test_all
@@ -2,11 +2,11 @@
 set -e
 
 SCRIPT=$(readlink -f $0)
-SCRIPTPATH=`dirname $SCRIPT`
+SCRIPTPATH=$(dirname "$SCRIPT")
 
-cd $SCRIPTPATH
+cd "$SCRIPTPATH"
 
-for dir in $(find . -maxdepth 1 -mindepth 1 -type d); do
-    echo $dir
-    (cd $dir && ./test_all)
+find . -maxdepth 1 -mindepth 1 -type d | while read -r dir; do
+    echo "$dir"
+    (cd "$dir" && ./test_all)
 done