about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-10-25 14:40:22 +0000
committerbors <bors@rust-lang.org>2018-10-25 14:40:22 +0000
commit8ec22e7ec7ed0da2add0763d239e77c5474f3d4a (patch)
tree138c3333919a3f7f83a5c7e57fde97ca5d11eee2 /src/test
parent3476ac0bee4042653ecb00207ceb9e02d2b647d0 (diff)
parentea5aad66b4fcfe34c5beb75004b79cc87bd7255c (diff)
downloadrust-8ec22e7ec7ed0da2add0763d239e77c5474f3d4a.tar.gz
rust-8ec22e7ec7ed0da2add0763d239e77c5474f3d4a.zip
Auto merge of #55347 - pietroalbini:rollup, r=pietroalbini
Rollup of 22 pull requests

Successful merges:

 - #53507 (Add doc for impl From for Waker)
 - #53931 (Gradually expanding libstd's keyword documentation)
 - #54965 (update tcp stream documentation)
 - #54977 (Accept `Option<Box<$t:ty>>` in macro argument)
 - #55138 (in which unused-parens suggestions heed what the user actually wrote)
 - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type)
 - #55200 (Documents `From` implementations for `Stdio`)
 - #55245 (submodules: update clippy from 5afdf8b7 to b1d03437)
 - #55247 (Clarified code example in char primitive doc)
 - #55251 (Fix a typo in the documentation of RangeInclusive)
 - #55253 (only issue "variant of the expected type" suggestion for enums)
 - #55254 (Correct trailing ellipsis in name_from_pat)
 - #55269 (fix typos in various places)
 - #55282 (Remove redundant clone)
 - #55285 (Do some copy editing on the release notes)
 - #55291 (Update stdsimd submodule)
 - #55296 (Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs)
 - #55306 (Regression test for #54478.)
 - #55328 (Fix doc for new copysign functions)
 - #55340 (Operands no longer appear in places)
 - #55345 (Remove is_null)
 - #55348 (Update RELEASES.md after destabilization of non_modrs_mods)

Failed merges:

r? @ghost
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/issues/issue-18804/main.rs2
-rw-r--r--src/test/run-pass/macros/issue-25274.rs16
-rw-r--r--src/test/rustdoc-ui/failed-doctest-output.rs1
-rw-r--r--src/test/rustdoc-ui/failed-doctest-output.stdout18
-rw-r--r--src/test/rustdoc/issue-54478-demo-allocator.rs42
-rw-r--r--src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr3
-rw-r--r--src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr3
-rw-r--r--src/test/ui/block-result/unexpected-return-on-unit.rs2
-rw-r--r--src/test/ui/conditional-compilation/cfg-attr-multi-false.rs2
-rw-r--r--src/test/ui/did_you_mean/issue-42764.rs16
-rw-r--r--src/test/ui/did_you_mean/issue-42764.stderr11
-rw-r--r--src/test/ui/foreign-fn-return-lifetime.fixed18
-rw-r--r--src/test/ui/foreign-fn-return-lifetime.rs6
-rw-r--r--src/test/ui/foreign-fn-return-lifetime.stderr7
-rw-r--r--src/test/ui/issues/issue-13497.stderr3
-rw-r--r--src/test/ui/issues/issue-26638.stderr6
-rw-r--r--src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr12
-rw-r--r--src/test/ui/lifetimes/lifetime-elision-return-type-trait.rs12
-rw-r--r--src/test/ui/lifetimes/lifetime-elision-return-type-trait.stderr11
-rw-r--r--src/test/ui/lint/suggestions.rs4
-rw-r--r--src/test/ui/lint/suggestions.stderr10
-rw-r--r--src/test/ui/nll/issue-21232-partial-init-and-use.rs2
-rw-r--r--src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs2
-rw-r--r--src/test/ui/resolve/token-error-correct-2.rs2
-rw-r--r--src/test/ui/resolve/token-error-correct-3.rs2
-rw-r--r--src/test/ui/resolve/token-error-correct.rs2
-rw-r--r--src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.rs12
-rw-r--r--src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.stderr12
-rw-r--r--src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.rs12
-rw-r--r--src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.stderr12
-rw-r--r--src/test/ui/rust-2018/edition-lint-infer-outlives.fixed2
-rw-r--r--src/test/ui/rust-2018/edition-lint-infer-outlives.rs2
-rw-r--r--src/test/ui/specialization/issue-52050.rs2
-rw-r--r--src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr3
34 files changed, 194 insertions, 78 deletions
diff --git a/src/test/run-pass/issues/issue-18804/main.rs b/src/test/run-pass/issues/issue-18804/main.rs
index a3a5337077c..2abcd4b7ba9 100644
--- a/src/test/run-pass/issues/issue-18804/main.rs
+++ b/src/test/run-pass/issues/issue-18804/main.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // run-pass
-// Test for issue #18804, #[linkage] does not propagate thorugh generic
+// Test for issue #18804, #[linkage] does not propagate through generic
 // functions. Failure results in a linker error.
 
 // ignore-asmjs no weak symbol support
