-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do wfcheck on ADT field before Sized check
- Loading branch information
1 parent
760237f
commit c1f4f98
Showing
6 changed files
with
51 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
struct S<T: Tr>(T::Assoc); | ||
|
||
trait Tr { | ||
type Assoc; | ||
} | ||
|
||
struct Hoge<K> { | ||
s: S<K>, //~ ERROR the trait bound `K: Tr` is not satisfied | ||
a: u32, | ||
} | ||
|
||
fn main() {} |
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,19 @@ | ||
error[E0277]: the trait bound `K: Tr` is not satisfied | ||
--> $DIR/issue-96810.rs:8:8 | ||
| | ||
LL | s: S<K>, | ||
| ^^^^ the trait `Tr` is not implemented for `K` | ||
| | ||
note: required by a bound in `S` | ||
--> $DIR/issue-96810.rs:1:13 | ||
| | ||
LL | struct S<T: Tr>(T::Assoc); | ||
| ^^ required by this bound in `S` | ||
help: consider restricting type parameter `K` | ||
| | ||
LL | struct Hoge<K: Tr> { | ||
| ++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |