| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
This commit extends existing suggestions to prefix unused variable
bindings in match arms with an underscore so that it applies to all
patterns in a match arm.
|
|
|
|
Point at cause for expectation in return type type error
Various improvements and fixes for type errors in return expressions.
Fix #57664.
|
|
Fix unused_assignments false positive
Fixes #22630.
In liveness analysis, make `continue` jump to the loop condition's `LiveNode` (`cond` as in comment) instead of the loop's one (`expr`).
https://github.com/rust-lang/rust/blob/069b0c410808c1d1d33b495e048b1186e9f8d57f/src/librustc/middle/liveness.rs#L1358-L1370
|
|
|
|
Modify mismatched type error for functions with no return
Fix #50009.
```
error[E0308]: mismatched types
--> $DIR/coercion-missing-tail-expected-type.rs:3:24
|
LL | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
| -------- ^^^ expected i32, found ()
| |
| this function's body doesn't return
LL | x + 1;
| - help: consider removing this semicolon
|
= note: expected type `i32`
found type `()`
```
instead of
```
error[E0308]: mismatched types
--> $DIR/coercion-missing-tail-expected-type.rs:3:28
|
LL | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
| ____________________________^
LL | | x + 1;
| | - help: consider removing this semicolon
LL | | }
| |_^ expected i32, found ()
|
= note: expected type `i32`
found type `()`
```
|
|
Make `continue` jump to the loop condition's `LiveNode` instead of one
of the loop body.
|
|
|
|
|
|
Do not point at the entire block span on fn return type mismatches
caused by missing return.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
By introducing a new map that tracks the errors reported and the
`Place`s that spawned those errors against the move out that the error
was referring to, we are able to silence duplicate errors by emitting
only the error which corresponds to the most specific `Place` (that which
other `Place`s which reported errors are prefixes of).
This generally is an improvement, however there is a case -
`liveness-move-in-while` - where the output regresses.
|
|
Fixes #54133.
|
|
|