forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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#106208 - compiler-errors:compare-item-regio…
…n-err, r=estebank Make trait/impl `where` clause mismatch on region error a bit more actionable Improve `where` clause suggestions for GATs/methods that have incompatible region predicates in their `where` clauses. Also addresses this diagnostic that went away rust-lang#106129 (comment)
- Loading branch information
Showing
10 changed files
with
150 additions
and
42 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
12 changes: 12 additions & 0 deletions
12
src/test/ui/generic-associated-types/mismatched-where-clause-regions.rs
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
trait Foo { | ||
type T<'a1, 'b1> | ||
where | ||
'a1: 'b1; | ||
} | ||
|
||
impl Foo for () { | ||
type T<'a2, 'b2> = () where 'b2: 'a2; | ||
//~^ ERROR impl has stricter requirements than trait | ||
} | ||
|
||
fn main() {} |
17 changes: 17 additions & 0 deletions
17
src/test/ui/generic-associated-types/mismatched-where-clause-regions.stderr
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error[E0276]: impl has stricter requirements than trait | ||
--> $DIR/mismatched-where-clause-regions.rs:8:38 | ||
| | ||
LL | type T<'a1, 'b1> | ||
| ---------------- definition of `T` from trait | ||
... | ||
LL | type T<'a2, 'b2> = () where 'b2: 'a2; | ||
| ^^^ impl has extra requirement `'b2: 'a2` | ||
| | ||
help: copy the `where` clause predicates from the trait | ||
| | ||
LL | type T<'a2, 'b2> = () where 'a2: 'b2; | ||
| ~~~~~~~~~~~~~~ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0276`. |
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