Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
Lines changed: 7 additions & 0 deletions
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 {}
Lines changed: 8 additions & 0 deletions
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() {}
Lines changed: 19 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /