Unify region variables when projecting associated types
This is required to avoid cycles when evaluating auto trait predicates.
This commit is contained in:
parent
435f97cec1
commit
ba2ef58ae6
29 changed files with 133 additions and 35 deletions
|
|
@ -1,15 +0,0 @@
|
|||
//~ ERROR
|
||||
|
||||
#![feature(optin_builtin_traits)]
|
||||
#![feature(negative_impls)]
|
||||
|
||||
unsafe auto trait Trait {
|
||||
type Output; //~ ERROR E0380
|
||||
}
|
||||
|
||||
fn call_method<T: Trait>(x: T) {}
|
||||
|
||||
fn main() {
|
||||
// ICE
|
||||
call_method(());
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
error[E0380]: auto traits cannot have methods or associated items
|
||||
--> $DIR/issue-23080-2.rs:7:10
|
||||
|
|
||||
LL | unsafe auto trait Trait {
|
||||
| ----- auto trait cannot have items
|
||||
LL | type Output;
|
||||
| ^^^^^^
|
||||
|
||||
error[E0275]: overflow evaluating the requirement `<() as Trait>::Output`
|
||||
|
|
||||
= note: required because of the requirements on the impl of `Trait` for `()`
|
||||
= note: required because of the requirements on the impl of `Trait` for `()`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0275, E0380.
|
||||
For more information about an error, try `rustc --explain E0275`.
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#![feature(optin_builtin_traits)]
|
||||
#![feature(negative_impls)]
|
||||
|
||||
unsafe auto trait Trait {
|
||||
fn method(&self) { //~ ERROR E0380
|
||||
println!("Hello");
|
||||
}
|
||||
}
|
||||
|
||||
fn call_method<T: Trait>(x: T) {
|
||||
x.method();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// ICE
|
||||
call_method(());
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
error[E0380]: auto traits cannot have methods or associated items
|
||||
--> $DIR/issue-23080.rs:5:8
|
||||
|
|
||||
LL | unsafe auto trait Trait {
|
||||
| ----- auto trait cannot have items
|
||||
LL | fn method(&self) {
|
||||
| ^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0380`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue