Repository navigation
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
extern crate diesel; // diesel = { version = "2.3", features = ["sqlite"] }
use diesel::*;
table! {
users {
id -> Integer,
}
}
fn main() {
use self::users::dsl::*;
users.for_update().distinct();
}Current output
Checking testing v0.1.0 (/tmp/testing)
error[E0277]: the trait bound `SelectStatement<..., ..., ..., ..., ..., ..., ..., ..., ...>: DistinctDsl` is not satisfied
--> src/main.rs:14:24
|
14 | users.for_update().distinct();
| ^^^^^^^^ the trait `DistinctDsl` is not implemented for `SelectStatement<..., ..., ..., ..., ..., ..., ..., ..., ...>`
|
= note: a `DISTINCT` clause is not compatible with various other clauses like `LOCKING` clauses
help: the trait `DistinctDsl` is implemented for `diesel::query_builder::select_statement::SelectStatement<F, S, D, W, O, LOf, G, H>`
--> /home/weiznich/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/diesel-2.3.12/src/query_builder/select_statement/dsl_impls.rs:179:1
|
179 | / impl<ST, F, S, D, W, O, LOf, G, H> DistinctDsl for SelectStatement<F, S, D, W, O, LOf, G, H>
180 | | where
181 | | Self: SelectQuery<SqlType = ST>,
182 | | SelectStatement<F, S, DistinctClause, W, O, LOf, G, H>: SelectQuery<SqlType = ST>,
| |______________________________________________________________________________________^
= note: the full name for the type has been written to '/tmp/testing/target/debug/deps/testing-03118f16a731a39e.long-type-12300597481247196782.txt'
= note: consider using `--verbose` to print the full type name to the console
error[E0277]: the trait bound `SelectStatement<..., ..., ..., ..., ..., ..., ..., ..., ...>: Table` is not satisfied
--> src/main.rs:14:24
|
14 | users.for_update().distinct();
| ^^^^^^^^ the trait `DistinctDsl` is not implemented for `SelectStatement<..., ..., ..., ..., ..., ..., ..., ..., ...>`
|
help: the trait `DistinctDsl` is implemented for `diesel::query_builder::select_statement::SelectStatement<F, S, D, W, O, LOf, G, H>`
--> /home/weiznich/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/diesel-2.3.12/src/query_builder/select_statement/dsl_impls.rs:179:1
|
179 | / impl<ST, F, S, D, W, O, LOf, G, H> DistinctDsl for SelectStatement<F, S, D, W, O, LOf, G, H>
180 | | where
181 | | Self: SelectQuery<SqlType = ST>,
182 | | SelectStatement<F, S, DistinctClause, W, O, LOf, G, H>: SelectQuery<SqlType = ST>,
| |______________________________________________________________________________________^
= note: the full name for the type has been written to '/tmp/testing/target/debug/deps/testing-03118f16a731a39e.long-type-12300597481247196782.txt'
= note: consider using `--verbose` to print the full type name to the console
error[E0277]: the trait bound `SelectStatement<FromClause<...>>: DistinctDsl` is not satisfied
--> src/main.rs:14:24
|
14 | users.for_update().distinct();
| ^^^^^^^^ the trait `DistinctDsl` is not implemented for `SelectStatement<FromClause<...>>`
|
= note: a `DISTINCT` clause is not compatible with various other clauses like `LOCKING` clauses
help: the trait `DistinctDsl` is conditionally implemented for `diesel::query_builder::select_statement::SelectStatement<F, S, D, W, O, LOf, G, H>`
--> /home/weiznich/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/diesel-2.3.12/src/query_builder/select_statement/dsl_impls.rs:179:1
|
179 | impl<ST, F, S, D, W, O, LOf, G, H> DistinctDsl for SelectStatement<F, S, D, W, O, LOf, G, H>
| ^ - unsatisfied requirement introduced here: `diesel::query_builder::select_clause::DefaultSelectClause<diesel::query_builder::from_clause::FromClause<diesel::query_builder::select_statement::SelectStatement<diesel::query_builder::from_clause::FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<diesel::query_builder::from_clause::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>>>: Sized`
| _|
| |
180 | | where
181 | | Self: SelectQuery<SqlType = ST>,
| | ------------ unsatisfied requirement introduced here: `<diesel::query_builder::select_statement::SelectStatement<diesel::query_builder::from_clause::FromClause<diesel::query_builder::select_statement::SelectStatement<diesel::query_builder::from_clause::FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<diesel::query_builder::from_clause::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 SelectQuery>::SqlType == _`
182 | | SelectStatement<F, S, DistinctClause, W, O, LOf, G, H>: SelectQuery<SqlType = ST>,
| |______________________________________________________________________________________^
= note: the full name for the type has been written to '/tmp/testing/target/debug/deps/testing-03118f16a731a39e.long-type-15337691006018164503.txt'
= note: consider using `--verbose` to print the full type name to the console
For more information about this error, try `rustc --explain E0277`.
error: could not compile `testing` (bin "testing") due to 3 previous errors
rust-compilation exited abnormally with code 101 at Fri Aug 21 08:50:53, duration 0.08 sDesired output
unsatisfied requirement introduced here: `<diesel::query_builder::select_statement::SelectStatement<diesel::query_builder::from_clause::FromClause<diesel::query_builder::select_statement::SelectStatement<diesel::query_builder::from_clause::FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<diesel::query_builder::from_clause::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 SelectQuery>::SqlType == _`
should be shorted to whatever rustc performs in other placesRationale and extra context
Types are truncated in all other contexts in the error messages
Other cases
Rust Version
rustc 1.98.0 (88d9e12ae 2026-08-18)
binary: rustc
commit-hash: 88d9e12ae178fab0fb5cc050a94da85685d449ea
commit-date: 2026-08-18
host: x86_64-unknown-linux-gnu
release: 1.98.0
LLVM version: 22.1.8Anything else?
This started to appear with rust 1.98. 1.97 does not have this long type, so it's a recent change
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Activity
lsunsi commentedon Aug 24, 2026
@rustbot claim
I'll start by bisecting since @weiznich said it's a recent change.
If anyone has more pointers on where to look or something, please let me know!
lsunsi commentedon Aug 25, 2026
It seems this was introduced in 752cc4a (found via bisect). Investigating further
lsunsi commentedon Aug 26, 2026
@weiznich The output coming from your code using #161818 is as follows.
weiznich commentedon Aug 26, 2026
That looks much better. Thanks for investigating and fixing this issue ❤️
Rollup merge of rust-lang#161818 - lsunsi:issue161439, r=JonathanBrouwer
Rollup merge of rust-lang#161818 - lsunsi:issue161439, r=JonathanBrouwer
Unrolled build for #161818 in rollup 161840