diff options
| author | Michael Goulet <michael@errs.io> | 2022-08-17 01:28:26 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-08-21 02:35:11 +0000 |
| commit | 24559ce2fedcda97c3273804dc8eb0bf756566eb (patch) | |
| tree | 1f45ea78d973a1a24033c420289977a128bf9ba3 /src | |
| parent | c8746766cb2e375c8b9eeb1bab656aca4cc2a9d1 (diff) | |
| download | rust-24559ce2fedcda97c3273804dc8eb0bf756566eb.tar.gz rust-24559ce2fedcda97c3273804dc8eb0bf756566eb.zip | |
Prefer non-Self non-method types over Self, first
Diffstat (limited to 'src')
8 files changed, 46 insertions, 40 deletions
diff --git a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr index f2f8d84ad3b..b69fcd5d32a 100644 --- a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr +++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr @@ -1,10 +1,10 @@ error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied - --> $DIR/issue-21659-show-relevant-trait-impls-1.rs:24:5 + --> $DIR/issue-21659-show-relevant-trait-impls-1.rs:24:12 | LL | f1.foo(1usize); - | ^^ --- required by a bound introduced by this call - | | - | the trait `Foo<usize>` is not implemented for `Bar` + | --- ^^^^^^ the trait `Foo<usize>` is not implemented for `Bar` + | | + | required by a bound introduced by this call | = help: the following other types implement trait `Foo<A>`: <Bar as Foo<i32>> diff --git a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr index b0c41e2fae1..5e0e4a0115a 100644 --- a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr +++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr @@ -1,10 +1,10 @@ error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied - --> $DIR/issue-21659-show-relevant-trait-impls-2.rs:28:5 + --> $DIR/issue-21659-show-relevant-trait-impls-2.rs:28:12 | LL | f1.foo(1usize); - | ^^ --- required by a bound introduced by this call - | | - | the trait `Foo<usize>` is not implemented for `Bar` + | --- ^^^^^^ the trait `Foo<usize>` is not implemented for `Bar` + | | + | required by a bound introduced by this call | = help: the following other types implement trait `Foo<A>`: <Bar as Foo<i16>> diff --git a/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr b/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr index e2045591390..06e902bca70 100644 --- a/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr +++ b/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr @@ -1,8 +1,10 @@ error[E0277]: the trait bound `E: From<()>` is not satisfied - --> $DIR/never-value-fallback-issue-66757.rs:28:5 + --> $DIR/never-value-fallback-issue-66757.rs:28:26 | LL | <E as From<_>>::from(never); - | ^^^^^^^^^^^^^^^^^^^^ the trait `From<()>` is not implemented for `E` + | -------------------- ^^^^^ the trait `From<()>` is not implemented for `E` + | | + | required by a bound introduced by this call | = help: the trait `From<!>` is implemented for `E` diff --git a/src/test/ui/on-unimplemented/multiple-impls.stderr b/src/test/ui/on-unimplemented/multiple-impls.stderr index ad0cebb3736..8b94c8545ff 100644 --- a/src/test/ui/on-unimplemented/multiple-impls.stderr +++ b/src/test/ui/on-unimplemented/multiple-impls.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied - --> $DIR/multiple-impls.rs:33:18 + --> $DIR/multiple-impls.rs:33:33 | LL | Index::index(&[] as &[i32], 2u32); - | ------------ ^^^^^^^^^^^^^ trait message + | ------------ ^^^^ trait message | | | required by a bound introduced by this call | @@ -23,10 +23,10 @@ LL | Index::index(&[] as &[i32], 2u32); <[i32] as Index<Foo<usize>>> error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied - --> $DIR/multiple-impls.rs:35:18 + --> $DIR/multiple-impls.rs:35:33 | LL | Index::index(&[] as &[i32], Foo(2u32)); - | ------------ ^^^^^^^^^^^^^ on impl for Foo + | ------------ ^^^^^^^^^ on impl for Foo | | | required by a bound introduced by this call | @@ -47,10 +47,10 @@ LL | Index::index(&[] as &[i32], Foo(2u32)); <[i32] as Index<Foo<usize>>> error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied - --> $DIR/multiple-impls.rs:37:18 + --> $DIR/multiple-impls.rs:37:33 | LL | Index::index(&[] as &[i32], Bar(2u32)); - | ------------ ^^^^^^^^^^^^^ on impl for Bar + | ------------ ^^^^^^^^^ on impl for Bar | | | required by a bound introduced by this call | diff --git a/src/test/ui/on-unimplemented/on-impl.stderr b/src/test/ui/on-unimplemented/on-impl.stderr index 769a3d77a57..46902ad30a5 100644 --- a/src/test/ui/on-unimplemented/on-impl.stderr +++ b/src/test/ui/on-unimplemented/on-impl.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied - --> $DIR/on-impl.rs:22:25 + --> $DIR/on-impl.rs:22:47 | LL | Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32); - | ------------------- ^^^^^^^^^^^^^^^^^^^^ a usize is required to index into a slice + | ------------------- ^^^^ a usize is required to index into a slice | | | required by a bound introduced by this call | diff --git a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr index 6ef9ee81a9b..656e0d0bf26 100644 --- a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr +++ b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr @@ -1,22 +1,22 @@ error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfied - --> $DIR/repeated-supertrait-ambig.rs:26:5 + --> $DIR/repeated-supertrait-ambig.rs:26:15 | LL | c.same_as(22) - | ^ ------- required by a bound introduced by this call - | | - | the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts` + | ------- ^^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts` + | | + | required by a bound introduced by this call | = help: the following other types implement trait `CompareTo<T>`: <i64 as CompareTo<i64>> <i64 as CompareTo<u64>> error[E0277]: the trait bound `C: CompareTo<i32>` is not satisfied - --> $DIR/repeated-supertrait-ambig.rs:30:5 + --> $DIR/repeated-supertrait-ambig.rs:30:15 | LL | c.same_as(22) - | ^ ------- required by a bound introduced by this call - | | - | the trait `CompareTo<i32>` is not implemented for `C` + | ------- ^^ the trait `CompareTo<i32>` is not implemented for `C` + | | + | required by a bound introduced by this call | help: consider further restricting this bound | @@ -24,10 +24,10 @@ LL | fn with_trait<C:CompareToInts + CompareTo<i32>>(c: &C) -> bool { | ++++++++++++++++ error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfied - --> $DIR/repeated-supertrait-ambig.rs:34:34 + --> $DIR/repeated-supertrait-ambig.rs:34:37 | LL | <dyn CompareToInts>::same_as(c, 22) - | ---------------------------- ^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts` + | ---------------------------- ^^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts` | | | required by a bound introduced by this call | @@ -36,10 +36,10 @@ LL | <dyn CompareToInts>::same_as(c, 22) <i64 as CompareTo<u64>> error[E0277]: the trait bound `C: CompareTo<i32>` is not satisfied - --> $DIR/repeated-supertrait-ambig.rs:38:24 + --> $DIR/repeated-supertrait-ambig.rs:38:27 | LL | CompareTo::same_as(c, 22) - | ------------------ ^ the trait `CompareTo<i32>` is not implemented for `C` + | ------------------ ^^ the trait `CompareTo<i32>` is not implemented for `C` | | | required by a bound introduced by this call | @@ -49,12 +49,12 @@ LL | fn with_ufcs2<C:CompareToInts + CompareTo<i32>>(c: &C) -> bool { | ++++++++++++++++ error[E0277]: the trait bound `i64: CompareTo<i32>` is not satisfied - --> $DIR/repeated-supertrait-ambig.rs:42:16 + --> $DIR/repeated-supertrait-ambig.rs:42:31 | LL | assert_eq!(22_i64.same_as(22), true); - | ^^^^^^ ------- required by a bound introduced by this call - | | - | the trait `CompareTo<i32>` is not implemented for `i64` + | ------- ^^ the trait `CompareTo<i32>` is not implemented for `i64` + | | + | required by a bound introduced by this call | = help: the following other types implement trait `CompareTo<T>`: <i64 as CompareTo<i64>> diff --git a/src/test/ui/type/type-params-in-different-spaces-2.stderr b/src/test/ui/type/type-params-in-different-spaces-2.stderr index 53610985f31..220b3929c88 100644 --- a/src/test/ui/type/type-params-in-different-spaces-2.stderr +++ b/src/test/ui/type/type-params-in-different-spaces-2.stderr @@ -1,8 +1,10 @@ error[E0277]: the trait bound `Self: Tr<U>` is not satisfied - --> $DIR/type-params-in-different-spaces-2.rs:10:9 + --> $DIR/type-params-in-different-spaces-2.rs:10:16 | LL | Tr::op(u) - | ^^^^^^ the trait `Tr<U>` is not implemented for `Self` + | ------ ^ the trait `Tr<U>` is not implemented for `Self` + | | + | required by a bound introduced by this call | help: consider further restricting `Self` | @@ -10,10 +12,12 @@ LL | fn test<U>(u: U) -> Self where Self: Tr<U> { | +++++++++++++++++ error[E0277]: the trait bound `Self: Tr<U>` is not satisfied - --> $DIR/type-params-in-different-spaces-2.rs:16:9 + --> $DIR/type-params-in-different-spaces-2.rs:16:16 | LL | Tr::op(u) - | ^^^^^^ the trait `Tr<U>` is not implemented for `Self` + | ------ ^ the trait `Tr<U>` is not implemented for `Self` + | | + | required by a bound introduced by this call | help: consider further restricting `Self` | diff --git a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr index 4f721f987ae..f08c81bc1e9 100644 --- a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr +++ b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr @@ -1,8 +1,8 @@ error[E0277]: cannot add `u32` to `i32` - --> $DIR/ufcs-qpath-self-mismatch.rs:4:28 + --> $DIR/ufcs-qpath-self-mismatch.rs:4:31 | LL | <i32 as Add<u32>>::add(1, 2); - | ---------------------- ^ no implementation for `i32 + u32` + | ---------------------- ^ no implementation for `i32 + u32` | | | required by a bound introduced by this call | |
