From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/impossible_range.fixed | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/ui/impossible_range.fixed (limited to 'tests/ui/impossible_range.fixed') diff --git a/tests/ui/impossible_range.fixed b/tests/ui/impossible_range.fixed new file mode 100644 index 000000000..3fd950e0d --- /dev/null +++ b/tests/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