error[E0277]: the trait bound `users::columns::id: IsContainedInGroupBy<comments::columns::id>` is not satisfied
--> src/main.rs:44:10
|
44 | .select((users::all_columns, posts::all_columns, comments::id));
| ^^^^^^ unsatisfied trait bound
|
help: the trait `IsContainedInGroupBy<comments::columns::id>` is not implemented for `users::columns::id`
--> src/main.rs:5:9
|
5 | id -> Integer,
| ^^
= note: if your query contains columns from several tables in your group by or select clause make sure to call `allow_columns_to_appear_in_same_group_by_clause!` with these columns
= help: the following other types implement trait `IsContainedInGroupBy<T>`:
`users::columns::id` implements `IsContainedInGroupBy<posts::columns::id>`
`users::columns::id` implements `IsContainedInGroupBy<posts::columns::title>`
`users::columns::id` implements `IsContainedInGroupBy<posts::columns::user_id>`
`users::columns::id` implements `IsContainedInGroupBy<users::columns::hair_color>`
`users::columns::id` implements `IsContainedInGroupBy<users::columns::id>`
`users::columns::id` implements `IsContainedInGroupBy<users::columns::name>`
= note: required for `(users::columns::id, posts::columns::id)` to implement `IsContainedInGroupBy<comments::columns::id>`
note: required for `comments::columns::id` to implement `ValidGrouping<(users::columns::id, posts::columns::id)>`
--> src/main.rs:21:9
|
21 | id -> Integer,
| ^^
= note: 2 redundant requirements hidden
= note: required for `((id, name, hair_color), (id, title, user_id), id)` to implement `ValidGrouping<(users::columns::id, posts::columns::id)>`
= note: required for `SelectStatement<..., ..., ..., ..., ..., ..., ...>` to implement `SelectDsl<((id, name, hair_color), ..., ...)>`
= note: the full name for the type has been written to '/tmp/testing/target/debug/deps/testing-d8f695771be6e993.long-type-12488973070328796207.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: this error originates in 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
--> src/main.rs:44:10
|
44 | .select((users::all_columns, posts::all_columns, comments::id));
| ^^^^^^ unsatisfied trait bound
|
help: the trait `IsContainedInGroupBy<comments::columns::id>` is not implemented for `posts::columns::id`
--> src/main.rs:13:9
|
13 | id -> Integer,
| ^^
= note: if your query contains columns from several tables in your group by or select clause make sure to call `allow_columns_to_appear_in_same_group_by_clause!` with these columns
= help: the following other types implement trait `IsContainedInGroupBy<T>`:
`posts::columns::id` implements `IsContainedInGroupBy<posts::columns::id>`
`posts::columns::id` implements `IsContainedInGroupBy<posts::columns::title>`
`posts::columns::id` implements `IsContainedInGroupBy<posts::columns::user_id>`
`posts::columns::id` implements `IsContainedInGroupBy<users::columns::hair_color>`
`posts::columns::id` implements `IsContainedInGroupBy<users::columns::id>`
`posts::columns::id` implements `IsContainedInGroupBy<users::columns::name>`
= note: required for `(posts::columns::id,)` to implement `IsContainedInGroupBy<comments::columns::id>`
= note: 1 redundant requirement hidden
= note: required for `(users::columns::id, posts::columns::id)` to implement `IsContainedInGroupBy<comments::columns::id>`
note: required for `comments::columns::id` to implement `ValidGrouping<(users::columns::id, posts::columns::id)>`
--> src/main.rs:21:9
|
21 | id -> Integer,
| ^^
= note: 2 redundant requirements hidden
= note: required for `((id, name, hair_color), (id, title, user_id), id)` to implement `ValidGrouping<(users::columns::id, posts::columns::id)>`
= note: required for `SelectStatement<..., ..., ..., ..., ..., ..., ...>` to implement `SelectDsl<((id, name, hair_color), ..., ...)>`
= note: the full name for the type has been written to '/tmp/testing/target/debug/deps/testing-d8f695771be6e993.long-type-12488973070328796207.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: this error originates in the macro `table` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors
Code
I tried this code:
Reproducing this requires
--diagnostic-width=100to be setI expected to see this happen: Rustc emits an error message disambiguating all involved types
Full error message
Instead, this happened: Rustc emits an error message using the same ambiguous name for multiple types:
Note how rustc mentions the only the
idtype in this error message, although it represents 3 different distinct types in this caseFull error message
Version it worked on
It most recently worked on: 1.94.0
Version with regression
rustc --version --verbose:@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged