diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-12-15 22:58:16 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-12-15 22:58:16 +0000 |
| commit | 733fd03f0f9d5c8ad595f7b7cde17d3c1f33a19e (patch) | |
| tree | 76019f347ad1f93c992f49328d0d1ac2aaa5ef1b /tests/ui/pattern/struct-pattern-with-missing-fields-resolve-error.rs | |
| parent | 8c8e8d35bc207353977d44344506eda40bf502f5 (diff) | |
| download | rust-733fd03f0f9d5c8ad595f7b7cde17d3c1f33a19e.tar.gz rust-733fd03f0f9d5c8ad595f7b7cde17d3c1f33a19e.zip | |
Use `span_label` as it looks better when we show pattern missing binding in order
Diffstat (limited to 'tests/ui/pattern/struct-pattern-with-missing-fields-resolve-error.rs')
| -rw-r--r-- | tests/ui/pattern/struct-pattern-with-missing-fields-resolve-error.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/ui/pattern/struct-pattern-with-missing-fields-resolve-error.rs b/tests/ui/pattern/struct-pattern-with-missing-fields-resolve-error.rs index 7238a0a7bb7..225891e390f 100644 --- a/tests/ui/pattern/struct-pattern-with-missing-fields-resolve-error.rs +++ b/tests/ui/pattern/struct-pattern-with-missing-fields-resolve-error.rs @@ -1,6 +1,6 @@ struct Website { url: String, - title: Option<String> ,//~ NOTE defined here + title: Option<String>, } fn main() { @@ -14,8 +14,7 @@ fn main() { println!("[{}]({})", title, url); // we hide the errors for `title` and `url` } - if let Website { url, .. } = website { //~ NOTE `Website` has a field `title` - //~^ NOTE this pattern + if let Website { url, .. } = website { //~ NOTE this pattern println!("[{}]({})", title, url); //~ ERROR cannot find value `title` in this scope //~^ NOTE not found in this scope } |