diff --git a/src/test/run-pass/macros/issue-25274.rs b/src/test/run-pass/macros/issue-25274.rs
new file mode 100644
index 00000000000..e81b2c7a723
--- /dev/null
+++ b/src/test/run-pass/macros/issue-25274.rs
@@ -0,0 +1,16 @@
+macro_rules! test {
+    (
+        fn fun() -> Option<Box<$t:ty>>;
+    ) => {
+        fn fun(x: $t) -> Option<Box<$t>>
+        { Some(Box::new(x)) }
+    }
+}
+
+test! {
+    fn fun() -> Option<Box<i32>>;
+}
+
+fn main() {
+    println!("{}", fun(0).unwrap());
+}
diff --git a/src/test/rustdoc-ui/failed-doctest-output.rs b/src/test/rustdoc-ui/failed-doctest-output.rs
index 62e495288cb..932fe1c8eb0 100644
--- a/src/test/rustdoc-ui/failed-doctest-output.rs
+++ b/src/test/rustdoc-ui/failed-doctest-output.rs
@@ -15,6 +15,7 @@
 // compile-flags:--test
 // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
 // failure-status: 101
+// rustc-env:RUST_BACKTRACE=0
 
 // doctest fails at runtime
 /// ```
diff --git a/src/test/rustdoc-ui/failed-doctest-output.stdout b/src/test/rustdoc-ui/failed-doctest-output.stdout
index cf417f8d412..876f6c0a80b 100644
--- a/src/test/rustdoc-ui/failed-doctest-output.stdout
+++ b/src/test/rustdoc-ui/failed-doctest-output.stdout
@@ -1,22 +1,22 @@
 
 running 2 tests
-test $DIR/failed-doctest-output.rs - OtherStruct (line 26) ... FAILED
-test $DIR/failed-doctest-output.rs - SomeStruct (line 20) ... FAILED
+test $DIR/failed-doctest-output.rs - OtherStruct (line 27) ... FAILED
+test $DIR/failed-doctest-output.rs - SomeStruct (line 21) ... FAILED
 
 failures:
 
----- $DIR/failed-doctest-output.rs - OtherStruct (line 26) stdout ----
+---- $DIR/failed-doctest-output.rs - OtherStruct (line 27) stdout ----
 error[E0425]: cannot find value `no` in this scope
- --> $DIR/failed-doctest-output.rs:27:1
+ --> $DIR/failed-doctest-output.rs:28:1
   |
 3 | no
   | ^^ not found in this scope
 
-thread '$DIR/failed-doctest-output.rs - OtherStruct (line 26)' panicked at 'couldn't compile the test', librustdoc/test.rs:332:13
+thread '$DIR/failed-doctest-output.rs - OtherStruct (line 27)' panicked at 'couldn't compile the test', librustdoc/test.rs:332:13
 note: Run with `RUST_BACKTRACE=1` for a backtrace.
 
----- $DIR/failed-doctest-output.rs - SomeStruct (line 20) stdout ----
-thread '$DIR/failed-doctest-output.rs - SomeStruct (line 20)' panicked at 'test executable failed:
+---- $DIR/failed-doctest-output.rs - SomeStruct (line 21) stdout ----
+thread '$DIR/failed-doctest-output.rs - SomeStruct (line 21)' panicked at 'test executable failed:
 
 thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1
 note: Run with `RUST_BACKTRACE=1` for a backtrace.
@@ -25,8 +25,8 @@ note: Run with `RUST_BACKTRACE=1` for a backtrace.
 
 
 failures:
-    $DIR/failed-doctest-output.rs - OtherStruct (line 26)
-    $DIR/failed-doctest-output.rs - SomeStruct (line 20)
+    $DIR/failed-doctest-output.rs - OtherStruct (line 27)
+    $DIR/failed-doctest-output.rs - SomeStruct (line 21)
 
 test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out
 
diff --git a/src/test/rustdoc/issue-54478-demo-allocator.rs b/src/test/rustdoc/issue-54478-demo-allocator.rs
new file mode 100644
index 00000000000..4811f363bc9
--- /dev/null
+++ b/src/test/rustdoc/issue-54478-demo-allocator.rs
@@ -0,0 +1,42 @@
+// Issue #54478: regression test showing that we can demonstrate
+// `#[global_allocator]` in code blocks built by `rustdoc`.
+//
+// ## Background
+//
+// Changes in lang-item visibility injected failures that were only
+// exposed when compiling with `-C prefer-dynamic`. But `rustdoc` used
+// `-C prefer-dynamic` (and had done so for years, for reasons we did
+// not document at that time).
+//
+// Rather than try to revise the visbility semanics, we instead
+// decided to change `rustdoc` to behave more like the compiler's
+// default setting, by leaving off `-C prefer-dynamic`.
+
+// compile-flags:--test
+
+//! This is a doc comment
+//!
+//! ```rust
+//! use std::alloc::*;
+//!
+//! #[global_allocator]
+//! static ALLOC: A = A;
+//!
+//! static mut HIT: bool = false;
+//!
+//! struct A;
+//!
+//! unsafe impl GlobalAlloc for A {
+//!     unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
+//!         HIT = true;
+//!         System.alloc(layout)
+//!     }
+//!     unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
+//!         System.dealloc(ptr, layout);
+//!     }
+//! }
+//!
+//! fn main() {
+//!     assert!(unsafe { HIT });
+//! }
+//! ```
diff --git a/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr b/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr
index 0a12aa76a78..6b9d4ebb298 100644
--- a/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr
+++ b/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr
@@ -2,10 +2,9 @@ error[E0106]: missing lifetime specifier
   --> $DIR/bound-lifetime-in-binding-only.rs:62:23
    |
 LL | fn elision<T: Fn() -> &i32>() {
-   |                       ^ expected lifetime parameter
+   |                       ^ help: consider giving it a 'static lifetime: `&'static`
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
-   = help: consider giving it a 'static lifetime
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr b/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr
index 8fefdfd4d19..7906f0a30e4 100644
--- a/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr
+++ b/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr
@@ -2,10 +2,9 @@ error[E0106]: missing lifetime specifier
   --> $DIR/bound-lifetime-in-return-only.rs:44:23
    |
 LL | fn elision(_: fn() -> &i32) {
-   |                       ^ expected lifetime parameter
+   |                       ^ help: consider giving it a 'static lifetime: `&'static`
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
-   = help: consider giving it a 'static lifetime
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/block-result/unexpected-return-on-unit.rs b/src/test/ui/block-result/unexpected-return-on-unit.rs
index 3cf76365c77..b116888d63c 100644
--- a/src/test/ui/block-result/unexpected-return-on-unit.rs
+++ b/src/test/ui/block-result/unexpected-return-on-unit.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// Test that we do some basic error correcton in the tokeniser (and don't spew
+// Test that we do some basic error correction in the tokeniser (and don't spew
 // too many bogus errors).
 
 fn foo() -> usize {
diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-false.rs b/src/test/ui/conditional-compilation/cfg-attr-multi-false.rs
index 84bd33fc0e7..ec4ee80b498 100644
--- a/src/test/ui/conditional-compilation/cfg-attr-multi-false.rs
+++ b/src/test/ui/conditional-compilation/cfg-attr-multi-false.rs
@@ -1,5 +1,5 @@
 // Test that cfg_attr doesn't emit any attributes when the
-// configuation variable is false. This mirrors `cfg-attr-multi-true.rs`
+// configuration variable is false. This mirrors `cfg-attr-multi-true.rs`
 
 // compile-pass
 
diff --git a/src/test/ui/did_you_mean/issue-42764.rs b/src/test/ui/did_you_mean/issue-42764.rs
index ff4bb428d5f..1c79499ba59 100644
--- a/src/test/ui/did_you_mean/issue-42764.rs
+++ b/src/test/ui/did_you_mean/issue-42764.rs
@@ -20,4 +20,20 @@ fn main() {
     let n: usize = 42;
     this_function_expects_a_double_option(n);
     //~^ ERROR mismatched types
+    //~| HELP try using a variant of the expected type
+}
+
+
+// But don't issue the "try using a variant" help if the one-"variant" ADT is
+// actually a one-field struct.
+
+struct Payload;
+
+struct Wrapper { payload: Payload }
+
+struct Context { wrapper: Wrapper }
+
+fn overton() {
+    let _c = Context { wrapper: Payload{} };
+    //~^ ERROR mismatched types
 }
diff --git a/src/test/ui/did_you_mean/issue-42764.stderr b/src/test/ui/did_you_mean/issue-42764.stderr
index f1da920872d..e256a436aff 100644
--- a/src/test/ui/did_you_mean/issue-42764.stderr
+++ b/src/test/ui/did_you_mean/issue-42764.stderr
@@ -13,6 +13,15 @@ LL |     this_function_expects_a_double_option(DoubleOption::FirstSome(n));
 LL |     this_function_expects_a_double_option(DoubleOption::AlternativeSome(n));
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to previous error
+error[E0308]: mismatched types
+  --> $DIR/issue-42764.rs:37:33
+   |
+LL |     let _c = Context { wrapper: Payload{} };
+   |                                 ^^^^^^^^^ expected struct `Wrapper`, found struct `Payload`
+   |
+   = note: expected type `Wrapper`
+              found type `Payload`
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/foreign-fn-return-lifetime.fixed b/src/test/ui/foreign-fn-return-lifetime.fixed
new file mode 100644
index 00000000000..9fc35eae705
--- /dev/null
+++ b/src/test/ui/foreign-fn-return-lifetime.fixed
@@ -0,0 +1,18 @@
+// 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.
+
+// run-rustfix
+
+extern "C" {
+    pub fn g(_: &u8) -> &u8; // OK
+    pub fn f() -> &'static u8; //~ ERROR missing lifetime specifier
+}
+
+fn main() {}
diff --git a/src/test/ui/foreign-fn-return-lifetime.rs b/src/test/ui/foreign-fn-return-lifetime.rs
index da77066150c..941e7e05a36 100644
--- a/src/test/ui/foreign-fn-return-lifetime.rs
+++ b/src/test/ui/foreign-fn-return-lifetime.rs
@@ -8,9 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// run-rustfix
+
 extern "C" {
-    fn g(_: &u8) -> &u8; // OK
-    fn f() -> &u8; //~ ERROR missing lifetime specifier
+    pub fn g(_: &u8) -> &u8; // OK
+    pub fn f() -> &u8; //~ ERROR missing lifetime specifier
 }
 
 fn main() {}
diff --git a/src/test/ui/foreign-fn-return-lifetime.stderr b/src/test/ui/foreign-fn-return-lifetime.stderr
index ea15897b3d6..583487656f2 100644
--- a/src/test/ui/foreign-fn-return-lifetime.stderr
+++ b/src/test/ui/foreign-fn-return-lifetime.stderr
@@ -1,11 +1,10 @@
 error[E0106]: missing lifetime specifier
-  --> $DIR/foreign-fn-return-lifetime.rs:13:15
+  --> $DIR/foreign-fn-return-lifetime.rs:15:19
    |
-LL |     fn f() -> &u8; //~ ERROR missing lifetime specifier
-   |               ^ expected lifetime parameter
+LL |     pub fn f() -> &u8; //~ ERROR missing lifetime specifier
+   |                   ^ help: consider giving it a 'static lifetime: `&'static`
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
-   = help: consider giving it a 'static lifetime
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-13497.stderr b/src/test/ui/issues/issue-13497.stderr
index ab6d041bd48..e592452b899 100644
--- a/src/test/ui/issues/issue-13497.stderr
+++ b/src/test/ui/issues/issue-13497.stderr
@@ -2,10 +2,9 @@ error[E0106]: missing lifetime specifier
   --> $DIR/issue-13497.rs:12:5
    |
 LL |     &str //~ ERROR missing lifetime specifier
-   |     ^ expected lifetime parameter
+   |     ^ help: consider giving it a 'static lifetime: `&'static`
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
-   = help: consider giving it a 'static lifetime
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-26638.stderr b/src/test/ui/issues/issue-26638.stderr
index cf6fcd9f01c..0ac6316f0dc 100644
--- a/src/test/ui/issues/issue-26638.stderr
+++ b/src/test/ui/issues/issue-26638.stderr
@@ -10,19 +10,17 @@ error[E0106]: missing lifetime specifier
   --> $DIR/issue-26638.rs:14:40
    |
 LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
-   |                                        ^ expected lifetime parameter
+   |                                        ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
    |
    = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
-   = help: consider giving it an explicit bounded or 'static lifetime
 
 error[E0106]: missing lifetime specifier
   --> $DIR/issue-26638.rs:17:22
    |
 LL | fn parse_type_3() -> &str { unimplemented!() }
-   |                      ^ expected lifetime parameter
+   |                      ^ help: consider giving it a 'static lifetime: `&'static`
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
-   = help: consider giving it a 'static lifetime
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
index 30cff86ed1d..4c7a1b5ea9f 100644
--- a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
+++ b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
@@ -2,10 +2,9 @@ error[E0106]: missing lifetime specifier
   --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:12:11
    |
 LL | fn f() -> &isize {    //~ ERROR missing lifetime specifier
-   |           ^ expected lifetime parameter
+   |           ^ help: consider giving it a 'static lifetime: `&'static`
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
-   = help: consider giving it a 'static lifetime
 
 error[E0106]: missing lifetime specifier
   --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:17:33
@@ -27,28 +26,25 @@ error[E0106]: missing lifetime specifier
   --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:31:20
    |
 LL | fn i(_x: isize) -> &isize { //~ ERROR missing lifetime specifier
-   |                    ^ expected lifetime parameter
+   |                    ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
    |
    = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
-   = help: consider giving it an explicit bounded or 'static lifetime
 
 error[E0106]: missing lifetime specifier
   --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:44:24
    |
 LL | fn j(_x: StaticStr) -> &isize { //~ ERROR missing lifetime specifier
-   |                        ^ expected lifetime parameter
+   |                        ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
    |
    = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
-   = help: consider giving it an explicit bounded or 'static lifetime
 
 error[E0106]: missing lifetime specifier
   --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:50:49
    |
 LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize {
-   |                                                 ^ expected lifetime parameter
+   |                                                 ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
    |
    = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
-   = help: consider giving it an explicit bounded or 'static lifetime
 
 error: aborting due to 6 previous errors
 
diff --git a/src/test/ui/lifetimes/lifetime-elision-return-type-trait.rs b/src/test/ui/lifetimes/lifetime-elision-return-type-trait.rs
new file mode 100644
index 00000000000..eb959bfbcb5
--- /dev/null
+++ b/src/test/ui/lifetimes/lifetime-elision-return-type-trait.rs
@@ -0,0 +1,12 @@
+trait Future {
+    type Item;
+    type Error;
+}
+
+use std::error::Error;
+
+fn foo() -> impl Future<Item=(), Error=Box<Error>> {
+    Ok(())
+}
+
+fn main() {}
diff --git a/src/test/ui/lifetimes/lifetime-elision-return-type-trait.stderr b/src/test/ui/lifetimes/lifetime-elision-return-type-trait.stderr
new file mode 100644
index 00000000000..b2a3d9a9436
--- /dev/null
+++ b/src/test/ui/lifetimes/lifetime-elision-return-type-trait.stderr
@@ -0,0 +1,11 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/lifetime-elision-return-type-trait.rs:8:44
+   |
+LL | fn foo() -> impl Future<Item=(), Error=Box<Error>> {
+   |                                            ^^^^^ help: consider giving it a 'static lifetime: `Error + 'static`
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/lint/suggestions.rs b/src/test/ui/lint/suggestions.rs
index ff50b3b1ab6..77d546a00ec 100644
--- a/src/test/ui/lint/suggestions.rs
+++ b/src/test/ui/lint/suggestions.rs
@@ -56,7 +56,7 @@ fn main() {
     while true {
     //~^ WARN denote infinite loops
     //~| HELP use `loop`
-        let mut a = (1);
+        let mut registry_no = (format!("NX-{}", 74205));
         //~^ WARN does not need to be mutable
         //~| HELP remove this `mut`
         //~| WARN unnecessary parentheses
@@ -72,6 +72,6 @@ fn main() {
             //~^ WARN this pattern is redundant
             //~| HELP remove this
         }
-        println!("{} {}", a, b);
+        println!("{} {}", registry_no, b);
     }
 }
diff --git a/src/test/ui/lint/suggestions.stderr b/src/test/ui/lint/suggestions.stderr
index 340a4a48512..73704614815 100644
--- a/src/test/ui/lint/suggestions.stderr
+++ b/src/test/ui/lint/suggestions.stderr
@@ -1,8 +1,8 @@
 warning: unnecessary parentheses around assigned value
-  --> $DIR/suggestions.rs:59:21
+  --> $DIR/suggestions.rs:59:31
    |
-LL |         let mut a = (1);
-   |                     ^^^ help: remove these parentheses
+LL |         let mut registry_no = (format!("NX-{}", 74205));
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
    |
 note: lint level defined here
   --> $DIR/suggestions.rs:13:21
@@ -21,8 +21,8 @@ LL | #[no_debug] // should suggest removal of deprecated attribute
 warning: variable does not need to be mutable
   --> $DIR/suggestions.rs:59:13
    |
-LL |         let mut a = (1);
-   |             ----^
+LL |         let mut registry_no = (format!("NX-{}", 74205));
+   |             ----^^^^^^^^^^^
    |             |
    |             help: remove this `mut`
    |
diff --git a/src/test/ui/nll/issue-21232-partial-init-and-use.rs b/src/test/ui/nll/issue-21232-partial-init-and-use.rs
index e3ae4c0dcbe..186ecc54827 100644
--- a/src/test/ui/nll/issue-21232-partial-init-and-use.rs
+++ b/src/test/ui/nll/issue-21232-partial-init-and-use.rs
@@ -66,7 +66,7 @@ impl<F> R<F> { fn new(f: F) -> Self { R { w: 0, f } } }
 // It got pretty monotonous writing the same code over and over, and I
 // feared I would forget details. So I abstracted some desiderata into
 // macros. But I left the initialization code inline, because that's
-// where the errors for #54986 will be emited.
+// where the errors for #54986 will be emitted.
 
 macro_rules! use_fully {
     (struct $s:expr) => { {
diff --git a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs b/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs
index fff73c6d0fa..eaa809d2b37 100644
--- a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs
+++ b/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs
@@ -1,5 +1,5 @@
 // rust-lang/rust#52059: Regardless of whether you are moving out of a
-// Drop type or just introducing an inadvertant alias via a borrow of
+// Drop type or just introducing an inadvertent alias via a borrow of
 // one of its fields, it is useful to be reminded of the significance
 // of the fact that the type implements Drop.
 
diff --git a/src/test/ui/resolve/token-error-correct-2.rs b/src/test/ui/resolve/token-error-correct-2.rs
index e49374f9ce6..55803e4034b 100644
--- a/src/test/ui/resolve/token-error-correct-2.rs
+++ b/src/test/ui/resolve/token-error-correct-2.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// Test that we do some basic error correcton in the tokeniser (and don't ICE).
+// Test that we do some basic error correction in the tokeniser (and don't ICE).
 
 fn main() {
     if foo {
diff --git a/src/test/ui/resolve/token-error-correct-3.rs b/src/test/ui/resolve/token-error-correct-3.rs
index 8881b965f94..fd4bbde2866 100644
--- a/src/test/ui/resolve/token-error-correct-3.rs
+++ b/src/test/ui/resolve/token-error-correct-3.rs
@@ -10,7 +10,7 @@
 
 // ignore-cloudabi no std::fs support
 
-// Test that we do some basic error correcton in the tokeniser (and don't spew
+// Test that we do some basic error correction in the tokeniser (and don't spew
 // too many bogus errors).
 
 pub mod raw {
diff --git a/src/test/ui/resolve/token-error-correct.rs b/src/test/ui/resolve/token-error-correct.rs
index 39c664e270c..099ead93beb 100644
--- a/src/test/ui/resolve/token-error-correct.rs
+++ b/src/test/ui/resolve/token-error-correct.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// Test that we do some basic error correcton in the tokeniser.
+// Test that we do some basic error correction in the tokeniser.
 
 fn main() {
     foo(bar(;
diff --git a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.rs b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.rs
index 339d49104b0..31a34a9e6fb 100644
--- a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.rs
+++ b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.rs
@@ -19,22 +19,22 @@ fn main() {
     use std::ops::Range;
 
     if let Range { start: _, end: _ } = true..true && false { }
-    //~^ ERROR ambigious use of `&&`
+    //~^ ERROR ambiguous use of `&&`
 
     if let Range { start: _, end: _ } = true..true || false { }
-    //~^ ERROR ambigious use of `||`
+    //~^ ERROR ambiguous use of `||`
 
     while let Range { start: _, end: _ } = true..true && false { }
-    //~^ ERROR ambigious use of `&&`
+    //~^ ERROR ambiguous use of `&&`
 
     while let Range { start: _, end: _ } = true..true || false { }
-    //~^ ERROR ambigious use of `||`
+    //~^ ERROR ambiguous use of `||`
 
     if let true = false && false { }
-    //~^ ERROR ambigious use of `&&`
+    //~^ ERROR ambiguous use of `&&`
 
     while let true = (1 == 2) && false { }
-    //~^ ERROR ambigious use of `&&`
+    //~^ ERROR ambiguous use of `&&`
 
     // The following cases are not an error as parenthesis are used to
     // clarify intent:
diff --git a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.stderr b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.stderr
index 8597294913f..411cb99fbca 100644
--- a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.stderr
+++ b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.stderr
@@ -1,4 +1,4 @@
-error: ambigious use of `&&`
+error: ambiguous use of `&&`
   --> $DIR/syntax-ambiguity-2015.rs:21:47
    |
 LL |     if let Range { start: _, end: _ } = true..true && false { }
@@ -7,7 +7,7 @@ LL |     if let Range { start: _, end: _ } = true..true && false { }
    = note: this will be a error until the `let_chains` feature is stabilized
    = note: see rust-lang/rust#53668 for more information
 
-error: ambigious use of `||`
+error: ambiguous use of `||`
   --> $DIR/syntax-ambiguity-2015.rs:24:47
    |
 LL |     if let Range { start: _, end: _ } = true..true || false { }
@@ -16,7 +16,7 @@ LL |     if let Range { start: _, end: _ } = true..true || false { }
    = note: this will be a error until the `let_chains` feature is stabilized
    = note: see rust-lang/rust#53668 for more information
 
-error: ambigious use of `&&`
+error: ambiguous use of `&&`
   --> $DIR/syntax-ambiguity-2015.rs:27:50
    |
 LL |     while let Range { start: _, end: _ } = true..true && false { }
@@ -25,7 +25,7 @@ LL |     while let Range { start: _, end: _ } = true..true && false { }
    = note: this will be a error until the `let_chains` feature is stabilized
    = note: see rust-lang/rust#53668 for more information
 
-error: ambigious use of `||`
+error: ambiguous use of `||`
   --> $DIR/syntax-ambiguity-2015.rs:30:50
    |
 LL |     while let Range { start: _, end: _ } = true..true || false { }
@@ -34,7 +34,7 @@ LL |     while let Range { start: _, end: _ } = true..true || false { }
    = note: this will be a error until the `let_chains` feature is stabilized
    = note: see rust-lang/rust#53668 for more information
 
-error: ambigious use of `&&`
+error: ambiguous use of `&&`
   --> $DIR/syntax-ambiguity-2015.rs:33:19
    |
 LL |     if let true = false && false { }
@@ -43,7 +43,7 @@ LL |     if let true = false && false { }
    = note: this will be a error until the `let_chains` feature is stabilized
    = note: see rust-lang/rust#53668 for more information
 
-error: ambigious use of `&&`
+error: ambiguous use of `&&`
   --> $DIR/syntax-ambiguity-2015.rs:36:22
    |
 LL |     while let true = (1 == 2) && false { }
diff --git a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.rs b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.rs
index baa90bcf8e9..99495717c3a 100644
--- a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.rs
+++ b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.rs
@@ -19,22 +19,22 @@ fn main() {
     use std::ops::Range;
 
     if let Range { start: _, end: _ } = true..true && false { }
-    //~^ ERROR ambigious use of `&&`
+    //~^ ERROR ambiguous use of `&&`
 
     if let Range { start: _, end: _ } = true..true || false { }
-    //~^ ERROR ambigious use of `||`
+    //~^ ERROR ambiguous use of `||`
 
     while let Range { start: _, end: _ } = true..true && false { }
-    //~^ ERROR ambigious use of `&&`
+    //~^ ERROR ambiguous use of `&&`
 
     while let Range { start: _, end: _ } = true..true || false { }
-    //~^ ERROR ambigious use of `||`
+    //~^ ERROR ambiguous use of `||`
 
     if let true = false && false { }
-    //~^ ERROR ambigious use of `&&`
+    //~^ ERROR ambiguous use of `&&`
 
     while let true = (1 == 2) && false { }
-    //~^ ERROR ambigious use of `&&`
+    //~^ ERROR ambiguous use of `&&`
 
     // The following cases are not an error as parenthesis are used to
     // clarify intent:
diff --git a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.stderr b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.stderr
index 86ee04747b2..bd49abeb7b2 100644
--- a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.stderr
+++ b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.stderr
@@ -1,4 +1,4 @@
-error: ambigious use of `&&`
+error: ambiguous use of `&&`
   --> $DIR/syntax-ambiguity-2018.rs:21:47
    |
 LL |     if let Range { start: _, end: _ } = true..true && false { }
@@ -7,7 +7,7 @@ LL |     if let Range { start: _, end: _ } = true..true && false { }
    = note: this will be a error until the `let_chains` feature is stabilized
    = note: see rust-lang/rust#53668 for more information
 
-error: ambigious use of `||`
+error: ambiguous use of `||`
   --> $DIR/syntax-ambiguity-2018.rs:24:47
    |
 LL |     if let Range { start: _, end: _ } = true..true || false { }
@@ -16,7 +16,7 @@ LL |     if let Range { start: _, end: _ } = true..true || false { }
    = note: this will be a error until the `let_chains` feature is stabilized
    = note: see rust-lang/rust#53668 for more information
 
-error: ambigious use of `&&`
+error: ambiguous use of `&&`
   --> $DIR/syntax-ambiguity-2018.rs:27:50
    |
 LL |     while let Range { start: _, end: _ } = true..true && false { }
@@ -25,7 +25,7 @@ LL |     while let Range { start: _, end: _ } = true..true && false { }
    = note: this will be a error until the `let_chains` feature is stabilized
    = note: see rust-lang/rust#53668 for more information
 
-error: ambigious use of `||`
+error: ambiguous use of `||`
   --> $DIR/syntax-ambiguity-2018.rs:30:50
    |
 LL |     while let Range { start: _, end: _ } = true..true || false { }
@@ -34,7 +34,7 @@ LL |     while let Range { start: _, end: _ } = true..true || false { }
    = note: this will be a error until the `let_chains` feature is stabilized
    = note: see rust-lang/rust#53668 for more information
 
-error: ambigious use of `&&`
+error: ambiguous use of `&&`
   --> $DIR/syntax-ambiguity-2018.rs:33:19
    |
 LL |     if let true = false && false { }
@@ -43,7 +43,7 @@ LL |     if let true = false && false { }
    = note: this will be a error until the `let_chains` feature is stabilized
    = note: see rust-lang/rust#53668 for more information
 
-error: ambigious use of `&&`
+error: ambiguous use of `&&`
   --> $DIR/syntax-ambiguity-2018.rs:36:22
    |
 LL |     while let true = (1 == 2) && false { }
diff --git a/src/test/ui/rust-2018/edition-lint-infer-outlives.fixed b/src/test/ui/rust-2018/edition-lint-infer-outlives.fixed
index d70c847e9fe..f13f8ef2bb4 100644
--- a/src/test/ui/rust-2018/edition-lint-infer-outlives.fixed
+++ b/src/test/ui/rust-2018/edition-lint-infer-outlives.fixed
@@ -24,7 +24,7 @@ use std::fmt::{Debug, Display};
 // • one generic parameter (T) bound inline
 // • one parameter (T) with a where clause
 // • two parameters (T and U), both bound inline
-// • two paramters (T and U), one bound inline, one with a where clause
+// • two parameters (T and U), one bound inline, one with a where clause
 // • two parameters (T and U), both with where clauses
 //
 // —and for every permutation of 0, 1, or 2 lifetimes to outlive and 0 or 1
diff --git a/src/test/ui/rust-2018/edition-lint-infer-outlives.rs b/src/test/ui/rust-2018/edition-lint-infer-outlives.rs
index 0e4436fe163..f47b3fcb9be 100644
--- a/src/test/ui/rust-2018/edition-lint-infer-outlives.rs
+++ b/src/test/ui/rust-2018/edition-lint-infer-outlives.rs
@@ -24,7 +24,7 @@ use std::fmt::{Debug, Display};
 // • one generic parameter (T) bound inline
 // • one parameter (T) with a where clause
 // • two parameters (T and U), both bound inline
-// • two paramters (T and U), one bound inline, one with a where clause
+// • two parameters (T and U), one bound inline, one with a where clause
 // • two parameters (T and U), both with where clauses
 //
 // —and for every permutation of 0, 1, or 2 lifetimes to outlive and 0 or 1
diff --git a/src/test/ui/specialization/issue-52050.rs b/src/test/ui/specialization/issue-52050.rs
index 70cdb4899c4..00d8d126e05 100644
--- a/src/test/ui/specialization/issue-52050.rs
+++ b/src/test/ui/specialization/issue-52050.rs
@@ -12,7 +12,7 @@
 
 // Regression test for #52050: when inserting the blanket impl `I`
 // into the tree, we had to replace the child node for `Foo`, which
-// led to the struture of the tree being messed up.
+// led to the structure of the tree being messed up.
 
 use std::iter::Iterator;
 
diff --git a/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr b/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr
index bccecd60e1c..e56d008d266 100644
--- a/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr
+++ b/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr
@@ -20,10 +20,9 @@ error[E0106]: missing lifetime specifier
   --> $DIR/underscore-lifetime-binders.rs:20:29
    |
 LL | fn meh() -> Box<for<'_> Meh<'_>> //~ ERROR cannot be used here
-   |                             ^^ expected lifetime parameter
+   |                             ^^ help: consider giving it a 'static lifetime: `'static`
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
-   = help: consider giving it a 'static lifetime
 
 error[E0106]: missing lifetime specifier
   --> $DIR/underscore-lifetime-binders.rs:26:35