forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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#105324 - compiler-errors:gat-where-clause-b…
…inding-obl, r=jackh726 Point at GAT `where` clause when an obligation is unsatisfied Slightly helps with rust-lang#105306
- Loading branch information
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