about summary refs log tree commit diff
path: root/src/test/ui/impl-trait
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-11-20 13:13:27 +0100
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-11-24 11:32:35 +0100
commit8937d6a6cfb011d9e1fe6b4a426913dbbf9fd584 (patch)
tree985b86728dbbcb631149b9f77ba18d435f60f798 /src/test/ui/impl-trait
parent36066d8925940cdd423886a2eec2a096363f5bb8 (diff)
downloadrust-8937d6a6cfb011d9e1fe6b4a426913dbbf9fd584.tar.gz
rust-8937d6a6cfb011d9e1fe6b4a426913dbbf9fd584.zip
Merge cfail and ui tests into ui tests
Diffstat (limited to 'src/test/ui/impl-trait')
-rw-r--r--src/test/ui/impl-trait/equality.rs2
-rw-r--r--src/test/ui/impl-trait/issue-21659-show-relevant-trait-impls-3.rs1
-rw-r--r--src/test/ui/impl-trait/method-suggestion-no-duplication.rs5
-rw-r--r--src/test/ui/impl-trait/no-method-suggested-traits.rs77
-rw-r--r--src/test/ui/impl-trait/no-method-suggested-traits.stderr162
-rw-r--r--src/test/ui/impl-trait/trait_type.rs4
-rw-r--r--src/test/ui/impl-trait/trait_type.stderr12
-rw-r--r--src/test/ui/impl-trait/universal-mismatched-type.rs2
-rw-r--r--src/test/ui/impl-trait/universal-mismatched-type.stderr2
-rw-r--r--src/test/ui/impl-trait/universal-two-impl-traits.rs2
-rw-r--r--src/test/ui/impl-trait/universal-two-impl-traits.stderr2
-rw-r--r--src/test/ui/impl-trait/universal_wrong_bounds.rs6
-rw-r--r--src/test/ui/impl-trait/universal_wrong_bounds.stderr6
13 files changed, 129 insertions, 154 deletions
diff --git a/src/test/ui/impl-trait/equality.rs b/src/test/ui/impl-trait/equality.rs
index 96db53ad2e4..36df4f0eb4d 100644
--- a/src/test/ui/impl-trait/equality.rs
+++ b/src/test/ui/impl-trait/equality.rs
@@ -32,7 +32,7 @@ fn sum_to(n: u32) -> impl Foo {
         0
     } else {
         n + sum_to(n - 1)
-        //~^ ERROR no implementation for `u32 + impl Foo`
+        //~^ ERROR the trait bound `u32: std::ops::Add<impl Foo>` is not satisfied
     }
 }
 
diff --git a/src/test/ui/impl-trait/issue-21659-show-relevant-trait-impls-3.rs b/src/test/ui/impl-trait/issue-21659-show-relevant-trait-impls-3.rs
index 0bb944edb9d..9120cdab598 100644
--- a/src/test/ui/impl-trait/issue-21659-show-relevant-trait-impls-3.rs
+++ b/src/test/ui/impl-trait/issue-21659-show-relevant-trait-impls-3.rs
@@ -30,5 +30,4 @@ fn main() {
     f1.foo(1usize);
     //~^ error: method named `foo` found for type `Bar` in the current scope
     //~| help: items from traits can only be used if the trait is implemented and in scope
-    //~| help: candidate #1: `Foo`
 }
diff --git a/src/test/ui/impl-trait/method-suggestion-no-duplication.rs b/src/test/ui/impl-trait/method-suggestion-no-duplication.rs
index 390b8f07b2f..15ddadf4c51 100644
--- a/src/test/ui/impl-trait/method-suggestion-no-duplication.rs
+++ b/src/test/ui/impl-trait/method-suggestion-no-duplication.rs
@@ -18,8 +18,5 @@ fn foo<F>(f: F) where F: FnMut(Foo) {}
 fn main() {
     foo(|s| s.is_empty());
     //~^ ERROR no method named `is_empty` found
-    //~^^ HELP #1: `std::iter::ExactSizeIterator`
-    //~^^^ HELP #2: `core::slice::SliceExt`
-    //~^^^^ HELP #3: `core::str::StrExt`
-    //~^^^^^ HELP items from traits can only be used if the trait is implemented and in scope; the following traits define an item `is_empty`, perhaps you need to implement one of them:
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
 }
