summaryrefslogtreecommitdiffstats
path: root/tests/ui/iterators/integral.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/iterators/integral.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/iterators/integral.rs')
-rw-r--r--tests/ui/iterators/integral.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/iterators/integral.rs b/tests/ui/iterators/integral.rs
new file mode 100644
index 000000000..7537c7904
--- /dev/null
+++ b/tests/ui/iterators/integral.rs
@@ -0,0 +1,26 @@
+fn main() {
+ for _ in 42 {}
+ //~^ ERROR `{integer}` is not an iterator
+ for _ in 42 as u8 {}
+ //~^ ERROR `u8` is not an iterator
+ for _ in 42 as i8 {}
+ //~^ ERROR `i8` is not an iterator
+ for _ in 42 as u16 {}
+ //~^ ERROR `u16` is not an iterator
+ for _ in 42 as i16 {}
+ //~^ ERROR `i16` is not an iterator
+ for _ in 42 as u32 {}
+ //~^ ERROR `u32` is not an iterator
+ for _ in 42 as i32 {}
+ //~^ ERROR `i32` is not an iterator
+ for _ in 42 as u64 {}
+ //~^ ERROR `u64` is not an iterator
+ for _ in 42 as i64 {}
+ //~^ ERROR `i64` is not an iterator
+ for _ in 42 as usize {}
+ //~^ ERROR `usize` is not an iterator
+ for _ in 42 as isize {}
+ //~^ ERROR `isize` is not an iterator
+ for _ in 42.0 {}
+ //~^ ERROR `{float}` is not an iterator
+}