On type mismatch caused by assignment, point at assignee

* Do not emit unnecessary E0308 after E0070
* Show fewer errors on `while let` missing `let`
* Hide redundant E0308 on `while let` missing `let`
* Point at binding definition when possible on invalid assignment
* do not point at closure twice
* do not suggest `if let` for literals in lhs
* account for parameter types
This commit is contained in:
Esteban Küber
2021-05-06 19:09:35 -07:00
committed by Esteban Kuber
parent 862962b90e
commit 37a11a96a1
39 changed files with 297 additions and 117 deletions

View File

@@ -1,6 +1,8 @@
fn main() {
let mut x = 2;
let mut x //~ NOTE expected due to the type of this binding
=
2; //~ NOTE expected due to this value
x = 5.0;
//~^ ERROR mismatched types
//~| expected integer, found floating-point number
//~| NOTE expected integer, found floating-point number
}