mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Add a test
This commit is contained in:
parent
1447f9d38c
commit
c855bf62d7
@ -0,0 +1,7 @@
|
||||
pub trait Bar: Super<SuperAssoc: Bound> {}
|
||||
|
||||
pub trait Super {
|
||||
type SuperAssoc;
|
||||
}
|
||||
|
||||
pub trait Bound {}
|
8
tests/ui/associated-type-bounds/implied-predicates.rs
Normal file
8
tests/ui/associated-type-bounds/implied-predicates.rs
Normal file
@ -0,0 +1,8 @@
|
||||
//@ aux-build:implied-predicates.rs
|
||||
|
||||
extern crate implied_predicates;
|
||||
use implied_predicates::Bar;
|
||||
|
||||
fn bar<B: Bar>() {}
|
||||
|
||||
fn main() {}
|
19
tests/ui/associated-type-bounds/implied-predicates.stderr
Normal file
19
tests/ui/associated-type-bounds/implied-predicates.stderr
Normal file
@ -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`.
|
Loading…
Reference in New Issue
Block a user