about summary refs log tree commit diff
path: root/src/test/ui/impossible_range.fixed
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-07-07 00:56:44 +0000
committerbors <bors@rust-lang.org>2020-07-07 00:56:44 +0000
commit70f9d23b916f2db7da711aa4a0317a218997ba42 (patch)
tree583d0a11c2b82dc7ebc149ebbcdab4523dedbdfe /src/test/ui/impossible_range.fixed
parent8981dbbc36f1575b0a417b6849767bde29e7c6b4 (diff)
parent73f2069d529c9d945967dd8f1a3b71b6003c7f96 (diff)
Auto merge of #74117 - Manishearth:rollup-ds7z0kx, r=Manishearth
Rollup of 14 pull requests

Successful merges:

 - #70563 ([rustdoc] Page hash handling)
 - #73856 (Edit librustc_lexer top-level docs)
 - #73870 (typeck: adding type information to projection)
 - #73953 (Audit hidden/short code suggestions)
 - #73962 (libstd/net/tcp.rs: #![deny(unsafe_op_in_unsafe_fn)])
 - #73969 (mir: mark mir construction temporaries as internal)
 - #73974 (Move A|Rc::as_ptr from feature(weak_into_raw) to feature(rc_as_ptr))
 - #74067 (rustdoc: Restore underline text decoration on hover for FQN in header)
 - #74074 (Fix the return type of Windows' `OpenOptionsExt::security_qos_flags`.)
 - #74078 (Always resolve type@primitive as a primitive, not a module)
 - #74089 (Add rust-analyzer to the build manifest)
 - #74090 (Remove unused RUSTC_DEBUG_ASSERTIONS)
 - #74102 (Fix const prop ICE)
 - #74112 (Expand abbreviation in core::ffi description)

Failed merges:

r? @ghost
Diffstat (limited to 'src/test/ui/impossible_range.fixed')
-rw-r--r--src/test/ui/impossible_range.fixed20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/impossible_range.fixed b/src/test/ui/impossible_range.fixed
new file mode 100644
index 00000000000..3fd950e0dbf
--- /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
+}