forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#122591 - gurry:122162-impl-type-binding-suggestion, r=fmease Suggest using type args directly instead of equality constraint When type arguments are written erroneously using an equality constraint we suggest specifying them directly without the equality constraint. Fixes rust-lang#122162 Changes the diagnostic in the issue from: ```rust error[E0229]: associated type bindings are not allowed here 9 | impl std::cmp::PartialEq<Rhs = T> for S { | ^^^^^^^ associated type not allowed here | ``` to ```rust error[E0229]: associated type bindings are not allowed here 9 | impl std::cmp::PartialEq<Rhs = T> for S { | ^^^^^^^ associated type not allowed here | help: to use `T` as a generic argument specify it directly | | impl std::cmp::PartialEq<T> for S { | ~ ```
- Loading branch information
Showing
17 changed files
with
707 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,49 @@ | ||
error[E0229]: associated type bindings are not allowed here | ||
--> $DIR/issue-102335-ty.rs:2:17 | ||
| | ||
LL | type A: S<C<i32 = u32> = ()>; | ||
LL | type A: S<C<i32 = u32> = ()>; // Just one erroneous equality constraint | ||
| ^^^^^^^^^ associated type not allowed here | ||
| | ||
help: consider removing this type binding | ||
| | ||
LL | type A: S<C<i32 = u32> = ()>; // Just one erroneous equality constraint | ||
| ~~~~~~~~~~~ | ||
|
||
error[E0229]: associated type bindings are not allowed here | ||
--> $DIR/issue-102335-ty.rs:2:17 | ||
| | ||
LL | type A: S<C<i32 = u32> = ()>; | ||
LL | type A: S<C<i32 = u32> = ()>; // Just one erroneous equality constraint | ||
| ^^^^^^^^^ associated type not allowed here | ||
| | ||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
help: consider removing this type binding | ||
| | ||
LL | type A: S<C<i32 = u32> = ()>; // Just one erroneous equality constraint | ||
| ~~~~~~~~~~~ | ||
|
||
error[E0229]: associated type bindings are not allowed here | ||
--> $DIR/issue-102335-ty.rs:8:17 | ||
| | ||
LL | type A: S<C<i32 = u32, X = i32> = ()>; // More than one erroneous equality constraints | ||
| ^^^^^^^^^ associated type not allowed here | ||
| | ||
help: consider removing this type binding | ||
| | ||
LL | type A: S<C<i32 = u32, X = i32> = ()>; // More than one erroneous equality constraints | ||
| ~~~~~~~~~~ | ||
|
||
error[E0229]: associated type bindings are not allowed here | ||
--> $DIR/issue-102335-ty.rs:8:17 | ||
| | ||
LL | type A: S<C<i32 = u32, X = i32> = ()>; // More than one erroneous equality constraints | ||
| ^^^^^^^^^ associated type not allowed here | ||
| | ||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
help: consider removing this type binding | ||
| | ||
LL | type A: S<C<i32 = u32, X = i32> = ()>; // More than one erroneous equality constraints | ||
| ~~~~~~~~~~ | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0229`. |
Oops, something went wrong.