Add a test

This commit is contained in:
Michael Goulet 2024-03-22 13:13:04 -04:00
parent 1447f9d38c
commit c855bf62d7
3 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,7 @@
pub trait Bar: Super<SuperAssoc: Bound> {}
pub trait Super {
type SuperAssoc;
}
pub trait Bound {}

View File

@ -0,0 +1,8 @@
//@ aux-build:implied-predicates.rs
extern crate implied_predicates;
use implied_predicates::Bar;
fn bar<B: Bar>() {}
fn main() {}

View 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`.