-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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
Given the following code:
#![feature(generic_associated_types)]
trait Trait {
type Assoc<'a>;
}
impl<'b> Trait for &'b () {
type Assoc<'a>
= &'a &'b ()
where
Self: 'a;
}
The current output is:
error: `impl` associated type signature for `Assoc` doesn't match `trait` associated type signature
--> src/lib.rs:8:5
|
4 | type Assoc<'a>;
| -------------- expected
...
8 | type Assoc<'a>
| ^^^^^^^^^^^^^^ found
Ideally the output should look like:
error: `impl` associated type signature for `Assoc` doesn't match `trait` associated type signature
--> src/lib.rs:8:5
|
4 | type Assoc<'a>;
| -------------- expected no where clause
...
8 | type Assoc<'a>
| ...
| where
| Self: 'a;
| ^^^^^^^^ found where clause not present on trait definition
note: consider adding where clause to trait definition
|
4 | type Assoc<'a>
| where
| Self: 'a;
| +++++++++++++
Metadata
Metadata
Assignees
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.