about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-01-23 16:13:18 +0000
committerbors <bors@rust-lang.org>2018-01-23 16:13:18 +0000
commit4e3901d35f6a8652f67111e7272263c9e62ab3e1 (patch)
tree1cb65ccb8e82d573d3c0d366da563cbe81b8cd1e /src/test
parent3a39b2aa5a68dd07aacab2106db3927f666a485a (diff)
parent9707b3107612599f8f96facdcd8959669b630e02 (diff)
downloadrust-4e3901d35f6a8652f67111e7272263c9e62ab3e1.tar.gz
rust-4e3901d35f6a8652f67111e7272263c9e62ab3e1.zip
Auto merge of #47678 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests

- Successful merges: #47423, #47425, #47440, #47541, #47549, #47554, #47558, #47610, #47635, #47655, #47661, #47662, #47667, #47672
- Failed merges:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-37665.rs2
-rw-r--r--src/test/compile-fail/mir-unpretty.rs2
-rw-r--r--src/test/compile-fail/nll/constant-thread-locals-issue-47053.rs21
-rw-r--r--src/test/run-make/hir-tree/Makefile3
-rw-r--r--src/test/run-make/pretty-print-path-suffix/Makefile6
-rw-r--r--src/test/run-pass-fulldeps/proc-macro/auxiliary/empty-crate.rs14
-rw-r--r--src/test/run-pass-fulldeps/proc-macro/empty-crate.rs17
-rw-r--r--src/test/run-pass/dynamic-drop.rs3
-rw-r--r--src/test/rustdoc-js/quoted.js23
-rw-r--r--src/test/rustdoc/auto-traits.rs23
-rw-r--r--src/test/rustdoc/auxiliary/auto-traits.rs13
-rw-r--r--src/test/ui/issue-29723.rs26
-rw-r--r--src/test/ui/issue-29723.stderr13
13 files changed, 159 insertions, 7 deletions
diff --git a/src/test/compile-fail/issue-37665.rs b/src/test/compile-fail/issue-37665.rs
index 98e62965235..81ed4375e77 100644
--- a/src/test/compile-fail/issue-37665.rs
+++ b/src/test/compile-fail/issue-37665.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z unstable-options --unpretty=mir
+// compile-flags: -Z unpretty=mir
 // ignore-cloudabi no std::path
 
 use std::path::MAIN_SEPARATOR;
