Suggestion for immutable reference -> mutable pointer should be emitted

as `Applicability::Unspecified`
This commit is contained in:
Donough Liu 2020-05-01 21:57:19 +08:00
parent 80d04cc1ba
commit 089d4bbfd7
2 changed files with 1 additions and 2 deletions

View file

@ -37,7 +37,6 @@ impl DerefMut for Emm {
}
}
fn main() {
// Should not suggest when a is immutable
let a = Emm(Foo(Bar(0)));
let _: *mut u8 = &a; //~ ERROR mismatched types
}

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-71676-2.rs:42:22
--> $DIR/issue-71676-2.rs:41:22
|
LL | let _: *mut u8 = &a;
| ------- ^^