From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/impossible_range.fixed | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/ui/impossible_range.fixed (limited to 'src/test/ui/impossible_range.fixed') diff --git a/src/test/ui/impossible_range.fixed b/src/test/ui/impossible_range.fixed new file mode 100644 index 000000000..3fd950e0d --- /dev/null +++ b/src/test/ui/impossible_range.fixed @@ -0,0 +1,20 @@ +// run-rustfix +// Make sure that invalid ranges generate an error during parsing, not an ICE + +#![allow(path_statements)] + +pub fn main() { + ..; + 0..; + ..1; + 0..1; + ..; //~ERROR inclusive range with no end + //~^HELP use `..` instead +} + +fn _foo1() { + ..=1; + 0..=1; + 0..; //~ERROR inclusive range with no end + //~^HELP use `..` instead +} -- cgit v1.2.3