diff --git a/src/test/compile-fail/mir-unpretty.rs b/src/test/compile-fail/mir-unpretty.rs
index 8950bef6a46..fa936502157 100644
--- a/src/test/compile-fail/mir-unpretty.rs
+++ b/src/test/compile-fail/mir-unpretty.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z unstable-options --unpretty=mir
+// compile-flags: -Z unpretty=mir
 
 fn main() {
     let x: () = 0; //~ ERROR: mismatched types
diff --git a/src/test/compile-fail/nll/constant-thread-locals-issue-47053.rs b/src/test/compile-fail/nll/constant-thread-locals-issue-47053.rs
new file mode 100644
index 00000000000..c7dc84c1a91
--- /dev/null
+++ b/src/test/compile-fail/nll/constant-thread-locals-issue-47053.rs
@@ -0,0 +1,21 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Regression test for issue #47053
+
+#![feature(nll)]
+#![feature(thread_local)]
+
+#[thread_local]
+static FOO: isize = 5;
+
+fn main() {
+    FOO = 6; //~ ERROR cannot assign to immutable item `FOO` [E0594]
+}
diff --git a/src/test/run-make/hir-tree/Makefile b/src/test/run-make/hir-tree/Makefile
index bedb2b7d6aa..2e100b269e1 100644
--- a/src/test/run-make/hir-tree/Makefile
+++ b/src/test/run-make/hir-tree/Makefile
@@ -4,6 +4,5 @@
 # the string constant we would expect to see.
 
 all:
-	$(RUSTC) -o $(TMPDIR)/input.hir -Z unstable-options \
-		--unpretty=hir-tree input.rs
+	$(RUSTC) -o $(TMPDIR)/input.hir -Z unpretty=hir-tree input.rs
 	$(CGREP) '"Hello, Rustaceans!\n"' < $(TMPDIR)/input.hir
diff --git a/src/test/run-make/pretty-print-path-suffix/Makefile b/src/test/run-make/pretty-print-path-suffix/Makefile
index d5300501179..899457fc748 100644
--- a/src/test/run-make/pretty-print-path-suffix/Makefile
+++ b/src/test/run-make/pretty-print-path-suffix/Makefile
@@ -1,9 +1,9 @@
 -include ../tools.mk
 
 all:
-	$(RUSTC) -o $(TMPDIR)/foo.out -Z unstable-options --unpretty hir=foo input.rs
-	$(RUSTC) -o $(TMPDIR)/nest_foo.out -Z unstable-options --unpretty hir=nest::foo input.rs
-	$(RUSTC) -o $(TMPDIR)/foo_method.out -Z unstable-options --unpretty hir=foo_method input.rs
+	$(RUSTC) -o $(TMPDIR)/foo.out -Z unpretty=hir=foo input.rs
+	$(RUSTC) -o $(TMPDIR)/nest_foo.out -Z unpretty=hir=nest::foo input.rs
+	$(RUSTC) -o $(TMPDIR)/foo_method.out -Z unpretty=hir=foo_method input.rs
 	diff -u $(TMPDIR)/foo.out foo.pp
 	diff -u $(TMPDIR)/nest_foo.out nest_foo.pp
 	diff -u $(TMPDIR)/foo_method.out foo_method.pp
diff --git a/src/test/run-pass-fulldeps/proc-macro/auxiliary/empty-crate.rs b/src/test/run-pass-fulldeps/proc-macro/auxiliary/empty-crate.rs
new file mode 100644
index 00000000000..b45d4bf41d6
--- /dev/null
+++ b/src/test/run-pass-fulldeps/proc-macro/auxiliary/empty-crate.rs
@@ -0,0 +1,14 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// no-prefer-dynamic
+
+#![crate_type = "proc-macro"]
+#![deny(unused_variables)]
diff --git a/src/test/run-pass-fulldeps/proc-macro/empty-crate.rs b/src/test/run-pass-fulldeps/proc-macro/empty-crate.rs
new file mode 100644
index 00000000000..38a2716aee7
--- /dev/null
+++ b/src/test/run-pass-fulldeps/proc-macro/empty-crate.rs
@@ -0,0 +1,17 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// aux-build:empty-crate.rs
+// ignore-stage1
+
+#[macro_use]
+extern crate empty_crate;
+
+fn main() {}
diff --git a/src/test/run-pass/dynamic-drop.rs b/src/test/run-pass/dynamic-drop.rs
index 09318e7256f..e2a51bbf14b 100644
--- a/src/test/run-pass/dynamic-drop.rs
+++ b/src/test/run-pass/dynamic-drop.rs
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// revisions:lexical nll
+#![cfg_attr(nll, feature(nll))]
+
 // ignore-wasm32-bare compiled with panic=abort by default
 
 #![feature(generators, generator_trait, untagged_unions, slice_patterns, advanced_slice_patterns)]
diff --git a/src/test/rustdoc-js/quoted.js b/src/test/rustdoc-js/quoted.js
new file mode 100644
index 00000000000..dcb85b5de04
--- /dev/null
+++ b/src/test/rustdoc-js/quoted.js
@@ -0,0 +1,23 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+const QUERY = '"error"';
+
+const EXPECTED = {
+    'others': [
+        { 'path': 'std', 'name': 'error' },
+        { 'path': 'std::fmt', 'name': 'Error' },
+        { 'path': 'std::io', 'name': 'Error' },
+    ],
+    'in_args': [],
+    'returned': [
+        { 'path': 'std::fmt::LowerExp', 'name': 'fmt' },
+    ],
+};
diff --git a/src/test/rustdoc/auto-traits.rs b/src/test/rustdoc/auto-traits.rs
new file mode 100644
index 00000000000..1753c0ebf73
--- /dev/null
+++ b/src/test/rustdoc/auto-traits.rs
@@ -0,0 +1,23 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// aux-build:auto-traits.rs
+
+#![feature(optin_builtin_traits)]
+
+#![crate_name = "foo"]
+
+extern crate auto_traits;
+
+// @has 'foo/trait.Foo.html' '//pre' 'pub unsafe auto trait Foo'
+pub unsafe auto trait Foo {}
+
+// @has 'foo/trait.Bar.html' '//pre' 'pub unsafe auto trait Bar'
+pub use auto_traits::Bar;
diff --git a/src/test/rustdoc/auxiliary/auto-traits.rs b/src/test/rustdoc/auxiliary/auto-traits.rs
new file mode 100644
index 00000000000..70299334b46
--- /dev/null
+++ b/src/test/rustdoc/auxiliary/auto-traits.rs
@@ -0,0 +1,13 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(optin_builtin_traits)]
+
+pub unsafe auto trait Bar {}
diff --git a/src/test/ui/issue-29723.rs b/src/test/ui/issue-29723.rs
new file mode 100644
index 00000000000..f31e965ae01
--- /dev/null
+++ b/src/test/ui/issue-29723.rs
@@ -0,0 +1,26 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(nll)]
+
+// test for https://github.com/rust-lang/rust/issues/29723
+
+fn main() {
+    let s = String::new();
+    let _s = match 0 {
+        0 if { drop(s); false } => String::from("oops"),
+        _ => {
+            // This should trigger an error,
+            // s could have been moved from.
+            s
+            //~^ ERROR use of moved value: `s`
+        }
+    };
+}
diff --git a/src/test/ui/issue-29723.stderr b/src/test/ui/issue-29723.stderr
new file mode 100644
index 00000000000..061c3d49323
--- /dev/null
+++ b/src/test/ui/issue-29723.stderr
@@ -0,0 +1,13 @@
+error[E0382]: use of moved value: `s`
+  --> $DIR/issue-29723.rs:22:13
+   |
+18 |         0 if { drop(s); false } => String::from("oops"),
+   |                     - value moved here
+...
+22 |             s
+   |             ^ value used here after move
+   |
+   = note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
+
+error: aborting due to previous error
+