about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorNicolas Koch <nioko1337@gmail.com>2018-05-15 15:26:11 +0200
committerNicolas Koch <nioko1337@gmail.com>2018-05-15 15:26:11 +0200
commitb4b71d5d5fd8bedecbacf08ffb45c8456700151b (patch)
tree2ada477250001a23bc2d5329ca572e15b7bf23d7 /src/test
parent834ef9f08ae3429a05dead80237bb4bd04769895 (diff)
parenteca0da59850d4a9eef17c0e6c3795397102d88a3 (diff)
downloadrust-b4b71d5d5fd8bedecbacf08ffb45c8456700151b.tar.gz
rust-b4b71d5d5fd8bedecbacf08ffb45c8456700151b.zip
Merge branch 'master' of https://github.com/nicokoch/rust
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail-fulldeps/proc-macro/auxiliary/issue_50493.rs32
-rw-r--r--src/test/compile-fail-fulldeps/proc-macro/issue-50493.rs27
-rw-r--r--src/test/compile-fail/coerce-to-bang.rs5
-rw-r--r--src/test/compile-fail/derives-span-PartialOrd-enum-struct-variant.rs4
-rw-r--r--src/test/compile-fail/derives-span-PartialOrd-enum.rs4
-rw-r--r--src/test/compile-fail/derives-span-PartialOrd-struct.rs4
-rw-r--r--src/test/compile-fail/derives-span-PartialOrd-tuple-struct.rs4
-rw-r--r--src/test/compile-fail/range_traits-1.rs14
-rw-r--r--src/test/run-pass/issue-50731.rs (renamed from src/test/ui/feature-gate-macro-lifetime-matcher.rs)12
-rw-r--r--src/test/run-pass/macro-lifetime-used-with-bound.rs2
-rw-r--r--src/test/run-pass/macro-lifetime-used-with-labels.rs1
-rw-r--r--src/test/run-pass/macro-lifetime-used-with-static.rs2
-rw-r--r--src/test/run-pass/macro-lifetime.rs2
-rw-r--r--src/test/rustdoc-js/deduplication.js21
-rw-r--r--src/test/ui/feature-gate-macro-lifetime-matcher.stderr11
-rw-r--r--src/test/ui/macros/nonterminal-matching.rs2
16 files changed, 87 insertions, 60 deletions
diff --git a/src/test/compile-fail-fulldeps/proc-macro/auxiliary/issue_50493.rs b/src/test/compile-fail-fulldeps/proc-macro/auxiliary/issue_50493.rs
new file mode 100644
index 00000000000..7d36517d970
--- /dev/null
+++ b/src/test/compile-fail-fulldeps/proc-macro/auxiliary/issue_50493.rs
@@ -0,0 +1,32 @@
+// Copyright 2016 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.
+
+// force-host
+// no-prefer-dynamic
+
+#![feature(proc_macro, proc_macro_lib)]
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+use proc_macro::TokenStream;
+
+#[proc_macro_derive(Derive)]
+pub fn derive(_: TokenStream) -> TokenStream {
+    let code = "
+        fn one(r: Restricted) {
+            r.field;
+        }
+        fn two(r: Restricted) {
+            r.field;
+        }
+    ";
+
+    code.parse().unwrap()
+}
diff --git a/src/test/compile-fail-fulldeps/proc-macro/issue-50493.rs b/src/test/compile-fail-fulldeps/proc-macro/issue-50493.rs
new file mode 100644
index 00000000000..51112f202c8
--- /dev/null
+++ b/src/test/compile-fail-fulldeps/proc-macro/issue-50493.rs
@@ -0,0 +1,27 @@
+// Copyright 2016 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:issue_50493.rs
+// ignore-stage1
+
+#![feature(proc_macro)]
+
+#[macro_use]
+extern crate issue_50493;
+
+#[derive(Derive)] //~ ERROR field `field` of struct `Restricted` is private
+struct Restricted {
+    pub(in restricted) field: usize, //~ visibilities can only be restricted to ancestor modules
+}
+
+mod restricted {}
+
+fn main() {}
+
diff --git a/src/test/compile-fail/coerce-to-bang.rs b/src/test/compile-fail/coerce-to-bang.rs
index 62ff09f4616..8b4e2c3c051 100644
--- a/src/test/compile-fail/coerce-to-bang.rs
+++ b/src/test/compile-fail/coerce-to-bang.rs
@@ -56,9 +56,8 @@ fn call_foo_f() {
 }
 
 fn array_a() {
-    // Accepted: return is coerced to `!` just fine, and then `22` can be
-    // because we already diverged.
-    let x: [!; 2] = [return, 22];
+    // Return is coerced to `!` just fine, but `22` cannot be.
+    let x: [!; 2] = [return, 22]; //~ ERROR mismatched types
 }
 
 fn array_b() {
diff --git a/src/test/compile-fail/derives-span-PartialOrd-enum-struct-variant.rs b/src/test/compile-fail/derives-span-PartialOrd-enum-struct-variant.rs
index dcf02f30830..a5df717e06b 100644
--- a/src/test/compile-fail/derives-span-PartialOrd-enum-struct-variant.rs
+++ b/src/test/compile-fail/derives-span-PartialOrd-enum-struct-variant.rs
@@ -17,10 +17,6 @@ struct Error;
 enum Enum {
    A {
      x: Error //~ ERROR
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
-//~^^^^ ERROR
    }
 }
 
diff --git a/src/test/compile-fail/derives-span-PartialOrd-enum.rs b/src/test/compile-fail/derives-span-PartialOrd-enum.rs
index 7eb44c7e19e..3411d2f3119 100644
--- a/src/test/compile-fail/derives-span-PartialOrd-enum.rs
+++ b/src/test/compile-fail/derives-span-PartialOrd-enum.rs
@@ -17,10 +17,6 @@ struct Error;
 enum Enum {
    A(
      Error //~ ERROR
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
-//~^^^^ ERROR
      )
 }
 
diff --git a/src/test/compile-fail/derives-span-PartialOrd-struct.rs b/src/test/compile-fail/derives-span-PartialOrd-struct.rs
index 36dae0124ce..1feadc2fd83 100644
--- a/src/test/compile-fail/derives-span-PartialOrd-struct.rs
+++ b/src/test/compile-fail/derives-span-PartialOrd-struct.rs
@@ -16,10 +16,6 @@ struct Error;
 #[derive(PartialOrd,PartialEq)]
 struct Struct {
     x: Error //~ ERROR
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
-//~^^^^ ERROR
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/derives-span-PartialOrd-tuple-struct.rs b/src/test/compile-fail/derives-span-PartialOrd-tuple-struct.rs
index fd2df096754..9db0fed2d9e 100644
--- a/src/test/compile-fail/derives-span-PartialOrd-tuple-struct.rs
+++ b/src/test/compile-fail/derives-span-PartialOrd-tuple-struct.rs
@@ -16,10 +16,6 @@ struct Error;
 #[derive(PartialOrd,PartialEq)]
 struct Struct(
     Error //~ ERROR
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
-//~^^^^ ERROR
 );
 
 fn main() {}
diff --git a/src/test/compile-fail/range_traits-1.rs b/src/test/compile-fail/range_traits-1.rs
index df766e361d5..32f9b83b6e2 100644
--- a/src/test/compile-fail/range_traits-1.rs
+++ b/src/test/compile-fail/range_traits-1.rs
@@ -15,35 +15,21 @@ struct AllTheRanges {
     a: Range<usize>,
     //~^ ERROR PartialOrd
     //~^^ ERROR Ord
-    //~^^^ ERROR binary operation `<` cannot be applied to type
-    //~^^^^ ERROR binary operation `>` cannot be applied to type
     b: RangeTo<usize>,
     //~^ ERROR PartialOrd
     //~^^ ERROR Ord
-    //~^^^ ERROR binary operation `<` cannot be applied to type
-    //~^^^^ ERROR binary operation `>` cannot be applied to type
     c: RangeFrom<usize>,
     //~^ ERROR PartialOrd
     //~^^ ERROR Ord
-    //~^^^ ERROR binary operation `<` cannot be applied to type
-    //~^^^^ ERROR binary operation `>` cannot be applied to type
     d: RangeFull,
     //~^ ERROR PartialOrd
     //~^^ ERROR Ord
-    //~^^^ ERROR binary operation `<` cannot be applied to type
-    //~^^^^ ERROR binary operation `>` cannot be applied to type
     e: RangeInclusive<usize>,
     //~^ ERROR PartialOrd
     //~^^ ERROR Ord
-    //~^^^ ERROR binary operation `<` cannot be applied to type
-    //~^^^^ ERROR binary operation `>` cannot be applied to type
     f: RangeToInclusive<usize>,
     //~^ ERROR PartialOrd
     //~^^ ERROR Ord
-    //~^^^ ERROR binary operation `<` cannot be applied to type
-    //~^^^^ ERROR binary operation `>` cannot be applied to type
-    //~^^^^^ ERROR binary operation `<=` cannot be applied to type
-    //~^^^^^^ ERROR binary operation `>=` cannot be applied to type
 }
 
 fn main() {}
diff --git a/src/test/ui/feature-gate-macro-lifetime-matcher.rs b/src/test/run-pass/issue-50731.rs
index 0d107d283cd..06df2b989af 100644
--- a/src/test/ui/feature-gate-macro-lifetime-matcher.rs
+++ b/src/test/run-pass/issue-50731.rs
@@ -1,4 +1,4 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// 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.
 //
@@ -8,12 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// Test that the :lifetime macro fragment cannot be used when macro_lifetime_matcher
-// feature gate is not used.
-
-macro_rules! m { ($lt:lifetime) => {} }
-//~^ ERROR :lifetime fragment specifier is experimental and subject to change
-
+enum Void {}
+fn foo(_: Result<(Void, u32), (Void, String)>) {}
 fn main() {
-    m!('a);
+    let _: fn(_) = foo;
 }
diff --git a/src/test/run-pass/macro-lifetime-used-with-bound.rs b/src/test/run-pass/macro-lifetime-used-with-bound.rs
index b0c9280b6ce..b9e1fde6b1f 100644
--- a/src/test/run-pass/macro-lifetime-used-with-bound.rs
+++ b/src/test/run-pass/macro-lifetime-used-with-bound.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(macro_lifetime_matcher)]
-
 macro_rules! foo {
     ($l:lifetime, $l2:lifetime) => {
         fn f<$l: $l2, $l2>(arg: &$l str, arg2: &$l2 str) -> &$l str {
diff --git a/src/test/run-pass/macro-lifetime-used-with-labels.rs b/src/test/run-pass/macro-lifetime-used-with-labels.rs
index 8a2d76e17df..d003d7dcfb6 100644
--- a/src/test/run-pass/macro-lifetime-used-with-labels.rs
+++ b/src/test/run-pass/macro-lifetime-used-with-labels.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![allow(unreachable_code)]
-#![feature(macro_lifetime_matcher)]
 
 macro_rules! x {
     ($a:lifetime) => {
diff --git a/src/test/run-pass/macro-lifetime-used-with-static.rs b/src/test/run-pass/macro-lifetime-used-with-static.rs
index 468ee2e9436..5c1f8683e00 100644
--- a/src/test/run-pass/macro-lifetime-used-with-static.rs
+++ b/src/test/run-pass/macro-lifetime-used-with-static.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(macro_lifetime_matcher)]
-
 macro_rules! foo {
     ($l:lifetime) => {
         fn f(arg: &$l str) -> &$l str {
diff --git a/src/test/run-pass/macro-lifetime.rs b/src/test/run-pass/macro-lifetime.rs
index db521ca7f10..ff5798ff78d 100644
--- a/src/test/run-pass/macro-lifetime.rs
+++ b/src/test/run-pass/macro-lifetime.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(macro_lifetime_matcher)]
-
 macro_rules! foo {
     ($l:lifetime) => {
         fn f<$l>(arg: &$l str) -> &$l str {
diff --git a/src/test/rustdoc-js/deduplication.js b/src/test/rustdoc-js/deduplication.js
new file mode 100644
index 00000000000..0f29607d5c9
--- /dev/null
+++ b/src/test/rustdoc-js/deduplication.js
@@ -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.
+
+// ignore-order
+
+const QUERY = 'is_nan';
+
+const EXPECTED = {
+    'others': [
+        { 'path': 'std::f32', 'name': 'is_nan' },
+        { 'path': 'std::f64', 'name': 'is_nan' },
+        { 'path': 'std::option::Option', 'name': 'is_none' },
+    ],
+};
diff --git a/src/test/ui/feature-gate-macro-lifetime-matcher.stderr b/src/test/ui/feature-gate-macro-lifetime-matcher.stderr
deleted file mode 100644
index b7805f6f5fb..00000000000
--- a/src/test/ui/feature-gate-macro-lifetime-matcher.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0658]: :lifetime fragment specifier is experimental and subject to change (see issue #46895)
-  --> $DIR/feature-gate-macro-lifetime-matcher.rs:14:19
-   |
-LL | macro_rules! m { ($lt:lifetime) => {} }
-   |                   ^^^^^^^^^^^^
-   |
-   = help: add #![feature(macro_lifetime_matcher)] to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/macros/nonterminal-matching.rs b/src/test/ui/macros/nonterminal-matching.rs
index 4dcb8afa94e..54d280a63e7 100644
--- a/src/test/ui/macros/nonterminal-matching.rs
+++ b/src/test/ui/macros/nonterminal-matching.rs
@@ -11,7 +11,7 @@
 // Check that we are refusing to match on complex nonterminals for which tokens are
 // unavailable and we'd have to go through AST comparisons.
 
-#![feature(decl_macro, macro_lifetime_matcher)]
+#![feature(decl_macro)]
 
 macro simple_nonterminal($nt_ident: ident, $nt_lifetime: lifetime, $nt_tt: tt) {
     macro n(a $nt_ident b $nt_lifetime c $nt_tt d) {