From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/parser/struct-literal-in-for.stderr | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/ui/parser/struct-literal-in-for.stderr (limited to 'tests/ui/parser/struct-literal-in-for.stderr') diff --git a/tests/ui/parser/struct-literal-in-for.stderr b/tests/ui/parser/struct-literal-in-for.stderr new file mode 100644 index 000000000..1c91eba68 --- /dev/null +++ b/tests/ui/parser/struct-literal-in-for.stderr @@ -0,0 +1,31 @@ +error: struct literals are not allowed here + --> $DIR/struct-literal-in-for.rs:12:14 + | +LL | for x in Foo { + | ______________^ +LL | | x: 3 +LL | | }.hi() { + | |_____^ + | +help: surround the struct literal with parentheses + | +LL ~ for x in (Foo { +LL | x: 3 +LL ~ }).hi() { + | + +error[E0277]: `bool` is not an iterator + --> $DIR/struct-literal-in-for.rs:12:14 + | +LL | for x in Foo { + | ______________^ +LL | | x: 3 +LL | | }.hi() { + | |__________^ `bool` is not an iterator + | + = help: the trait `Iterator` is not implemented for `bool` + = note: required for `bool` to implement `IntoIterator` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. -- cgit v1.2.3