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.
- Loading branch information
1 parent
1447f9d
commit c855bf6
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
tests/ui/associated-type-bounds/auxiliary/implied-predicates.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,7 @@ | ||
pub trait Bar: Super<SuperAssoc: Bound> {} | ||
|
||
pub trait Super { | ||
type SuperAssoc; | ||
} | ||
|
||
pub trait Bound {} |
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,8 @@ | ||
//@ aux-build:implied-predicates.rs | ||
|
||
extern crate implied_predicates; | ||
use implied_predicates::Bar; | ||
|
||
fn bar<B: Bar>() {} | ||
|
||
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 `<B as Super>::SuperAssoc: implied_predicates::Bound` is not satisfied | ||
--> $DIR/implied-predicates.rs:6:11 | ||
| | ||
LL | fn bar<B: Bar>() {} | ||
| ^^^ the trait `implied_predicates::Bound` is not implemented for `<B as Super>::SuperAssoc` | ||
| | ||
note: required by a bound in `Bar` | ||
--> $DIR/auxiliary/implied-predicates.rs:1:34 | ||
| | ||
LL | pub trait Bar: Super<SuperAssoc: Bound> {} | ||
| ^^^^^ required by this bound in `Bar` | ||
help: consider further restricting the associated type | ||
| | ||
LL | fn bar<B: Bar>() where <B as Super>::SuperAssoc: implied_predicates::Bound {} | ||
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |