Skip to content

Commit c855bf6

Browse files
Add a test
1 parent 1447f9d commit c855bf6

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pub trait Bar: Super<SuperAssoc: Bound> {}
2+
3+
pub trait Super {
4+
type SuperAssoc;
5+
}
6+
7+
pub trait Bound {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@ aux-build:implied-predicates.rs
2+
3+
extern crate implied_predicates;
4+
use implied_predicates::Bar;
5+
6+
fn bar<B: Bar>() {}
7+
8+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0277]: the trait bound `<B as Super>::SuperAssoc: implied_predicates::Bound` is not satisfied
2+
--> $DIR/implied-predicates.rs:6:11
3+
|
4+
LL | fn bar<B: Bar>() {}
5+
| ^^^ the trait `implied_predicates::Bound` is not implemented for `<B as Super>::SuperAssoc`
6+
|
7+
note: required by a bound in `Bar`
8+
--> $DIR/auxiliary/implied-predicates.rs:1:34
9+
|
10+
LL | pub trait Bar: Super<SuperAssoc: Bound> {}
11+
| ^^^^^ required by this bound in `Bar`
12+
help: consider further restricting the associated type
13+
|
14+
LL | fn bar<B: Bar>() where <B as Super>::SuperAssoc: implied_predicates::Bound {}
15+
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16+
17+
error: aborting due to 1 previous error
18+
19+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)