rust/tests/ui/uninhabited
Esteban Küber d216ca0506 Detect missing if let or let-else
During `let` binding parse error and encountering a block, detect if there is a likely missing `if` or `else`:

```
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `{`
  --> $DIR/missing-if-let-or-let-else.rs:14:25
   |
LL |     let Some(x) = foo() {
   |                         ^ expected one of `.`, `;`, `?`, `else`, or an operator
   |
help: you might have meant to use `if let`
   |
LL |     if let Some(x) = foo() {
   |     ++
help: alternatively, you might have meant to use `let else`
   |
LL |     let Some(x) = foo() else {
   |                         ++++
```
2025-08-20 18:26:04 +00:00
..
auxiliary Add test 2025-07-20 14:49:43 +02:00
diverging-guard.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
exhaustive-wo-nevertype-issue-51221.rs Update tests 2024-08-10 12:07:17 +02:00
issue-107505.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
missing-if-let-or-let-else.rs Detect missing if let or let-else 2025-08-20 18:26:04 +00:00
missing-if-let-or-let-else.stderr Detect missing if let or let-else 2025-08-20 18:26:04 +00:00
privately-uninhabited-dead-code.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
privately-uninhabited-mir-call.fixed Handle more cases of value suggestions 2024-04-10 20:36:14 +00:00
privately-uninhabited-mir-call.rs Handle more cases of value suggestions 2024-04-10 20:36:14 +00:00
privately-uninhabited-mir-call.stderr Handle more cases of value suggestions 2024-04-10 20:36:14 +00:00
projection.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
uninhabited-enum-cast.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
uninhabited-irrefutable.exhaustive_patterns.stderr Update tests for new TRPL chapter order 2024-11-23 08:57:25 -07:00
uninhabited-irrefutable.normal.stderr Update tests for new TRPL chapter order 2024-11-23 08:57:25 -07:00
uninhabited-irrefutable.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
uninhabited-matches-feature-gated.rs Update tests 2024-08-10 12:07:17 +02:00
uninhabited-matches-feature-gated.stderr Update tests 2024-08-10 12:07:17 +02:00
uninhabited-patterns.rs treat box patterns as deref patterns in THIR and usefulness analysis 2025-07-04 01:28:35 -07:00
uninhabited-patterns.stderr treat box patterns as deref patterns in THIR and usefulness analysis 2025-07-04 01:28:35 -07:00
uninhabited-pin-field.rs Dont consider fields that are forced unstable due to -Zforce-unstable-if-unmarked to be uninhabited 2025-03-18 18:24:02 +00:00
uninhabited-pin-field.stderr Dont consider fields that are forced unstable due to -Zforce-unstable-if-unmarked to be uninhabited 2025-03-18 18:24:02 +00:00
uninhabited-transparent-return-abi.rs Add ignore-backends annotations in failing GCC backend ui tests 2025-07-23 13:48:04 +02:00
uninhabited-type-layout-computation-88150.rs Rehome tests/ui/issues/ tests [4/?] 2025-08-10 11:54:15 -04:00
uninhabited-unstable-field.rs Don't consider unstable fields always-inhabited 2025-07-20 18:23:18 +02:00
uninhabited-unstable-field.stderr Don't consider unstable fields always-inhabited 2025-07-20 18:23:18 +02:00