diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/crashes/127332.rs | 9 | ||||
| -rw-r--r-- | tests/ui/typeck/ice-with-expr-not-struct-127332.rs | 15 | ||||
| -rw-r--r-- | tests/ui/typeck/ice-with-expr-not-struct-127332.stderr | 9 |
3 files changed, 24 insertions, 9 deletions
diff --git a/tests/crashes/127332.rs b/tests/crashes/127332.rs deleted file mode 100644 index 5c14af01cec..00000000000 --- a/tests/crashes/127332.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ known-bug: rust-lang/rust #127332 - -async fn fun() { - enum Foo { - A { x: u32 }, - } - let orig = Foo::A { x: 5 }; - Foo::A { x: 6, ..orig }; -} diff --git a/tests/ui/typeck/ice-with-expr-not-struct-127332.rs b/tests/ui/typeck/ice-with-expr-not-struct-127332.rs new file mode 100644 index 00000000000..f3ea360e7e9 --- /dev/null +++ b/tests/ui/typeck/ice-with-expr-not-struct-127332.rs @@ -0,0 +1,15 @@ +// Regression test for ICE #127332 + +// Tests that we do not ICE when a with expr is +// not a struct but something else like an enum + +fn main() { + let x = || { + enum Foo { + A { x: u32 }, + } + let orig = Foo::A { x: 5 }; + Foo::A { x: 6, ..orig }; + //~^ ERROR functional record update syntax requires a struct + }; +} diff --git a/tests/ui/typeck/ice-with-expr-not-struct-127332.stderr b/tests/ui/typeck/ice-with-expr-not-struct-127332.stderr new file mode 100644 index 00000000000..446f49e8639 --- /dev/null +++ b/tests/ui/typeck/ice-with-expr-not-struct-127332.stderr @@ -0,0 +1,9 @@ +error[E0436]: functional record update syntax requires a struct + --> $DIR/ice-with-expr-not-struct-127332.rs:12:26 + | +LL | Foo::A { x: 6, ..orig }; + | ^^^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0436`. |