diff --git a/src/test/ui/impl-trait/no-method-suggested-traits.rs b/src/test/ui/impl-trait/no-method-suggested-traits.rs
index 15891b00028..d9866772bdd 100644
--- a/src/test/ui/impl-trait/no-method-suggested-traits.rs
+++ b/src/test/ui/impl-trait/no-method-suggested-traits.rs
@@ -11,7 +11,12 @@
 // aux-build:no_method_suggested_traits.rs
 extern crate no_method_suggested_traits;
 
-struct Foo;
+struct Foo; //~ HELP perhaps add a `use` for it
+//~^ HELP perhaps add a `use` for it
+//~| HELP perhaps add a `use` for it
+//~| HELP perhaps add a `use` for it
+//~| HELP perhaps add a `use` for one of them
+//~| HELP perhaps add a `use` for one of them
 enum Bar { X }
 
 mod foo {
@@ -31,95 +36,65 @@ fn main() {
 
 
     1u32.method();
-    //~^ HELP following traits are implemented but not in scope, perhaps add a `use` for one of them
-    //~| ERROR no method named
-    //~| HELP `use foo::Bar;`
-    //~| HELP `use no_method_suggested_traits::foo::PubPub;`
+    //~^ ERROR no method named
+    //~|items from traits can only be used if the trait is in scope
     std::rc::Rc::new(&mut Box::new(&1u32)).method();
-    //~^ HELP following traits are implemented but not in scope, perhaps add a `use` for one of them
-    //~| ERROR no method named
-    //~| HELP `use foo::Bar;`
-    //~| HELP `use no_method_suggested_traits::foo::PubPub;`
+    //~^items from traits can only be used if the trait is in scope
+    //~| ERROR no method named `method` found for type
 
     'a'.method();
     //~^ ERROR no method named
-    //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
-    //~| HELP `use foo::Bar;`
+    //~| HELP items from traits can only be used if the trait is in scope
     std::rc::Rc::new(&mut Box::new(&'a')).method();
     //~^ ERROR no method named
-    //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
-    //~| HELP `use foo::Bar;`
+    //~| HELP items from traits can only be used if the trait is in scope
 
     1i32.method();
     //~^ ERROR no method named
-    //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
-    //~| HELP `use no_method_suggested_traits::foo::PubPub;`
+    //~| HELP items from traits can only be used if the trait is in scope
     std::rc::Rc::new(&mut Box::new(&1i32)).method();
     //~^ ERROR no method named
-    //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
-    //~| HELP `use no_method_suggested_traits::foo::PubPub;`
+    //~| HELP items from traits can only be used if the trait is in scope
 
     Foo.method();
     //~^ ERROR no method named
-    //~| HELP following traits define an item `method`, perhaps you need to implement one of them
-    //~| HELP `foo::Bar`
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
-    //~| HELP `no_method_suggested_traits::Reexported`
-    //~| HELP `no_method_suggested_traits::bar::PubPriv`
-    //~| HELP `no_method_suggested_traits::qux::PrivPub`
-    //~| HELP `no_method_suggested_traits::quz::PrivPriv`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&Foo)).method();
     //~^ ERROR no method named
-    //~| HELP following traits define an item `method`, perhaps you need to implement one of them
-    //~| HELP `foo::Bar`
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
-    //~| HELP `no_method_suggested_traits::Reexported`
-    //~| HELP `no_method_suggested_traits::bar::PubPriv`
-    //~| HELP `no_method_suggested_traits::qux::PrivPub`
-    //~| HELP `no_method_suggested_traits::quz::PrivPriv`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
 
     1u64.method2();
     //~^ ERROR no method named
-    //~| HELP the following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&1u64)).method2();
     //~^ ERROR no method named
-    //~| HELP the following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
 
     no_method_suggested_traits::Foo.method2();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     no_method_suggested_traits::Bar::X.method2();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
 
     Foo.method3();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method3`, perhaps you need to implement it
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&Foo)).method3();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method3`, perhaps you need to implement it
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     Bar::X.method3();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method3`, perhaps you need to implement it
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method3`, perhaps you need to implement it
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
 
     // should have no help:
     1_usize.method3(); //~ ERROR no method named
diff --git a/src/test/ui/impl-trait/no-method-suggested-traits.stderr b/src/test/ui/impl-trait/no-method-suggested-traits.stderr
index ce9a6fa4e05..2d519c11b94 100644
--- a/src/test/ui/impl-trait/no-method-suggested-traits.stderr
+++ b/src/test/ui/impl-trait/no-method-suggested-traits.stderr
@@ -1,7 +1,7 @@
 error[E0599]: no method named `method` found for type `u32` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:33:10
+  --> $DIR/no-method-suggested-traits.rs:38:10
    |
-33 |     1u32.method();
+38 |     1u32.method();
    |          ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
@@ -17,9 +17,9 @@ help: the following traits are implemented but not in scope, perhaps add a `use`
    |
 
 error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&u32>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:38:44
+  --> $DIR/no-method-suggested-traits.rs:41:44
    |
-38 |     std::rc::Rc::new(&mut Box::new(&1u32)).method();
+41 |     std::rc::Rc::new(&mut Box::new(&1u32)).method();
    |                                            ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
@@ -35,9 +35,9 @@ help: the following traits are implemented but not in scope, perhaps add a `use`
    |
 
 error[E0599]: no method named `method` found for type `char` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:44:9
+  --> $DIR/no-method-suggested-traits.rs:45:9
    |
-44 |     'a'.method();
+45 |     'a'.method();
    |         ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
@@ -59,9 +59,9 @@ help: the following trait is implemented but not in scope, perhaps add a `use` f
    |
 
 error[E0599]: no method named `method` found for type `i32` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:53:10
+  --> $DIR/no-method-suggested-traits.rs:52:10
    |
-53 |     1i32.method();
+52 |     1i32.method();
    |          ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
@@ -71,9 +71,9 @@ help: the following trait is implemented but not in scope, perhaps add a `use` f
    |
 
 error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&i32>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:57:44
+  --> $DIR/no-method-suggested-traits.rs:55:44
    |
-57 |     std::rc::Rc::new(&mut Box::new(&1i32)).method();
+55 |     std::rc::Rc::new(&mut Box::new(&1i32)).method();
    |                                            ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
@@ -83,12 +83,12 @@ help: the following trait is implemented but not in scope, perhaps add a `use` f
    |
 
 error[E0599]: no method named `method` found for type `Foo` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:62:9
+  --> $DIR/no-method-suggested-traits.rs:59:9
    |
-14 | struct Foo;
+14 | struct Foo; //~ HELP perhaps add a `use` for it
    | ----------- method `method` not found for this
 ...
-62 |     Foo.method();
+59 |     Foo.method();
    |         ^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -101,9 +101,9 @@ error[E0599]: no method named `method` found for type `Foo` in the current scope
            candidate #6: `no_method_suggested_traits::Reexported`
 
 error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&Foo>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:71:43
+  --> $DIR/no-method-suggested-traits.rs:62:43
    |
-71 |     std::rc::Rc::new(&mut Box::new(&Foo)).method();
+62 |     std::rc::Rc::new(&mut Box::new(&Foo)).method();
    |                                           ^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -116,9 +116,9 @@ error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::box
            candidate #6: `no_method_suggested_traits::Reexported`
 
 error[E0599]: no method named `method2` found for type `u64` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:81:10
+  --> $DIR/no-method-suggested-traits.rs:66:10
    |
-81 |     1u64.method2();
+66 |     1u64.method2();
    |          ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -126,9 +126,9 @@ error[E0599]: no method named `method2` found for type `u64` in the current scop
            candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::boxed::Box<&u64>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:85:44
+  --> $DIR/no-method-suggested-traits.rs:69:44
    |
-85 |     std::rc::Rc::new(&mut Box::new(&1u64)).method2();
+69 |     std::rc::Rc::new(&mut Box::new(&1u64)).method2();
    |                                            ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -136,9 +136,9 @@ error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::bo
            candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method2` found for type `no_method_suggested_traits::Foo` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:90:37
+  --> $DIR/no-method-suggested-traits.rs:73:37
    |
-90 |     no_method_suggested_traits::Foo.method2();
+73 |     no_method_suggested_traits::Foo.method2();
    |                                     ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -146,9 +146,9 @@ error[E0599]: no method named `method2` found for type `no_method_suggested_trai
            candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:94:71
+  --> $DIR/no-method-suggested-traits.rs:76:71
    |
-94 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
+76 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
    |                                                                       ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -156,9 +156,9 @@ error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::bo
            candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method2` found for type `no_method_suggested_traits::Bar` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:98:40
+  --> $DIR/no-method-suggested-traits.rs:79:40
    |
-98 |     no_method_suggested_traits::Bar::X.method2();
+79 |     no_method_suggested_traits::Bar::X.method2();
    |                                        ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -166,95 +166,95 @@ error[E0599]: no method named `method2` found for type `no_method_suggested_trai
            candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:102:74
-    |
-102 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
-    |                                                                          ^^^^^^^
-    |
-    = help: items from traits can only be used if the trait is implemented and in scope
-    = note: the following trait defines an item `method2`, perhaps you need to implement it:
-            candidate #1: `foo::Bar`
+  --> $DIR/no-method-suggested-traits.rs:82:74
+   |
+82 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
+   |                                                                          ^^^^^^^
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `method2`, perhaps you need to implement it:
+           candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method3` found for type `Foo` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:107:9
-    |
-14  | struct Foo;
-    | ----------- method `method3` not found for this
+  --> $DIR/no-method-suggested-traits.rs:86:9
+   |
+14 | struct Foo; //~ HELP perhaps add a `use` for it
+   | ----------- method `method3` not found for this
 ...
-107 |     Foo.method3();
-    |         ^^^^^^^
-    |
-    = help: items from traits can only be used if the trait is implemented and in scope
-    = note: the following trait defines an item `method3`, perhaps you need to implement it:
-            candidate #1: `no_method_suggested_traits::foo::PubPub`
+86 |     Foo.method3();
+   |         ^^^^^^^
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `method3`, perhaps you need to implement it:
+           candidate #1: `no_method_suggested_traits::foo::PubPub`
 
 error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&Foo>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:111:43
-    |
-111 |     std::rc::Rc::new(&mut Box::new(&Foo)).method3();
-    |                                           ^^^^^^^
-    |
-    = help: items from traits can only be used if the trait is implemented and in scope
-    = note: the following trait defines an item `method3`, perhaps you need to implement it:
-            candidate #1: `no_method_suggested_traits::foo::PubPub`
+  --> $DIR/no-method-suggested-traits.rs:89:43
+   |
+89 |     std::rc::Rc::new(&mut Box::new(&Foo)).method3();
+   |                                           ^^^^^^^
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `method3`, perhaps you need to implement it:
+           candidate #1: `no_method_suggested_traits::foo::PubPub`
 
 error[E0599]: no method named `method3` found for type `Bar` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:115:12
-    |
-15  | enum Bar { X }
-    | -------- method `method3` not found for this
+  --> $DIR/no-method-suggested-traits.rs:92:12
+   |
+20 | enum Bar { X }
+   | -------- method `method3` not found for this
 ...
-115 |     Bar::X.method3();
-    |            ^^^^^^^
-    |
-    = help: items from traits can only be used if the trait is implemented and in scope
-    = note: the following trait defines an item `method3`, perhaps you need to implement it:
-            candidate #1: `no_method_suggested_traits::foo::PubPub`
+92 |     Bar::X.method3();
+   |            ^^^^^^^
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `method3`, perhaps you need to implement it:
+           candidate #1: `no_method_suggested_traits::foo::PubPub`
 
 error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&Bar>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:119:46
-    |
-119 |     std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
-    |                                              ^^^^^^^
-    |
-    = help: items from traits can only be used if the trait is implemented and in scope
-    = note: the following trait defines an item `method3`, perhaps you need to implement it:
-            candidate #1: `no_method_suggested_traits::foo::PubPub`
+  --> $DIR/no-method-suggested-traits.rs:95:46
+   |
+95 |     std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
+   |                                              ^^^^^^^
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `method3`, perhaps you need to implement it:
+           candidate #1: `no_method_suggested_traits::foo::PubPub`
 
 error[E0599]: no method named `method3` found for type `usize` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:125:13
+   --> $DIR/no-method-suggested-traits.rs:100:13
     |
-125 |     1_usize.method3(); //~ ERROR no method named
+100 |     1_usize.method3(); //~ ERROR no method named
     |             ^^^^^^^
 
 error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&usize>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:126:47
+   --> $DIR/no-method-suggested-traits.rs:101:47
     |
-126 |     std::rc::Rc::new(&mut Box::new(&1_usize)).method3(); //~ ERROR no method named
+101 |     std::rc::Rc::new(&mut Box::new(&1_usize)).method3(); //~ ERROR no method named
     |                                               ^^^^^^^
 
 error[E0599]: no method named `method3` found for type `no_method_suggested_traits::Foo` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:127:37
+   --> $DIR/no-method-suggested-traits.rs:102:37
     |
-127 |     no_method_suggested_traits::Foo.method3();  //~ ERROR no method named
+102 |     no_method_suggested_traits::Foo.method3();  //~ ERROR no method named
     |                                     ^^^^^^^
 
 error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:128:71
+   --> $DIR/no-method-suggested-traits.rs:103:71
     |
-128 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3();
+103 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3();
     |                                                                       ^^^^^^^
 
 error[E0599]: no method named `method3` found for type `no_method_suggested_traits::Bar` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:130:40
+   --> $DIR/no-method-suggested-traits.rs:105:40
     |
-130 |     no_method_suggested_traits::Bar::X.method3();  //~ ERROR no method named
+105 |     no_method_suggested_traits::Bar::X.method3();  //~ ERROR no method named
     |                                        ^^^^^^^
 
 error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:131:74
+   --> $DIR/no-method-suggested-traits.rs:106:74
     |
-131 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3();
+106 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3();
     |                                                                          ^^^^^^^
 
 error: aborting due to 24 previous errors
diff --git a/src/test/ui/impl-trait/trait_type.rs b/src/test/ui/impl-trait/trait_type.rs
index 3507dcfbe17..7eefa5c6006 100644
--- a/src/test/ui/impl-trait/trait_type.rs
+++ b/src/test/ui/impl-trait/trait_type.rs
@@ -15,16 +15,20 @@ struct MyType4;
 
 impl std::fmt::Display for MyType {
    fn fmt(&self, x: &str) -> () { }
+   //~^ ERROR method `fmt` has an incompatible type
 }
 
 impl std::fmt::Display for MyType2 {
    fn fmt(&self) -> () { }
+   //~^ ERROR method `fmt` has 1 parameter
 }
 
 impl std::fmt::Display for MyType3 {
    fn fmt() -> () { }
+   //~^ ERROR method `fmt` has a `&self` declaration in the trait
 }
 
 impl std::fmt::Display for MyType4 {}
+//~^ ERROR not all trait items
 
 fn main() {}
diff --git a/src/test/ui/impl-trait/trait_type.stderr b/src/test/ui/impl-trait/trait_type.stderr
index 9216c6e2907..42e1dcdb1c4 100644
--- a/src/test/ui/impl-trait/trait_type.stderr
+++ b/src/test/ui/impl-trait/trait_type.stderr
@@ -8,25 +8,25 @@ error[E0053]: method `fmt` has an incompatible type for trait
               found type `fn(&MyType, &str)`
 
 error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2
-  --> $DIR/trait_type.rs:21:11
+  --> $DIR/trait_type.rs:22:11
    |
-21 |    fn fmt(&self) -> () { }
+22 |    fn fmt(&self) -> () { }
    |           ^^^^^ expected 2 parameters, found 1
    |
    = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
 
 error[E0186]: method `fmt` has a `&self` declaration in the trait, but not in the impl
-  --> $DIR/trait_type.rs:25:4
+  --> $DIR/trait_type.rs:27:4
    |
-25 |    fn fmt() -> () { }
+27 |    fn fmt() -> () { }
    |    ^^^^^^^^^^^^^^^^^^ expected `&self` in impl
    |
    = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
 
 error[E0046]: not all trait items implemented, missing: `fmt`
-  --> $DIR/trait_type.rs:28:1
+  --> $DIR/trait_type.rs:31:1
    |
-28 | impl std::fmt::Display for MyType4 {}
+31 | impl std::fmt::Display for MyType4 {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
    |
    = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
diff --git a/src/test/ui/impl-trait/universal-mismatched-type.rs b/src/test/ui/impl-trait/universal-mismatched-type.rs
index af7adc4c657..00fc22ff0d8 100644
--- a/src/test/ui/impl-trait/universal-mismatched-type.rs
+++ b/src/test/ui/impl-trait/universal-mismatched-type.rs
@@ -13,7 +13,7 @@
 use std::fmt::Debug;
 
 fn foo(x: impl Debug) -> String {
-    x
+    x //~ ERROR mismatched types
 }
 
 fn main() { }
diff --git a/src/test/ui/impl-trait/universal-mismatched-type.stderr b/src/test/ui/impl-trait/universal-mismatched-type.stderr
index 2be24584497..b4dd6c8446c 100644
--- a/src/test/ui/impl-trait/universal-mismatched-type.stderr
+++ b/src/test/ui/impl-trait/universal-mismatched-type.stderr
@@ -3,7 +3,7 @@ error[E0308]: mismatched types
    |
 15 | fn foo(x: impl Debug) -> String {
    |                          ------ expected `std::string::String` because of return type
-16 |     x
+16 |     x //~ ERROR mismatched types
    |     ^ expected struct `std::string::String`, found type parameter
    |
    = note: expected type `std::string::String`
diff --git a/src/test/ui/impl-trait/universal-two-impl-traits.rs b/src/test/ui/impl-trait/universal-two-impl-traits.rs
index f8855a79755..9a4847b5606 100644
--- a/src/test/ui/impl-trait/universal-two-impl-traits.rs
+++ b/src/test/ui/impl-trait/universal-two-impl-traits.rs
@@ -14,7 +14,7 @@ use std::fmt::Debug;
 
 fn foo(x: impl Debug, y: impl Debug) -> String {
     let mut a = x;
-    a = y;
+    a = y; //~ ERROR mismatched
     format!("{:?}", a)
 }
 
diff --git a/src/test/ui/impl-trait/universal-two-impl-traits.stderr b/src/test/ui/impl-trait/universal-two-impl-traits.stderr
index c663d38ca8a..9903e26bbbd 100644
--- a/src/test/ui/impl-trait/universal-two-impl-traits.stderr
+++ b/src/test/ui/impl-trait/universal-two-impl-traits.stderr
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/universal-two-impl-traits.rs:17:9
    |
-17 |     a = y;
+17 |     a = y; //~ ERROR mismatched
    |         ^ expected type parameter, found a different type parameter
    |
    = note: expected type `impl Debug` (type parameter)
diff --git a/src/test/ui/impl-trait/universal_wrong_bounds.rs b/src/test/ui/impl-trait/universal_wrong_bounds.rs
index fd35d04b258..36d9f615c5f 100644
--- a/src/test/ui/impl-trait/universal_wrong_bounds.rs
+++ b/src/test/ui/impl-trait/universal_wrong_bounds.rs
@@ -15,11 +15,11 @@ use std::fmt::Display;
 fn foo(f: impl Display + Clone) -> String {
     wants_debug(f);
     wants_display(f);
-    wants_clone(f);
+    wants_clone(f); //~ ERROR cannot find
 }
 
-fn wants_debug(g: impl Debug) { }
-fn wants_display(g: impl Debug) { }
+fn wants_debug(g: impl Debug) { } //~ ERROR cannot find
+fn wants_display(g: impl Debug) { } //~ ERROR cannot find
 fn wants_cone(g: impl Clone) { }
 
 fn main() {
diff --git a/src/test/ui/impl-trait/universal_wrong_bounds.stderr b/src/test/ui/impl-trait/universal_wrong_bounds.stderr
index 600064c71dc..b457e025c29 100644
--- a/src/test/ui/impl-trait/universal_wrong_bounds.stderr
+++ b/src/test/ui/impl-trait/universal_wrong_bounds.stderr
@@ -1,13 +1,13 @@
 error[E0425]: cannot find function `wants_clone` in this scope
   --> $DIR/universal_wrong_bounds.rs:18:5
    |
-18 |     wants_clone(f);
+18 |     wants_clone(f); //~ ERROR cannot find
    |     ^^^^^^^^^^^ did you mean `wants_cone`?
 
 error[E0405]: cannot find trait `Debug` in this scope
   --> $DIR/universal_wrong_bounds.rs:21:24
    |
-21 | fn wants_debug(g: impl Debug) { }
+21 | fn wants_debug(g: impl Debug) { } //~ ERROR cannot find
    |                        ^^^^^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |
@@ -17,7 +17,7 @@ help: possible candidate is found in another module, you can import it into scop
 error[E0405]: cannot find trait `Debug` in this scope
   --> $DIR/universal_wrong_bounds.rs:22:26
    |
-22 | fn wants_display(g: impl Debug) { }
+22 | fn wants_display(g: impl Debug) { } //~ ERROR cannot find
    |                          ^^^^^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |