File tree 3 files changed +34
-0
lines changed
tests/ui/associated-type-bounds
3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ pub trait Bar : Super < SuperAssoc : Bound > { }
2
+
3
+ pub trait Super {
4
+ type SuperAssoc ;
5
+ }
6
+
7
+ pub trait Bound { }
Original file line number Diff line number Diff line change
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 number Diff line number Diff line change
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`.
You can’t perform that action at this time.
0 commit comments