-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Point at GAT where clause when unsatisfied
- Loading branch information
1 parent
d144956
commit a1fbc14
Showing
4 changed files
with
60 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
struct S; | ||
|
||
trait D { | ||
type P<T: Copy>; | ||
//~^ NOTE required by this bound in `D::P` | ||
//~| NOTE required by a bound in `D::P` | ||
} | ||
|
||
impl D for S { | ||
type P<T: Copy> = (); | ||
} | ||
|
||
fn main() { | ||
let _: <S as D>::P<String>; | ||
//~^ ERROR the trait bound `String: Copy` is not satisfied | ||
//~| NOTE the trait `Copy` is not implemented for `String` | ||
} |
15 changes: 15 additions & 0 deletions
15
src/test/ui/generic-associated-types/own-bound-span.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,15 @@ | ||
error[E0277]: the trait bound `String: Copy` is not satisfied | ||
--> $DIR/own-bound-span.rs:14:12 | ||
| | ||
LL | let _: <S as D>::P<String>; | ||
| ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | ||
| | ||
note: required by a bound in `D::P` | ||
--> $DIR/own-bound-span.rs:4:15 | ||
| | ||
LL | type P<T: Copy>; | ||
| ^^^^ required by this bound in `D::P` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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