about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/ui/associated-types/defaults-suitability.stderr93
-rw-r--r--src/test/ui/associated-types/defaults-unsound-62211-1.stderr32
-rw-r--r--src/test/ui/associated-types/defaults-unsound-62211-2.stderr32
-rw-r--r--src/test/ui/associated-types/issue-43924.stderr8
-rw-r--r--src/test/ui/associated-types/issue-54182-1.rs4
-rw-r--r--src/test/ui/associated-types/issue-63593.rs2
-rw-r--r--src/test/ui/associated-types/issue-63593.stderr16
7 files changed, 63 insertions, 124 deletions
diff --git a/src/test/ui/associated-types/defaults-suitability.stderr b/src/test/ui/associated-types/defaults-suitability.stderr
index 9a7febeb62d..dd45c9e4436 100644
--- a/src/test/ui/associated-types/defaults-suitability.stderr
+++ b/src/test/ui/associated-types/defaults-suitability.stderr
@@ -1,154 +1,119 @@
 error[E0277]: the trait bound `NotClone: std::clone::Clone` is not satisfied
   --> $DIR/defaults-suitability.rs:17:14
    |
+LL | trait Tr {
+   | -------- required by `Tr`
 LL |     type Ty: Clone = NotClone;
    |              ^^^^^ the trait `std::clone::Clone` is not implemented for `NotClone`
-   |
-note: required by `Tr`
-  --> $DIR/defaults-suitability.rs:16:1
-   |
-LL | trait Tr {
-   | ^^^^^^^^
 
 error[E0277]: the trait bound `NotClone: std::clone::Clone` is not satisfied
   --> $DIR/defaults-suitability.rs:22:27
    |
 LL | trait Tr2 where Self::Ty: Clone {
-   |                           ^^^^^ the trait `std::clone::Clone` is not implemented for `NotClone`
-   |
-note: required by `Tr2`
-  --> $DIR/defaults-suitability.rs:22:1
-   |
-LL | trait Tr2 where Self::Ty: Clone {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   | --------------------------^^^^^
+   | |                         |
+   | |                         the trait `std::clone::Clone` is not implemented for `NotClone`
+   | required by `Tr2`
 
 error[E0277]: the trait bound `T: std::clone::Clone` is not satisfied
   --> $DIR/defaults-suitability.rs:35:15
    |
+LL | trait Foo<T> {
+   | ------------ required by `Foo`
 LL |     type Bar: Clone = Vec<T>;
    |               ^^^^^ the trait `std::clone::Clone` is not implemented for `T`
    |
    = help: consider adding a `where T: std::clone::Clone` bound
    = note: required because of the requirements on the impl of `std::clone::Clone` for `std::vec::Vec<T>`
-note: required by `Foo`
-  --> $DIR/defaults-suitability.rs:34:1
-   |
-LL | trait Foo<T> {
-   | ^^^^^^^^^^^^
 
 error[E0277]: the trait bound `(): Foo<Self>` is not satisfied
   --> $DIR/defaults-suitability.rs:41:17
    |
+LL | trait Bar: Sized {
+   | ---------------- required by `Bar`
+LL |     // `(): Foo<Self>` might hold for some possible impls but not all.
 LL |     type Assoc: Foo<Self> = ();
    |                 ^^^^^^^^^ the trait `Foo<Self>` is not implemented for `()`
-   |
-note: required by `Bar`
-  --> $DIR/defaults-suitability.rs:39:1
-   |
-LL | trait Bar: Sized {
-   | ^^^^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `NotClone: IsU8<NotClone>` is not satisfied
   --> $DIR/defaults-suitability.rs:61:18
    |
-LL |     Self::Assoc: IsU8<Self::Assoc>,
-   |                  ^^^^^^^^^^^^^^^^^ the trait `IsU8<NotClone>` is not implemented for `NotClone`
-   |
-note: required by `D`
-  --> $DIR/defaults-suitability.rs:58:1
-   |
 LL | / trait D where
 LL | |     Vec<Self::Assoc>: Clone,
 LL | |
 LL | |     Self::Assoc: IsU8<Self::Assoc>,
+   | |                  ^^^^^^^^^^^^^^^^^ the trait `IsU8<NotClone>` is not implemented for `NotClone`
 ...  |
 LL | |     type Assoc = NotClone;
 LL | | }
-   | |_^
+   | |_- required by `D`
 
 error[E0277]: the trait bound `bool: IsU8<NotClone>` is not satisfied
   --> $DIR/defaults-suitability.rs:63:11
    |
-LL |     bool: IsU8<Self::Assoc>,
-   |           ^^^^^^^^^^^^^^^^^ the trait `IsU8<NotClone>` is not implemented for `bool`
-   |
-note: required by `D`
-  --> $DIR/defaults-suitability.rs:58:1
-   |
 LL | / trait D where
 LL | |     Vec<Self::Assoc>: Clone,
 LL | |
 LL | |     Self::Assoc: IsU8<Self::Assoc>,
+LL | |
+LL | |     bool: IsU8<Self::Assoc>,
+   | |           ^^^^^^^^^^^^^^^^^ the trait `IsU8<NotClone>` is not implemented for `bool`
 ...  |
 LL | |     type Assoc = NotClone;
 LL | | }
-   | |_^
+   | |_- required by `D`
 
 error[E0277]: the trait bound `NotClone: std::clone::Clone` is not satisfied
   --> $DIR/defaults-suitability.rs:59:23
    |
-LL |     Vec<Self::Assoc>: Clone,
-   |                       ^^^^^ the trait `std::clone::Clone` is not implemented for `NotClone`
-   |
-   = note: required because of the requirements on the impl of `std::clone::Clone` for `std::vec::Vec<NotClone>`
-note: required by `D`
-  --> $DIR/defaults-suitability.rs:58:1
-   |
 LL | / trait D where
 LL | |     Vec<Self::Assoc>: Clone,
+   | |                       ^^^^^ the trait `std::clone::Clone` is not implemented for `NotClone`
 LL | |
 LL | |     Self::Assoc: IsU8<Self::Assoc>,
 ...  |
 LL | |     type Assoc = NotClone;
 LL | | }
-   | |_^
+   | |_- required by `D`
+   |
+   = note: required because of the requirements on the impl of `std::clone::Clone` for `std::vec::Vec<NotClone>`
 
 error[E0277]: the trait bound `<Self as Foo2<T>>::Baz: std::clone::Clone` is not satisfied
   --> $DIR/defaults-suitability.rs:74:15
    |
+LL | trait Foo2<T> {
+   | ------------- required by `Foo2`
 LL |     type Bar: Clone = Vec<Self::Baz>;
    |               ^^^^^ the trait `std::clone::Clone` is not implemented for `<Self as Foo2<T>>::Baz`
    |
    = help: consider adding a `where <Self as Foo2<T>>::Baz: std::clone::Clone` bound
    = note: required because of the requirements on the impl of `std::clone::Clone` for `std::vec::Vec<<Self as Foo2<T>>::Baz>`
-note: required by `Foo2`
-  --> $DIR/defaults-suitability.rs:73:1
-   |
-LL | trait Foo2<T> {
-   | ^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `<Self as Foo25<T>>::Baz: std::clone::Clone` is not satisfied
   --> $DIR/defaults-suitability.rs:83:15
    |
+LL | trait Foo25<T: Clone> {
+   | --------------------- required by `Foo25`
 LL |     type Bar: Clone = Vec<Self::Baz>;
    |               ^^^^^ the trait `std::clone::Clone` is not implemented for `<Self as Foo25<T>>::Baz`
    |
    = help: consider adding a `where <Self as Foo25<T>>::Baz: std::clone::Clone` bound
    = note: required because of the requirements on the impl of `std::clone::Clone` for `std::vec::Vec<<Self as Foo25<T>>::Baz>`
-note: required by `Foo25`
-  --> $DIR/defaults-suitability.rs:82:1
-   |
-LL | trait Foo25<T: Clone> {
-   | ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `T: std::clone::Clone` is not satisfied
   --> $DIR/defaults-suitability.rs:92:16
    |
-LL |     Self::Baz: Clone,
-   |                ^^^^^ the trait `std::clone::Clone` is not implemented for `T`
-   |
-   = help: consider adding a `where T: std::clone::Clone` bound
-note: required by `Foo3`
-  --> $DIR/defaults-suitability.rs:90:1
-   |
 LL | / trait Foo3<T> where
 LL | |     Self::Bar: Clone,
 LL | |     Self::Baz: Clone,
+   | |                ^^^^^ the trait `std::clone::Clone` is not implemented for `T`
 LL | |
 ...  |
 LL | |     type Baz = T;
 LL | | }
-   | |_^
+   | |_- required by `Foo3`
+   |
+   = help: consider adding a `where T: std::clone::Clone` bound
 
 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
   --> $DIR/defaults-suitability.rs:29:5
diff --git a/src/test/ui/associated-types/defaults-unsound-62211-1.stderr b/src/test/ui/associated-types/defaults-unsound-62211-1.stderr
index 0cad08f6752..e8eb085b791 100644
--- a/src/test/ui/associated-types/defaults-unsound-62211-1.stderr
+++ b/src/test/ui/associated-types/defaults-unsound-62211-1.stderr
@@ -1,57 +1,49 @@
 error[E0277]: the trait bound `Self: std::marker::Copy` is not satisfied
   --> $DIR/defaults-unsound-62211-1.rs:23:18
    |
+LL | trait UncheckedCopy: Sized {
+   | -------------------------- required by `UncheckedCopy`
+...
 LL |     type Output: Copy
    |                  ^^^^ the trait `std::marker::Copy` is not implemented for `Self`
    |
    = help: consider adding a `where Self: std::marker::Copy` bound
-note: required by `UncheckedCopy`
-  --> $DIR/defaults-unsound-62211-1.rs:20:1
-   |
-LL | trait UncheckedCopy: Sized {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: cannot add-assign `&'static str` to `Self`
   --> $DIR/defaults-unsound-62211-1.rs:27:7
    |
+LL | trait UncheckedCopy: Sized {
+   | -------------------------- required by `UncheckedCopy`
+...
 LL |     + AddAssign<&'static str>
    |       ^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `Self += &'static str`
    |
    = help: the trait `std::ops::AddAssign<&'static str>` is not implemented for `Self`
    = help: consider adding a `where Self: std::ops::AddAssign<&'static str>` bound
-note: required by `UncheckedCopy`
-  --> $DIR/defaults-unsound-62211-1.rs:20:1
-   |
-LL | trait UncheckedCopy: Sized {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `Self: std::ops::Deref` is not satisfied
   --> $DIR/defaults-unsound-62211-1.rs:25:7
    |
+LL | trait UncheckedCopy: Sized {
+   | -------------------------- required by `UncheckedCopy`
+...
 LL |     + Deref<Target = str>
    |       ^^^^^^^^^^^^^^^^^^^ the trait `std::ops::Deref` is not implemented for `Self`
    |
    = help: consider adding a `where Self: std::ops::Deref` bound
-note: required by `UncheckedCopy`
-  --> $DIR/defaults-unsound-62211-1.rs:20:1
-   |
-LL | trait UncheckedCopy: Sized {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: `Self` doesn't implement `std::fmt::Display`
   --> $DIR/defaults-unsound-62211-1.rs:30:7
    |
+LL | trait UncheckedCopy: Sized {
+   | -------------------------- required by `UncheckedCopy`
+...
 LL |     + Display = Self;
    |       ^^^^^^^ `Self` cannot be formatted with the default formatter
    |
    = help: the trait `std::fmt::Display` is not implemented for `Self`
    = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
    = help: consider adding a `where Self: std::fmt::Display` bound
-note: required by `UncheckedCopy`
-  --> $DIR/defaults-unsound-62211-1.rs:20:1
-   |
-LL | trait UncheckedCopy: Sized {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: `T` doesn't implement `std::fmt::Display`
   --> $DIR/defaults-unsound-62211-1.rs:43:9
diff --git a/src/test/ui/associated-types/defaults-unsound-62211-2.stderr b/src/test/ui/associated-types/defaults-unsound-62211-2.stderr
index 3a57f7df055..a0b5d6b9cbb 100644
--- a/src/test/ui/associated-types/defaults-unsound-62211-2.stderr
+++ b/src/test/ui/associated-types/defaults-unsound-62211-2.stderr
@@ -1,57 +1,49 @@
 error[E0277]: the trait bound `Self: std::marker::Copy` is not satisfied
   --> $DIR/defaults-unsound-62211-2.rs:23:18
    |
+LL | trait UncheckedCopy: Sized {
+   | -------------------------- required by `UncheckedCopy`
+...
 LL |     type Output: Copy
    |                  ^^^^ the trait `std::marker::Copy` is not implemented for `Self`
    |
    = help: consider adding a `where Self: std::marker::Copy` bound
-note: required by `UncheckedCopy`
-  --> $DIR/defaults-unsound-62211-2.rs:20:1
-   |
-LL | trait UncheckedCopy: Sized {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: cannot add-assign `&'static str` to `Self`
   --> $DIR/defaults-unsound-62211-2.rs:27:7
    |
+LL | trait UncheckedCopy: Sized {
+   | -------------------------- required by `UncheckedCopy`
+...
 LL |     + AddAssign<&'static str>
    |       ^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `Self += &'static str`
    |
    = help: the trait `std::ops::AddAssign<&'static str>` is not implemented for `Self`
    = help: consider adding a `where Self: std::ops::AddAssign<&'static str>` bound
-note: required by `UncheckedCopy`
-  --> $DIR/defaults-unsound-62211-2.rs:20:1
-   |
-LL | trait UncheckedCopy: Sized {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `Self: std::ops::Deref` is not satisfied
   --> $DIR/defaults-unsound-62211-2.rs:25:7
    |
+LL | trait UncheckedCopy: Sized {
+   | -------------------------- required by `UncheckedCopy`
+...
 LL |     + Deref<Target = str>
    |       ^^^^^^^^^^^^^^^^^^^ the trait `std::ops::Deref` is not implemented for `Self`
    |
    = help: consider adding a `where Self: std::ops::Deref` bound
-note: required by `UncheckedCopy`
-  --> $DIR/defaults-unsound-62211-2.rs:20:1
-   |
-LL | trait UncheckedCopy: Sized {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: `Self` doesn't implement `std::fmt::Display`
   --> $DIR/defaults-unsound-62211-2.rs:30:7
    |
+LL | trait UncheckedCopy: Sized {
+   | -------------------------- required by `UncheckedCopy`
+...
 LL |     + Display = Self;
    |       ^^^^^^^ `Self` cannot be formatted with the default formatter
    |
    = help: the trait `std::fmt::Display` is not implemented for `Self`
    = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
    = help: consider adding a `where Self: std::fmt::Display` bound
-note: required by `UncheckedCopy`
-  --> $DIR/defaults-unsound-62211-2.rs:20:1
-   |
-LL | trait UncheckedCopy: Sized {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: `T` doesn't implement `std::fmt::Display`
   --> $DIR/defaults-unsound-62211-2.rs:43:9
diff --git a/src/test/ui/associated-types/issue-43924.stderr b/src/test/ui/associated-types/issue-43924.stderr
index 67a963b5013..75a5b3f3551 100644
--- a/src/test/ui/associated-types/issue-43924.stderr
+++ b/src/test/ui/associated-types/issue-43924.stderr
@@ -1,14 +1,10 @@
 error[E0277]: the trait bound `(dyn std::string::ToString + 'static): std::default::Default` is not satisfied
   --> $DIR/issue-43924.rs:7:15
    |
+LL | trait Foo<T: Default + ToString> {
+   | -------------------------------- required by `Foo`
 LL |     type Out: Default + ToString + ?Sized = dyn ToString;
    |               ^^^^^^^ the trait `std::default::Default` is not implemented for `(dyn std::string::ToString + 'static)`
-   |
-note: required by `Foo`
-  --> $DIR/issue-43924.rs:6:1
-   |
-LL | trait Foo<T: Default + ToString> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `(dyn std::string::ToString + 'static): std::default::Default` is not satisfied
   --> $DIR/issue-43924.rs:10:6
diff --git a/src/test/ui/associated-types/issue-54182-1.rs b/src/test/ui/associated-types/issue-54182-1.rs
index 3e10f3fb7df..1a1e98cbac2 100644
--- a/src/test/ui/associated-types/issue-54182-1.rs
+++ b/src/test/ui/associated-types/issue-54182-1.rs
@@ -21,12 +21,12 @@ macro_rules! overload {
 }
 
 fn main() {
-    let r: () = overload!(42, true);
+    let () = overload!(42, true);
 
     let r: f32 = overload!("Hello world", 13.0);
     assert_eq!(r, 13.0);
 
-    let r: () = overload!(42, true, 42.5);
+    let () = overload!(42, true, 42.5);
 
     let r: i32 = overload!("Hello world", 13.0, 42);
     assert_eq!(r, 42);
diff --git a/src/test/ui/associated-types/issue-63593.rs b/src/test/ui/associated-types/issue-63593.rs
index 1452467f373..8dbc24c0673 100644
--- a/src/test/ui/associated-types/issue-63593.rs
+++ b/src/test/ui/associated-types/issue-63593.rs
@@ -9,3 +9,5 @@ trait MyTrait {
     type This = Self;  //~ error: size for values of type `Self` cannot be known
     fn something<I: Inner<Self::This>>(i: I);
 }
+
+fn main() {}
diff --git a/src/test/ui/associated-types/issue-63593.stderr b/src/test/ui/associated-types/issue-63593.stderr
index ea462eac9b4..37dd52980d9 100644
--- a/src/test/ui/associated-types/issue-63593.stderr
+++ b/src/test/ui/associated-types/issue-63593.stderr
@@ -1,23 +1,15 @@
-error[E0601]: `main` function not found in crate `issue_63593`
-   |
-   = note: consider adding a `main` function to `$DIR/issue-63593.rs`
-
 error[E0277]: the size for values of type `Self` cannot be known at compilation time
   --> $DIR/issue-63593.rs:9:5
    |
+LL | trait MyTrait {
+   | ------------- required by `MyTrait`
 LL |     type This = Self;
    |     ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `Self`
    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
    = help: consider adding a `where Self: std::marker::Sized` bound
-note: required by `MyTrait`
-  --> $DIR/issue-63593.rs:8:1
-   |
-LL | trait MyTrait {
-   | ^^^^^^^^^^^^^
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0277, E0601.
-For more information about an error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0277`.