| Age | Commit message (Collapse) | Author | Lines |
|
Don't stop evaluating due to errors before borrow checking
r? @oli-obk
Fix #60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.
|
|
|
|
|
|
|
|
|
|
```
error[E0004]: non-exhaustive patterns: type `X` is non-empty
--> file.rs:9:11
|
1 | / enum X {
2 | | A,
| | - variant not covered
3 | | B,
| | - variant not covered
4 | | C,
| | - variant not covered
5 | | }
| |_- `X` defined here
...
9 | match x {
| ^
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
error[E0004]: non-exhaustive patterns: `B` and `C` not covered
--> file.rs:11:11
|
1 | / enum X {
2 | | A,
3 | | B,
4 | | C,
| | - not covered
5 | | }
| |_- `X` defined here
...
11 | match x {
| ^ patterns `C` not covered
```
When a match expression doesn't have patterns covering every variant,
point at the enum's definition span. On a best effort basis, point at the
variant(s) that are missing. This does not handle the case when the missing
pattern is due to a field's enum variants:
```
enum E1 {
A,
B,
C,
}
enum E2 {
A(E1),
B,
}
fn foo() {
match E2::A(E1::A) {
E2::A(E1::B) => {}
E2::B => {}
}
//~^ ERROR `E2::A(E1::A)` and `E2::A(E1::C)` not handled
}
```
Unify look between match with no arms and match with some missing patterns.
Fix #37518.
|
|
|
|
|
|
|
|
Use structured suggestions for nonstandard style lints
This PR modifies the lints in the nonstandard_style group to use structured suggestions. Note that there's a bit of tricky span calculation going on for the `crate_name` attribute. It also simplifies the code a bit: I don't think the "fallback" suggestions for these lints can actually be triggered.
Fixes #48103.
Fixes #52414.
|
|
|
|
|
|
|
|
Use a structured suggestion and tighten the span to just the identifier.
|
|
Replace "integral variable" with "integer" and replace
"floating-point variable" with "floating-point number" to make the
message less confusing.
|
|
|
|
|
|
|
|
|
|
|
|
Allow explicit matches on ! without warning
It's now possible to explicitly match on `!` without an unreachable code warning. This seems desirable as promoting explicitness.
Fixes https://github.com/rust-lang/rust/issues/55116.
|
|
This commit updates the test output for the updated NLL compare mode
that uses `-Z borrowck=migrate` rather than `-Z borrowck=mir`. The
previous commit changes `compiletest` and this commit only updates
`.nll.stderr` files.
|
|
|
|
|
|
|
|
|
|
|