about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-08-31 03:35:33 +0000
committerbors <bors@rust-lang.org>2018-08-31 03:35:33 +0000
commit1114ab684fbad001c4e580326d8eb4d8c4e917d3 (patch)
treeca7e8212e95a1a99912f17d9df0c0313f75b8a0b /src/test
parent8adc69a5a873dd7e840b7d002ae48a4c638ef7ee (diff)
parent6b1fffae20ce2c542fb6ee860b3ecfadd055abd2 (diff)
downloadrust-1114ab684fbad001c4e580326d8eb4d8c4e917d3.tar.gz
rust-1114ab684fbad001c4e580326d8eb4d8c4e917d3.zip
Auto merge of #53832 - pietroalbini:rollup, r=pietroalbini
Rollup of 20 pull requests

Successful merges:

 - #51760 (Add another PartialEq example)
 - #53113 (Add example for Cow)
 - #53129 (remove `let x = baz` which was obscuring the real error)
 - #53389 (document effect of join on memory ordering)
 - #53472 (Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.)
 - #53476 (Add partialeq implementation for TryFromIntError type)
 - #53513 (Force-inline `shallow_resolve` at its hottest call site.)
 - #53655 (set applicability)
 - #53702 (Fix stabilisation version for macro_vis_matcher.)
 - #53727 (Do not suggest dereferencing in macro)
 - #53732 (save-analysis: Differentiate foreign functions and statics.)
 - #53740 (add llvm-readobj to llvm-tools-preview)
 - #53743 (fix a typo: taget_env -> target_env)
 - #53747 (Rustdoc fixes)
 - #53753 (expand keep-stage --help text)
 - #53756 (Fix typo in comment)
 - #53768 (move file-extension based .gitignore down to src/)
 - #53785 (Fix a comment in src/libcore/slice/mod.rs)
 - #53786 (Replace usages of 'bad_style' with 'nonstandard_style'.)
 - #53806 (Fix UI issues on Implementations on Foreign types)

Failed merges:

