-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent cycle in implied predicates computation
- Loading branch information
1 parent
1d447a9
commit 6edbc8d
Showing
3 changed files
with
49 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#![feature(associated_type_bounds)] | ||
|
||
trait A { | ||
type T; | ||
} | ||
|
||
trait B: A<T: B> {} | ||
//~^ ERROR cycle detected when computing the implied predicates of `B` | ||
|
||
fn main() {} |
17 changes: 17 additions & 0 deletions
17
tests/ui/associated-type-bounds/implied-bounds-cycle.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error[E0391]: cycle detected when computing the implied predicates of `B` | ||
--> $DIR/implied-bounds-cycle.rs:7:15 | ||
| | ||
LL | trait B: A<T: B> {} | ||
| ^ | ||
| | ||
= note: ...which immediately requires computing the implied predicates of `B` again | ||
note: cycle used when computing normalized predicates of `B` | ||
--> $DIR/implied-bounds-cycle.rs:7:1 | ||
| | ||
LL | trait B: A<T: B> {} | ||
| ^^^^^^^^^^^^^^^^ | ||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0391`. |