about summary refs log tree commit diff
path: root/src/test/run-pass
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-03-29 12:32:24 +0100
committerGitHub <noreply@github.com>2019-03-29 12:32:24 +0100
commit647d09fced568c7275211e3d7e1a084d94757a2a (patch)
tree9b9971df0b3a00ef4936240612c6f4f153be5ac3 /src/test/run-pass
parent38af98ee5f3f438299cadbf0760274c66d9206d4 (diff)
parent362d2439bdd221b0efa4f0d28bb51bfde0ea9484 (diff)
downloadrust-647d09fced568c7275211e3d7e1a084d94757a2a.tar.gz
rust-647d09fced568c7275211e3d7e1a084d94757a2a.zip
Rollup merge of #59462 - taiki-e:no-core, r=petrochenkov
Fix error in Rust 2018 + no_core environment

Minimized reproduction: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5b9f6c3026ec9d856699fa6dbd4361f0

This is a fix for the error that occurred in #58702.

r? @Centril
Diffstat (limited to 'src/test/run-pass')
-rw-r--r--src/test/run-pass/no-core-2.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/run-pass/no-core-2.rs b/src/test/run-pass/no-core-2.rs
new file mode 100644
index 00000000000..e09f8f6b7a8
--- /dev/null
+++ b/src/test/run-pass/no-core-2.rs
@@ -0,0 +1,18 @@
+#![allow(dead_code, unused_imports)]
+#![feature(no_core)]
+#![no_core]
+// edition:2018
+
+extern crate std;
+extern crate core;
+use core::{prelude::v1::*, *};
+
+fn foo() {
+    for _ in &[()] {}
+}
+
+fn bar() -> Option<()> {
+    None?
+}
+
+fn main() {}