-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #88336 - jackh726:gats-where-constraints, r=estebank
Detect stricter constraints on gats where clauses in impls vs trait I might try to see if I can do a bit more to improve these diagnostics, but any initial feedback is appreciated. I can also do any additional work in a followup PR. r? `@estebank`
- Loading branch information
Showing
8 changed files
with
130 additions
and
47 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
13 changes: 13 additions & 0 deletions
13
src/test/ui/generic-associated-types/missing-where-clause-on-trait.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,13 @@ | ||
// check-fail | ||
|
||
#![feature(generic_associated_types)] | ||
|
||
trait Foo { | ||
type Assoc<'a, 'b>; | ||
} | ||
impl Foo for () { | ||
type Assoc<'a, 'b> where 'a: 'b = (); | ||
//~^ `impl` associated type | ||
} | ||
|
||
fn main() {} |
11 changes: 11 additions & 0 deletions
11
src/test/ui/generic-associated-types/missing-where-clause-on-trait.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,11 @@ | ||
error: `impl` associated type signature for `Assoc` doesn't match `trait` associated type signature | ||
--> $DIR/missing-where-clause-on-trait.rs:9:5 | ||
| | ||
LL | type Assoc<'a, 'b>; | ||
| ------------------- expected | ||
... | ||
LL | type Assoc<'a, 'b> where 'a: 'b = (); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found | ||
|
||
error: aborting due to previous error | ||
|