r? @ghost
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/simd-target-feature-mixup.rs2
-rw-r--r--src/test/run-pass/try-from-int-error-partial-eq.rs21
-rw-r--r--src/test/rustdoc/intra-links.rs2
-rw-r--r--src/test/ui/deref-suggestion.rs14
-rw-r--r--src/test/ui/deref-suggestion.stderr26
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr15
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs1
-rw-r--r--src/test/ui/lint/lint-group-style.rs8
-rw-r--r--src/test/ui/lint/lint-group-style.stderr30
-rw-r--r--src/test/ui/lint/lint-shorthand-field.rs2
-rw-r--r--src/test/ui/lint/outer-forbid.rs4
-rw-r--r--src/test/ui/lint/outer-forbid.stderr6
12 files changed, 84 insertions, 47 deletions
diff --git a/src/test/run-pass/simd-target-feature-mixup.rs b/src/test/run-pass/simd-target-feature-mixup.rs
index 139da046452..a7fd9f299c0 100644
--- a/src/test/run-pass/simd-target-feature-mixup.rs
+++ b/src/test/run-pass/simd-target-feature-mixup.rs
@@ -52,7 +52,7 @@ fn is_sigill(status: ExitStatus) -> bool {
 }
 
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-#[allow(bad_style)]
+#[allow(nonstandard_style)]
 mod test {
     // An SSE type
     #[repr(simd)]
diff --git a/src/test/run-pass/try-from-int-error-partial-eq.rs b/src/test/run-pass/try-from-int-error-partial-eq.rs
new file mode 100644
index 00000000000..1122f5a7559
--- /dev/null
+++ b/src/test/run-pass/try-from-int-error-partial-eq.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.
+
+#![feature(try_from)]
+#![allow(unused_must_use)]
+
+use std::convert::TryFrom;
+use std::num::TryFromIntError;
+
+fn main() {
+    let x: u32 = 125;
+    let y: Result<u8, TryFromIntError> = u8::try_from(x);
+    y == Ok(125);
+}
diff --git a/src/test/rustdoc/intra-links.rs b/src/test/rustdoc/intra-links.rs
index c822d0f8b21..81b81a9a141 100644
--- a/src/test/rustdoc/intra-links.rs
+++ b/src/test/rustdoc/intra-links.rs
@@ -75,7 +75,7 @@ pub static THIS_STATIC: usize = 5usize;
 
 pub trait SoAmbiguous {}
 
-#[allow(bad_style)]
+#[allow(nonstandard_style)]
 pub fn SoAmbiguous() {}
 
 
diff --git a/src/test/ui/deref-suggestion.rs b/src/test/ui/deref-suggestion.rs
index 04ba4ab905e..1776a71a6bb 100644
--- a/src/test/ui/deref-suggestion.rs
+++ b/src/test/ui/deref-suggestion.rs
@@ -15,20 +15,26 @@ macro_rules! borrow {
 fn foo(_: String) {}
 
 fn foo2(s: &String) {
-    foo(s); //~ ERROR mismatched types
+    foo(s);
+    //~^ ERROR mismatched types
 }
 
 fn foo3(_: u32) {}
 fn foo4(u: &u32) {
-    foo3(u); //~ ERROR mismatched types
+    foo3(u);
+    //~^ ERROR mismatched types
 }
 
 fn main() {
     let s = String::new();
     let r_s = &s;
     foo2(r_s);
-    foo(&"aaa".to_owned()); //~ ERROR mismatched types
-    foo(&mut "aaa".to_owned()); //~ ERROR mismatched types
+    foo(&"aaa".to_owned());
+    //~^ ERROR mismatched types
+    foo(&mut "aaa".to_owned());
+    //~^ ERROR mismatched types
     foo3(borrow!(0));
     foo4(&0);
+    assert_eq!(3i32, &3i32);
+    //~^ ERROR mismatched types
 }
diff --git a/src/test/ui/deref-suggestion.stderr b/src/test/ui/deref-suggestion.stderr
index a5f87928924..9811c5969da 100644
--- a/src/test/ui/deref-suggestion.stderr
+++ b/src/test/ui/deref-suggestion.stderr
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:18:9
    |
-LL |     foo(s); //~ ERROR mismatched types
+LL |     foo(s);
    |         ^
    |         |
    |         expected struct `std::string::String`, found reference
@@ -11,9 +11,9 @@ LL |     foo(s); //~ ERROR mismatched types
               found type `&std::string::String`
 
 error[E0308]: mismatched types
-  --> $DIR/deref-suggestion.rs:23:10
+  --> $DIR/deref-suggestion.rs:24:10
    |
-LL |     foo3(u); //~ ERROR mismatched types
+LL |     foo3(u);
    |          ^
    |          |
    |          expected u32, found &u32
@@ -23,9 +23,9 @@ LL |     foo3(u); //~ ERROR mismatched types
               found type `&u32`
 
 error[E0308]: mismatched types
-  --> $DIR/deref-suggestion.rs:30:9
+  --> $DIR/deref-suggestion.rs:32:9
    |
-LL |     foo(&"aaa".to_owned()); //~ ERROR mismatched types
+LL |     foo(&"aaa".to_owned());
    |         ^^^^^^^^^^^^^^^^^
    |         |
    |         expected struct `std::string::String`, found reference
@@ -35,9 +35,9 @@ LL |     foo(&"aaa".to_owned()); //~ ERROR mismatched types
               found type `&std::string::String`
 
 error[E0308]: mismatched types
-  --> $DIR/deref-suggestion.rs:31:9
+  --> $DIR/deref-suggestion.rs:34:9
    |
-LL |     foo(&mut "aaa".to_owned()); //~ ERROR mismatched types
+LL |     foo(&mut "aaa".to_owned());
    |         ^^^^^^^^^^^^^^^^^^^^^
    |         |
    |         expected struct `std::string::String`, found mutable reference
@@ -58,6 +58,16 @@ LL |     foo3(borrow!(0));
    = note: expected type `u32`
               found type `&{integer}`
 
-error: aborting due to 5 previous errors
+error[E0308]: mismatched types
+  --> $DIR/deref-suggestion.rs:38:5
+   |
+LL |     assert_eq!(3i32, &3i32);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found &i32
+   |
+   = note: expected type `i32`
+              found type `&i32`
+   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+error: aborting due to 6 previous errors
 
 For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr
index c5f3510fa0e..b4cbed03153 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR explicit lifetime required
    |            ^
 
-error[E0282]: type annotations needed
-  --> $DIR/ex2a-push-one-existing-name-early-bound.rs:20:9
+error[E0621]: explicit lifetime required in the type of `y`
+  --> $DIR/ex2a-push-one-existing-name-early-bound.rs:17:5
    |
-LL | let x = baz;
-   |     -   ^^^ cannot infer type for `T`
-   |     |
-   |     consider giving `x` a type
+LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
+   |                                          -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
+...
+LL |     x.push(y); //~ ERROR explicit lifetime required
+   |     ^^^^^^^^^ lifetime `'a` required
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0282`.
+For more information about this error, try `rustc --explain E0621`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs
index 18a720f345d..cad0a3c6ac1 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs
+++ b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs
@@ -17,5 +17,4 @@ fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
     x.push(y); //~ ERROR explicit lifetime required
 }
 fn main() {
-let x = baz;
 }
diff --git a/src/test/ui/lint/lint-group-style.rs b/src/test/ui/lint/lint-group-style.rs
index 9f33f57f48a..55d6168e6e0 100644
--- a/src/test/ui/lint/lint-group-style.rs
+++ b/src/test/ui/lint/lint-group-style.rs
@@ -8,16 +8,16 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![deny(bad_style)]
+#![deny(nonstandard_style)]
 #![allow(dead_code)]
 
 fn CamelCase() {} //~ ERROR should have a snake
 
-#[allow(bad_style)]
+#[allow(nonstandard_style)]
 mod test {
     fn CamelCase() {}
 
-    #[forbid(bad_style)]
+    #[forbid(nonstandard_style)]
     mod bad {
         fn CamelCase() {} //~ ERROR should have a snake
 
@@ -25,7 +25,7 @@ mod test {
     }
 
     mod warn {
-        #![warn(bad_style)]
+        #![warn(nonstandard_style)]
 
         fn CamelCase() {} //~ WARN should have a snake
 
diff --git a/src/test/ui/lint/lint-group-style.stderr b/src/test/ui/lint/lint-group-style.stderr
index c1b15160bc5..6b91ce5b93c 100644
--- a/src/test/ui/lint/lint-group-style.stderr
+++ b/src/test/ui/lint/lint-group-style.stderr
@@ -7,9 +7,9 @@ LL | fn CamelCase() {} //~ ERROR should have a snake
 note: lint level defined here
   --> $DIR/lint-group-style.rs:11:9
    |
-LL | #![deny(bad_style)]
-   |         ^^^^^^^^^
-   = note: #[deny(non_snake_case)] implied by #[deny(bad_style)]
+LL | #![deny(nonstandard_style)]
+   |         ^^^^^^^^^^^^^^^^^
+   = note: #[deny(non_snake_case)] implied by #[deny(nonstandard_style)]
 
 error: function `CamelCase` should have a snake case name such as `camel_case`
   --> $DIR/lint-group-style.rs:22:9
@@ -20,9 +20,9 @@ LL |         fn CamelCase() {} //~ ERROR should have a snake
 note: lint level defined here
   --> $DIR/lint-group-style.rs:20:14
    |
-LL |     #[forbid(bad_style)]
-   |              ^^^^^^^^^
-   = note: #[forbid(non_snake_case)] implied by #[forbid(bad_style)]
+LL |     #[forbid(nonstandard_style)]
+   |              ^^^^^^^^^^^^^^^^^
+   = note: #[forbid(non_snake_case)] implied by #[forbid(nonstandard_style)]
 
 error: static variable `bad` should have an upper case name such as `BAD`
   --> $DIR/lint-group-style.rs:24:9
@@ -33,9 +33,9 @@ LL |         static bad: isize = 1; //~ ERROR should have an upper
 note: lint level defined here
   --> $DIR/lint-group-style.rs:20:14
    |
-LL |     #[forbid(bad_style)]
-   |              ^^^^^^^^^
-   = note: #[forbid(non_upper_case_globals)] implied by #[forbid(bad_style)]
+LL |     #[forbid(nonstandard_style)]
+   |              ^^^^^^^^^^^^^^^^^
+   = note: #[forbid(non_upper_case_globals)] implied by #[forbid(nonstandard_style)]
 
 warning: function `CamelCase` should have a snake case name such as `camel_case`
   --> $DIR/lint-group-style.rs:30:9
@@ -46,9 +46,9 @@ LL |         fn CamelCase() {} //~ WARN should have a snake
 note: lint level defined here
   --> $DIR/lint-group-style.rs:28:17
    |
-LL |         #![warn(bad_style)]
-   |                 ^^^^^^^^^
-   = note: #[warn(non_snake_case)] implied by #[warn(bad_style)]
+LL |         #![warn(nonstandard_style)]
+   |                 ^^^^^^^^^^^^^^^^^
+   = note: #[warn(non_snake_case)] implied by #[warn(nonstandard_style)]
 
 warning: type `snake_case` should have a camel case name such as `SnakeCase`
   --> $DIR/lint-group-style.rs:32:9
@@ -59,9 +59,9 @@ LL |         struct snake_case; //~ WARN should have a camel
 note: lint level defined here
   --> $DIR/lint-group-style.rs:28:17
    |
-LL |         #![warn(bad_style)]
-   |                 ^^^^^^^^^
-   = note: #[warn(non_camel_case_types)] implied by #[warn(bad_style)]
+LL |         #![warn(nonstandard_style)]
+   |                 ^^^^^^^^^^^^^^^^^
+   = note: #[warn(non_camel_case_types)] implied by #[warn(nonstandard_style)]
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/lint/lint-shorthand-field.rs b/src/test/ui/lint/lint-shorthand-field.rs
index 97a976a493f..1e37ac0dc58 100644
--- a/src/test/ui/lint/lint-shorthand-field.rs
+++ b/src/test/ui/lint/lint-shorthand-field.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(bad_style, unused_variables)]
+#![allow(nonstandard_style, unused_variables)]
 #![deny(non_shorthand_field_patterns)]
 
 struct Foo {
diff --git a/src/test/ui/lint/outer-forbid.rs b/src/test/ui/lint/outer-forbid.rs
index d72f307b461..23e98cc22fc 100644
--- a/src/test/ui/lint/outer-forbid.rs
+++ b/src/test/ui/lint/outer-forbid.rs
@@ -11,7 +11,7 @@
 // Forbidding a group (here, `unused`) overrules subsequent allowance of both
 // the group, and an individual lint in the group (here, `unused_variables`);
 // and, forbidding an individual lint (here, `non_snake_case`) overrules
-// subsequent allowance of a lint group containing it (here, `bad_style`). See
+// subsequent allowance of a lint group containing it (here, `nonstandard_style`). See
 // Issue #42873.
 
 #![forbid(unused, non_snake_case)]
@@ -22,7 +22,7 @@ fn foo() {}
 #[allow(unused)] //~ ERROR overruled
 fn bar() {}
 
-#[allow(bad_style)] //~ ERROR overruled
+#[allow(nonstandard_style)] //~ ERROR overruled
 fn main() {
     println!("hello forbidden world")
 }
diff --git a/src/test/ui/lint/outer-forbid.stderr b/src/test/ui/lint/outer-forbid.stderr
index e49dcd4a2d1..c011b49eaee 100644
--- a/src/test/ui/lint/outer-forbid.stderr
+++ b/src/test/ui/lint/outer-forbid.stderr
@@ -16,14 +16,14 @@ LL | #![forbid(unused, non_snake_case)]
 LL | #[allow(unused)] //~ ERROR overruled
    |         ^^^^^^ overruled by previous forbid
 
-error[E0453]: allow(bad_style) overruled by outer forbid(non_snake_case)
+error[E0453]: allow(nonstandard_style) overruled by outer forbid(non_snake_case)
   --> $DIR/outer-forbid.rs:25:9
    |
 LL | #![forbid(unused, non_snake_case)]
    |                   -------------- `forbid` level set here
 ...
-LL | #[allow(bad_style)] //~ ERROR overruled
-   |         ^^^^^^^^^ overruled by previous forbid
+LL | #[allow(nonstandard_style)] //~ ERROR overruled
+   |         ^^^^^^^^^^^^^^^^^ overruled by previous forbid
 
 error: aborting due to 3 previous errors