diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-07 15:39:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-07 15:39:06 +0100 |
| commit | 3bcfa4c45940eb9d41493d9d64c0f1dbe7f14f08 (patch) | |
| tree | 8674f6b46d935cdcebb263920243734f7e0a0707 /src/test/ui/structs | |
| parent | 91b8f34ac2272e3c94a97bebc033abe8e2f17101 (diff) | |
| parent | 1c81540206b10a2b5b709540ba5ac138eaaa5261 (diff) | |
Rollup merge of #105267 - compiler-errors:issue-104613, r=oli-obk
Don't ICE in ExprUseVisitor on FRU for non-existent struct Fixes #104613 Fixes #105202
Diffstat (limited to 'src/test/ui/structs')
| -rw-r--r-- | src/test/ui/structs/unresolved-struct-with-fru.rs | 12 | ||||
| -rw-r--r-- | src/test/ui/structs/unresolved-struct-with-fru.stderr | 9 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/structs/unresolved-struct-with-fru.rs b/src/test/ui/structs/unresolved-struct-with-fru.rs new file mode 100644 index 00000000000..c9fdca45772 --- /dev/null +++ b/src/test/ui/structs/unresolved-struct-with-fru.rs @@ -0,0 +1,12 @@ +struct S { + a: u32, +} + +fn main() { + let s1 = S { a: 1 }; + + let _ = || { + let s2 = Oops { a: 2, ..s1 }; + //~^ ERROR cannot find struct, variant or union type `Oops` in this scope + }; +} diff --git a/src/test/ui/structs/unresolved-struct-with-fru.stderr b/src/test/ui/structs/unresolved-struct-with-fru.stderr new file mode 100644 index 00000000000..a5796a22225 --- /dev/null +++ b/src/test/ui/structs/unresolved-struct-with-fru.stderr @@ -0,0 +1,9 @@ +error[E0422]: cannot find struct, variant or union type `Oops` in this scope + --> $DIR/unresolved-struct-with-fru.rs:9:18 + | +LL | let s2 = Oops { a: 2, ..s1 }; + | ^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0422`. |
