about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/lib.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2025-08-24 19:22:51 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-08-25 15:16:25 +0000
commit8dbdb1760b23112f87aedad37e4dad97559bc750 (patch)
treedd2cd17a9704e56eac5416f6c5c9883ebd6deaf5 /compiler/rustc_resolve/src/lib.rs
parent41a79f1862aa6b81bac674598e275e80e9f09eb9 (diff)
downloadrust-8dbdb1760b23112f87aedad37e4dad97559bc750.tar.gz
rust-8dbdb1760b23112f87aedad37e4dad97559bc750.zip
On binding not present in all patterns, suggest potential typo
```
error[E0408]: variable `Ban` is not bound in all patterns
 --> f12.rs:9:9
  |
9 |         (Foo,Bar)|(Ban,Foo) => {}
  |         ^^^^^^^^^  --- variable not in all patterns
  |         |
  |         pattern doesn't bind `Ban`
  |
help: you might have meant to use the similarly named previously used binding `Bar`
  |
9 -         (Foo,Bar)|(Ban,Foo) => {}
9 +         (Foo,Bar)|(Bar,Foo) => {}
  |
```
Diffstat (limited to 'compiler/rustc_resolve/src/lib.rs')
-rw-r--r--compiler/rustc_resolve/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs
index 2afb52ef4d4..c36a6883300 100644
--- a/compiler/rustc_resolve/src/lib.rs
+++ b/compiler/rustc_resolve/src/lib.rs
@@ -230,8 +230,8 @@ enum Used {
 #[derive(Debug)]
 struct BindingError {
     name: Ident,
-    origin: BTreeSet<Span>,
-    target: BTreeSet<Span>,
+    origin: Vec<(Span, ast::Pat)>,
+    target: Vec<ast::Pat>,
     could_be_path: bool,
 }