Process alias-relate obligations when proving receiver_is_valid
This commit is contained in:
parent
11dd90f761
commit
fdde66acee
8 changed files with 38 additions and 50 deletions
|
|
@ -1,12 +0,0 @@
|
|||
error[E0271]: type mismatch resolving `<() as Index>::Output == &mut <() as Index>::Output`
|
||||
--> $DIR/issue-100222.rs:34:12
|
||||
|
|
||||
LL | fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output
|
||||
| ^^^^^^^^^ expected `()`, found `&mut <() as Index>::Output`
|
||||
|
|
||||
= note: expected unit type `()`
|
||||
found mutable reference `&mut <() as Index>::Output`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0271`.
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
error[E0271]: type mismatch resolving `<() as Index>::Output == &mut <() as Index>::Output`
|
||||
--> $DIR/issue-100222.rs:25:12
|
||||
|
|
||||
LL | fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output
|
||||
| ^^^^^^^^^ expected `()`, found `&mut <() as Index>::Output`
|
||||
|
|
||||
= note: expected unit type `()`
|
||||
found mutable reference `&mut <() as Index>::Output`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0271`.
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
//@ revisions: nn ny yn yy
|
||||
//@ known-bug: #110395
|
||||
//@ compile-flags: -Znext-solver
|
||||
//@ check-pass
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
#![feature(const_trait_impl, effects, associated_type_defaults, const_mut_refs)]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
error[E0271]: type mismatch resolving `<() as Index>::Output == &mut <() as Index>::Output`
|
||||
--> $DIR/issue-100222.rs:34:12
|
||||
|
|
||||
LL | fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output
|
||||
| ^^^^^^^^^ expected `()`, found `&mut <() as Index>::Output`
|
||||
|
|
||||
= note: expected unit type `()`
|
||||
found mutable reference `&mut <() as Index>::Output`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0271`.
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
error[E0271]: type mismatch resolving `<() as Index>::Output == &mut <() as Index>::Output`
|
||||
--> $DIR/issue-100222.rs:25:12
|
||||
|
|
||||
LL | fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output
|
||||
| ^^^^^^^^^ expected `()`, found `&mut <() as Index>::Output`
|
||||
|
|
||||
= note: expected unit type `()`
|
||||
found mutable reference `&mut <() as Index>::Output`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0271`.
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
//@ compile-flags: -Znext-solver
|
||||
//@ check-pass
|
||||
|
||||
// Fixes a regression in `receiver_is_valid` in wfcheck where we were using
|
||||
// `InferCtxt::can_eq` instead of processing alias-relate goals, leading to false
|
||||
// positives, not deref'ing enough steps to check the receiver is valid.
|
||||
|
||||
trait Mirror {
|
||||
type Mirror: ?Sized;
|
||||
}
|
||||
impl<T: ?Sized> Mirror for T {
|
||||
type Mirror = T;
|
||||
}
|
||||
|
||||
trait Foo {
|
||||
fn foo(&self) {}
|
||||
}
|
||||
|
||||
impl Foo for <() as Mirror>::Mirror {
|
||||
fn foo(&self) {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue