about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-06-01 05:24:11 +0000
committerbors <bors@rust-lang.org>2017-06-01 05:24:11 +0000
commit38efb2e1ccf210b0108d2b88ee9d4ddcd8e91a3a (patch)
treefd62a4e7688baa1ef79d4d4ac559f487d64903e4 /src/test
parente0cc22b4bae8007c59fbe58f2c104ecd743d746a (diff)
parent9bd6dc73fc7fd46bf83ff17bea13a410efb1fc96 (diff)
downloadrust-38efb2e1ccf210b0108d2b88ee9d4ddcd8e91a3a.tar.gz
rust-38efb2e1ccf210b0108d2b88ee9d4ddcd8e91a3a.zip
Auto merge of #42348 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests

- Successful merges: #42136, #42275, #42286, #42297, #42302, #42306, #42314, #42324, #42347
- Failed merges:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/associated-const-generic-obligations.rs30
-rw-r--r--src/test/compile-fail/associated-const-impl-wrong-lifetime.rs27
-rw-r--r--src/test/compile-fail/associated-types/bound-lifetime-constrained.rs1
-rw-r--r--src/test/compile-fail/associated-types/bound-lifetime-in-return-only.rs1
-rw-r--r--src/test/compile-fail/extern-crate-visibility.rs6
-rw-r--r--src/test/compile-fail/future-incompatible-lint-group.rs (renamed from src/test/run-pass/issue-37020.rs)19
-rw-r--r--src/test/compile-fail/generic-impl-less-params-with-defaults.rs2
-rw-r--r--src/test/compile-fail/generic-impl-more-params-with-defaults.rs2
-rw-r--r--src/test/compile-fail/issue-1920-1.rs2
-rw-r--r--src/test/compile-fail/issue-1920-3.rs2
-rw-r--r--src/test/compile-fail/issue-6804.rs2
-rw-r--r--src/test/compile-fail/lifetime-underscore.rs4
-rw-r--r--src/test/compile-fail/match-argm-statics-2.rs2
-rw-r--r--src/test/compile-fail/privacy/restricted/struct-literal-field.rs1
-rw-r--r--src/test/compile-fail/privacy/restricted/test.rs1
-rw-r--r--src/test/compile-fail/private-in-public-lint.rs2
-rw-r--r--src/test/compile-fail/private-variant-reexport.rs (renamed from src/test/compile-fail/private-variant-and-crate-reexport.rs)11
-rw-r--r--src/test/compile-fail/pub-reexport-priv-extern-crate.rs35
-rw-r--r--src/test/compile-fail/resolve-self-in-impl.rs1
-rw-r--r--src/test/compile-fail/rfc1445/feature-gate.rs3
-rw-r--r--src/test/compile-fail/rfc1445/match-forbidden-without-eq.rs5
-rw-r--r--src/test/compile-fail/rfc1445/match-requires-both-partialeq-and-eq.rs4
-rw-r--r--src/test/compile-fail/type-parameter-invalid-lint.rs8
-rw-r--r--src/test/compile-fail/use-super-global-path.rs2
-rw-r--r--src/test/run-pass/try-operator-custom.rs18
-rw-r--r--src/test/rustdoc/assoc-consts.rs18
-rw-r--r--src/test/ui/missing-items/m2.stderr2
-rw-r--r--src/test/ui/resolve/issue-14254.stderr2
-rw-r--r--src/test/ui/resolve/issue-21221-2.stderr2
-rw-r--r--src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr2
-rw-r--r--src/test/ui/span/issue-35987.stderr2
-rw-r--r--src/test/ui/token/issue-10636-2.stderr2
-rw-r--r--src/test/ui/token/issue-41155.stderr2
33 files changed, 142 insertions, 81 deletions
diff --git a/src/test/compile-fail/associated-const-generic-obligations.rs b/src/test/compile-fail/associated-const-generic-obligations.rs
new file mode 100644
index 00000000000..90afe8d7336
--- /dev/null
+++ b/src/test/compile-fail/associated-const-generic-obligations.rs
@@ -0,0 +1,30 @@
+// 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(associated_consts)]
+
+trait Foo {
+    type Out: Sized;
+}
+
+impl Foo for String {
+    type Out = String;
+}
+
+trait Bar: Foo {
+    const FROM: Self::Out;
+}
+
+impl<T: Foo> Bar for T {
+    const FROM: &'static str = "foo";
+    //~^ ERROR the trait bound `T: Foo` is not satisfied [E0277]
+}
+
+fn main() {}
diff --git a/src/test/compile-fail/associated-const-impl-wrong-lifetime.rs b/src/test/compile-fail/associated-const-impl-wrong-lifetime.rs
new file mode 100644
index 00000000000..834f3460694
--- /dev/null
+++ b/src/test/compile-fail/associated-const-impl-wrong-lifetime.rs
@@ -0,0 +1,27 @@
+// 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(associated_consts)]
+
+trait Foo {
+    const NAME: &'static str;
+}
+
+
+impl<'a> Foo for &'a () {
+//~^ NOTE the lifetime 'a as defined
+    const NAME: &'a str = "unit";
+    //~^ ERROR mismatched types [E0308]
+    //~| NOTE lifetime mismatch
+    //~| NOTE expected type `&'static str`
+    //~| NOTE ...does not necessarily outlive the static lifetime
+}
+
+fn main() {}
diff --git a/src/test/compile-fail/associated-types/bound-lifetime-constrained.rs b/src/test/compile-fail/associated-types/bound-lifetime-constrained.rs
index 7d04372088b..9ba5045f2a0 100644
--- a/src/test/compile-fail/associated-types/bound-lifetime-constrained.rs
+++ b/src/test/compile-fail/associated-types/bound-lifetime-constrained.rs
@@ -12,7 +12,6 @@
 
 #![allow(dead_code)]
 #![feature(rustc_attrs)]
-#![allow(hr_lifetime_in_assoc_type)]
 
 trait Foo<'a> {
     type Item;
diff --git a/src/test/compile-fail/associated-types/bound-lifetime-in-return-only.rs b/src/test/compile-fail/associated-types/bound-lifetime-in-return-only.rs
index 7c1fbfa53d9..b9b1317cef5 100644
--- a/src/test/compile-fail/associated-types/bound-lifetime-in-return-only.rs
+++ b/src/test/compile-fail/associated-types/bound-lifetime-in-return-only.rs
@@ -13,7 +13,6 @@
 #![allow(dead_code)]
 #![feature(rustc_attrs)]
 #![feature(unboxed_closures)]
-#![deny(hr_lifetime_in_assoc_type)]
 
 trait Foo {
     type Item;
diff --git a/src/test/compile-fail/extern-crate-visibility.rs b/src/test/compile-fail/extern-crate-visibility.rs
index 81e0cb249f3..6bb88e40910 100644
--- a/src/test/compile-fail/extern-crate-visibility.rs
+++ b/src/test/compile-fail/extern-crate-visibility.rs
@@ -8,21 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unused)]
-
 mod foo {
     extern crate core;
 }
 
 // Check that private crates can be used from outside their modules, albeit with warnings
-use foo::core; //~ WARN extern crate `core` is private
-//~^ WARN this was previously accepted by the compiler but is being phased out
 use foo::core::cell; //~ ERROR extern crate `core` is private
-//~^ WARN this was previously accepted by the compiler but is being phased out
 
 fn f() {
     foo::core::cell::Cell::new(0); //~ ERROR extern crate `core` is private
-    //~^ WARN this was previously accepted by the compiler but is being phased out
 
     use foo::*;
     mod core {} // Check that private crates are not glob imported
diff --git a/src/test/run-pass/issue-37020.rs b/src/test/compile-fail/future-incompatible-lint-group.rs
index 7d0d20269ab..e6a39f95e66 100644
--- a/src/test/run-pass/issue-37020.rs
+++ b/src/test/compile-fail/future-incompatible-lint-group.rs
@@ -1,4 +1,4 @@
-// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// 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.
 //
@@ -8,18 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(private_in_public)]
+#![deny(future_incompatible)]
 
-mod foo {
-    pub mod bar {
-        extern crate core;
-    }
+trait Tr {
+    fn f(u8) {} //~ ERROR use of deprecated anonymous parameter
+                //~^ WARN this was previously accepted
 }
 
-mod baz {
-    pub use foo::bar::core;
-}
-
-fn main() {
-    baz::core::cell::Cell::new(0u32);
-}
+fn main() {}
diff --git a/src/test/compile-fail/generic-impl-less-params-with-defaults.rs b/src/test/compile-fail/generic-impl-less-params-with-defaults.rs
index 5fa429445a3..3f5f7bb3a53 100644
--- a/src/test/compile-fail/generic-impl-less-params-with-defaults.rs
+++ b/src/test/compile-fail/generic-impl-less-params-with-defaults.rs
@@ -13,7 +13,7 @@ use std::marker;
 struct Foo<A, B, C = (A, B)>(
     marker::PhantomData<(A,B,C)>);
 
-impl<A, B, C = (A, B)> Foo<A, B, C> {
+impl<A, B, C> Foo<A, B, C> {
     fn new() -> Foo<A, B, C> {Foo(marker::PhantomData)}
 }
 
diff --git a/src/test/compile-fail/generic-impl-more-params-with-defaults.rs b/src/test/compile-fail/generic-impl-more-params-with-defaults.rs
index d3babb8982d..31411992089 100644
--- a/src/test/compile-fail/generic-impl-more-params-with-defaults.rs
+++ b/src/test/compile-fail/generic-impl-more-params-with-defaults.rs
@@ -15,7 +15,7 @@ struct Heap;
 struct Vec<T, A = Heap>(
     marker::PhantomData<(T,A)>);
 
-impl<T, A = Heap> Vec<T, A> {
+impl<T, A> Vec<T, A> {
     fn new() -> Vec<T, A> {Vec(marker::PhantomData)}
 }
 
diff --git a/src/test/compile-fail/issue-1920-1.rs b/src/test/compile-fail/issue-1920-1.rs
index 8fbe4432204..f829d4645a0 100644
--- a/src/test/compile-fail/issue-1920-1.rs
+++ b/src/test/compile-fail/issue-1920-1.rs
@@ -11,7 +11,7 @@
 //! Test that absolute path names are correct when a crate is not linked into the root namespace
 
 mod foo {
-    extern crate core;
+    pub extern crate core;
 }
 
 fn assert_clone<T>() where T : Clone { }
diff --git a/src/test/compile-fail/issue-1920-3.rs b/src/test/compile-fail/issue-1920-3.rs
index dfec48e0a83..2f5da907b95 100644
--- a/src/test/compile-fail/issue-1920-3.rs
+++ b/src/test/compile-fail/issue-1920-3.rs
@@ -11,7 +11,7 @@
 //! Test that when a crate is linked multiple times that the shortest absolute path name is used
 
 mod foo {
-    extern crate core;
+    pub extern crate core;
 }
 
 extern crate core;
diff --git a/src/test/compile-fail/issue-6804.rs b/src/test/compile-fail/issue-6804.rs
index f7d3ce60c66..2a97945f266 100644
--- a/src/test/compile-fail/issue-6804.rs
+++ b/src/test/compile-fail/issue-6804.rs
@@ -19,13 +19,11 @@ fn main() {
     let x = NAN;
     match x {
         NAN => {}, //~ ERROR floating point constants cannot be used
-                   //~| WARNING hard error
         _ => {},
     };
 
     match [x, 1.0] {
         [NAN, _] => {}, //~ ERROR floating point constants cannot be used
-                        //~| WARNING hard error
         _ => {},
     };
 }
diff --git a/src/test/compile-fail/lifetime-underscore.rs b/src/test/compile-fail/lifetime-underscore.rs
index b768009132c..5b518a4931d 100644
--- a/src/test/compile-fail/lifetime-underscore.rs
+++ b/src/test/compile-fail/lifetime-underscore.rs
@@ -9,17 +9,13 @@
 // except according to those terms.
 
 fn _f<'_>() //~ ERROR invalid lifetime name `'_`
-//~^ WARN this was previously accepted
     -> &'_ u8 //~ ERROR invalid lifetime name `'_`
-    //~^ WARN this was previously accepted
 {
     panic!();
 }
 
 fn main() {
     '_: loop { //~ ERROR invalid label name `'_`
-    //~^ WARN this was previously accepted
         break '_ //~ ERROR invalid label name `'_`
-        //~^ WARN this was previously accepted
     }
 }
diff --git a/src/test/compile-fail/match-argm-statics-2.rs b/src/test/compile-fail/match-argm-statics-2.rs
index 40dcf3d0f12..70e148627c4 100644
--- a/src/test/compile-fail/match-argm-statics-2.rs
+++ b/src/test/compile-fail/match-argm-statics-2.rs
@@ -10,8 +10,10 @@
 
 use self::Direction::{North, East, South, West};
 
+#[derive(PartialEq, Eq)]
 struct NewBool(bool);
 
+#[derive(PartialEq, Eq)]
 enum Direction {
     North,
     East,
diff --git a/src/test/compile-fail/privacy/restricted/struct-literal-field.rs b/src/test/compile-fail/privacy/restricted/struct-literal-field.rs
index 68458fe3f04..21d90dfea4b 100644
--- a/src/test/compile-fail/privacy/restricted/struct-literal-field.rs
+++ b/src/test/compile-fail/privacy/restricted/struct-literal-field.rs
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![deny(private_in_public)]
 #![allow(warnings)]
 
 mod foo {
diff --git a/src/test/compile-fail/privacy/restricted/test.rs b/src/test/compile-fail/privacy/restricted/test.rs
index 12697d51042..2e065ac051b 100644
--- a/src/test/compile-fail/privacy/restricted/test.rs
+++ b/src/test/compile-fail/privacy/restricted/test.rs
@@ -10,7 +10,6 @@
 
 // aux-build:pub_restricted.rs
 
-#![deny(private_in_public)]
 #![allow(warnings)]
 extern crate pub_restricted;
 
diff --git a/src/test/compile-fail/private-in-public-lint.rs b/src/test/compile-fail/private-in-public-lint.rs
index 030fbfc4914..fd92300cd15 100644
--- a/src/test/compile-fail/private-in-public-lint.rs
+++ b/src/test/compile-fail/private-in-public-lint.rs
@@ -18,8 +18,6 @@ mod m1 {
 }
 
 mod m2 {
-    #![deny(future_incompatible)]
-
     pub struct Pub;
     struct Priv;
 
diff --git a/src/test/compile-fail/private-variant-and-crate-reexport.rs b/src/test/compile-fail/private-variant-reexport.rs
index dce533e73fe..c77a7532e34 100644
--- a/src/test/compile-fail/private-variant-and-crate-reexport.rs
+++ b/src/test/compile-fail/private-variant-reexport.rs
@@ -8,31 +8,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![deny(private_in_public)]
-#![allow(dead_code)]
-
-extern crate core;
-pub use core as reexported_core; //~ ERROR extern crate `core` is private, and cannot be reexported
-//~^ WARNING hard error
-
 mod m1 {
     pub use ::E::V; //~ ERROR variant `V` is private, and cannot be reexported
-    //~^ WARNING hard error
 }
 
 mod m2 {
     pub use ::E::{V}; //~ ERROR variant `V` is private, and cannot be reexported
-    //~^ WARNING hard error
 }
 
 mod m3 {
     pub use ::E::V::{self}; //~ ERROR variant `V` is private, and cannot be reexported
-    //~^ WARNING hard error
 }
 
 mod m4 {
     pub use ::E::*; //~ ERROR variant `V` is private, and cannot be reexported
-    //~^ WARNING hard error
 }
 
 enum E { V }
diff --git a/src/test/compile-fail/pub-reexport-priv-extern-crate.rs b/src/test/compile-fail/pub-reexport-priv-extern-crate.rs
new file mode 100644
index 00000000000..185da379694
--- /dev/null
+++ b/src/test/compile-fail/pub-reexport-priv-extern-crate.rs
@@ -0,0 +1,35 @@
+// 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.
+
+#![allow(unused)]
+#![deny(private_in_public)]
+
+extern crate core;
+pub use core as reexported_core; //~ ERROR `core` is private, and cannot be reexported
+                                 //~^ WARN this was previously accepted
+
+mod foo1 {
+    extern crate core;
+}
+
+mod foo2 {
+    use foo1::core; //~ ERROR `core` is private, and cannot be reexported
+                    //~^ WARN this was previously accepted
+    pub mod bar {
+        extern crate core;
+    }
+}
+
+mod baz {
+    pub use foo2::bar::core; //~ ERROR `core` is private, and cannot be reexported
+                             //~^ WARN this was previously accepted
+}
+
+fn main() {}
diff --git a/src/test/compile-fail/resolve-self-in-impl.rs b/src/test/compile-fail/resolve-self-in-impl.rs
index 710d8e11ff0..55ae37404a9 100644
--- a/src/test/compile-fail/resolve-self-in-impl.rs
+++ b/src/test/compile-fail/resolve-self-in-impl.rs
@@ -17,7 +17,6 @@ trait Tr<T = u8> {
 
 impl Tr<Self> for S {} // OK
 impl<T: Tr<Self>> Tr<T> for S {} // OK
-impl<T = Self> Tr<T> for S {} // OK
 impl Tr for S where Self: Copy {} // OK
 impl Tr for S where S<Self>: Copy {} // OK
 impl Tr for S where Self::A: Copy {} // OK
diff --git a/src/test/compile-fail/rfc1445/feature-gate.rs b/src/test/compile-fail/rfc1445/feature-gate.rs
index b51ee3d8b5e..f729220eabb 100644
--- a/src/test/compile-fail/rfc1445/feature-gate.rs
+++ b/src/test/compile-fail/rfc1445/feature-gate.rs
@@ -16,8 +16,7 @@
 
 // gate-test-structural_match
 
-#![allow(dead_code)]
-#![deny(future_incompatible)]
+#![allow(unused)]
 #![feature(rustc_attrs)]
 #![cfg_attr(with_gate, feature(structural_match))]
 
diff --git a/src/test/compile-fail/rfc1445/match-forbidden-without-eq.rs b/src/test/compile-fail/rfc1445/match-forbidden-without-eq.rs
index c573e3e8e28..679be9ce219 100644
--- a/src/test/compile-fail/rfc1445/match-forbidden-without-eq.rs
+++ b/src/test/compile-fail/rfc1445/match-forbidden-without-eq.rs
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(dead_code)]
-#![deny(future_incompatible)]
-
 use std::f32;
 
 #[derive(PartialEq)]
@@ -25,7 +22,6 @@ fn main() {
     match y {
         FOO => { }
         //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
-        //~| WARNING will become a hard error
         _ => { }
     }
 
@@ -33,7 +29,6 @@ fn main() {
     match x {
         f32::INFINITY => { }
         //~^ ERROR floating point constants cannot be used in patterns
-        //~| WARNING will become a hard error
         _ => { }
     }
 }
diff --git a/src/test/compile-fail/rfc1445/match-requires-both-partialeq-and-eq.rs b/src/test/compile-fail/rfc1445/match-requires-both-partialeq-and-eq.rs
index 029df08ebc3..e02f9153e7e 100644
--- a/src/test/compile-fail/rfc1445/match-requires-both-partialeq-and-eq.rs
+++ b/src/test/compile-fail/rfc1445/match-requires-both-partialeq-and-eq.rs
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(dead_code)]
-#![deny(future_incompatible)]
-
 #[derive(Eq)]
 struct Foo {
     x: u32
@@ -29,7 +26,6 @@ fn main() {
     match y {
         FOO => { }
         //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
-        //~| WARNING will become a hard error
         _ => { }
     }
 }
diff --git a/src/test/compile-fail/type-parameter-invalid-lint.rs b/src/test/compile-fail/type-parameter-invalid-lint.rs
index a2c8116c9ba..c7a1197372d 100644
--- a/src/test/compile-fail/type-parameter-invalid-lint.rs
+++ b/src/test/compile-fail/type-parameter-invalid-lint.rs
@@ -10,16 +10,16 @@
 
 // gate-test-default_type_parameter_fallback
 
-#![deny(future_incompatible)]
-#![allow(dead_code)]
+#![deny(invalid_type_param_default)]
+#![allow(unused)]
 
 fn avg<T=i32>(_: T) {}
 //~^ ERROR defaults for type parameters are only allowed
-//~| WARNING hard error
+//~| WARN this was previously accepted
 
 struct S<T>(T);
 impl<T=i32> S<T> {}
 //~^ ERROR defaults for type parameters are only allowed
-//~| WARNING hard error
+//~| WARN this was previously accepted
 
 fn main() {}
diff --git a/src/test/compile-fail/use-super-global-path.rs b/src/test/compile-fail/use-super-global-path.rs
index 3fa0712fb4c..4162e037cf3 100644
--- a/src/test/compile-fail/use-super-global-path.rs
+++ b/src/test/compile-fail/use-super-global-path.rs
@@ -15,11 +15,9 @@ struct Z;
 
 mod foo {
     use ::super::{S, Z}; //~ ERROR global paths cannot start with `super`
-    //~^ WARN this was previously accepted by the compiler but is being phased out
 
     pub fn g() {
         use ::super::main; //~ ERROR global paths cannot start with `super`
-        //~^ WARN this was previously accepted by the compiler but is being phased out
         main();
     }
 }
diff --git a/src/test/run-pass/try-operator-custom.rs b/src/test/run-pass/try-operator-custom.rs
index 577d19a5896..82ba70c9459 100644
--- a/src/test/run-pass/try-operator-custom.rs
+++ b/src/test/run-pass/try-operator-custom.rs
@@ -8,20 +8,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(question_mark, question_mark_carrier)]
+#![feature(try_trait)]
 
-use std::ops::Carrier;
+use std::ops::Try;
 
 enum MyResult<T, U> {
     Awesome(T),
     Terrible(U)
 }
 
-impl<U, V> Carrier for MyResult<U, V> {
-    type Success = U;
+impl<U, V> Try for MyResult<U, V> {
+    type Ok = U;
     type Error = V;
 
-    fn from_success(u: U) -> MyResult<U, V> {
+    fn from_ok(u: U) -> MyResult<U, V> {
         MyResult::Awesome(u)
     }
 
@@ -29,12 +29,10 @@ impl<U, V> Carrier for MyResult<U, V> {
         MyResult::Terrible(e)
     }
 
-    fn translate<T>(self) -> T
-        where T: Carrier<Success=U, Error=V>
-    {
+    fn into_result(self) -> Result<U, V> {
         match self {
-            MyResult::Awesome(u) => T::from_success(u),
-            MyResult::Terrible(e) => T::from_error(e),
+            MyResult::Awesome(u) => Ok(u),
+            MyResult::Terrible(e) => Err(e),
         }
     }
 }
diff --git a/src/test/rustdoc/assoc-consts.rs b/src/test/rustdoc/assoc-consts.rs
index d4119f5d351..04709407e58 100644
--- a/src/test/rustdoc/assoc-consts.rs
+++ b/src/test/rustdoc/assoc-consts.rs
@@ -26,3 +26,21 @@ impl Bar {
     // @has - '//*[@class="docblock"]' 'BAR: usize = 3'
     pub const BAR: usize = 3;
 }
+
+pub struct Baz<'a, U: 'a, T>(T, &'a [U]);
+
+impl Bar {
+    // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAZ"]' \
+    //      "const BAZ: Baz<'static, u8, u32>"
+    // @has - '//*[@class="docblock"]' "BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3])"
+    pub const BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3]);
+}
+
+pub fn f(_: &(ToString + 'static)) {}
+
+impl Bar {
+    // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \
+    //      "const F: fn(_: &(ToString + 'static))"
+    // @has - '//*[@class="docblock"]' "F: fn(_: &(ToString + 'static)) = f"
+    pub const F: fn(_: &(ToString + 'static)) = f;
+}
diff --git a/src/test/ui/missing-items/m2.stderr b/src/test/ui/missing-items/m2.stderr
index 26748d18ffa..2d699c66359 100644
--- a/src/test/ui/missing-items/m2.stderr
+++ b/src/test/ui/missing-items/m2.stderr
@@ -1,4 +1,4 @@
-error: main function not found
+error[E0601]: main function not found
 
 error[E0046]: not all trait items implemented, missing: `CONSTANT`, `Type`, `method`
   --> $DIR/m2.rs:20:1
diff --git a/src/test/ui/resolve/issue-14254.stderr b/src/test/ui/resolve/issue-14254.stderr
index 8aaad906ea2..009d969fc28 100644
--- a/src/test/ui/resolve/issue-14254.stderr
+++ b/src/test/ui/resolve/issue-14254.stderr
@@ -142,7 +142,7 @@ error[E0425]: cannot find value `bah` in this scope
 133 |         bah;
     |         ^^^ did you mean `Self::bah`?
 
-error: main function not found
+error[E0601]: main function not found
 
 error: aborting due to previous error(s)
 
diff --git a/src/test/ui/resolve/issue-21221-2.stderr b/src/test/ui/resolve/issue-21221-2.stderr
index f0b22754e64..b35f1bd2670 100644
--- a/src/test/ui/resolve/issue-21221-2.stderr
+++ b/src/test/ui/resolve/issue-21221-2.stderr
@@ -7,7 +7,7 @@ error[E0405]: cannot find trait `T` in this scope
 help: possible candidate is found in another module, you can import it into scope
    | use foo::bar::T;
 
-error: main function not found
+error[E0601]: main function not found
 
 error: cannot continue compilation due to previous error
 
diff --git a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr
index 24cef694737..a34c27a47da 100644
--- a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr
+++ b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr
@@ -72,7 +72,7 @@ error[E0423]: expected function, found module `a::b`
    |        |
    |        did you mean `I`?
 
-error: main function not found
+error[E0601]: main function not found
 
 error: aborting due to previous error(s)
 
diff --git a/src/test/ui/span/issue-35987.stderr b/src/test/ui/span/issue-35987.stderr
index e53ea6a55af..a2597aba0bd 100644
--- a/src/test/ui/span/issue-35987.stderr
+++ b/src/test/ui/span/issue-35987.stderr
@@ -7,7 +7,7 @@ error[E0404]: expected trait, found type parameter `Add`
 help: possible better candidate is found in another module, you can import it into scope
    | use std::ops::Add;
 
-error: main function not found
+error[E0601]: main function not found
 
 error: cannot continue compilation due to previous error
 
diff --git a/src/test/ui/token/issue-10636-2.stderr b/src/test/ui/token/issue-10636-2.stderr
index faa30dca945..4b0b05ca65a 100644
--- a/src/test/ui/token/issue-10636-2.stderr
+++ b/src/test/ui/token/issue-10636-2.stderr
@@ -22,7 +22,7 @@ error: expected expression, found `)`
 19 | } //~ ERROR: incorrect close delimiter
    | ^
 
-error: main function not found
+error[E0601]: main function not found
 
 error: aborting due to previous error(s)
 
diff --git a/src/test/ui/token/issue-41155.stderr b/src/test/ui/token/issue-41155.stderr
index 96c2d764e71..56f71a29953 100644
--- a/src/test/ui/token/issue-41155.stderr
+++ b/src/test/ui/token/issue-41155.stderr
@@ -12,7 +12,7 @@ error[E0412]: cannot find type `S` in this scope
 11 | impl S {
    |      ^ not found in this scope
 
-error: main function not found
+error[E0601]: main function not found
 
 error: aborting due to previous error(s)