Skip to content

Commit 3ea12d4

Browse files
committed
Reword E0277 default error message
``` error[E0277]: the trait `Copy` is not implemented for `X` --> $DIR/trait-impl-bound-suggestions.rs:14:52 | LL | fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> { | ^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `X` ```
1 parent af91dd2 commit 3ea12d4

File tree

698 files changed

+1282
-1270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

698 files changed

+1282
-1270
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2941,7 +2941,18 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
29412941
}
29422942
})
29432943
.unwrap_or_else(|| {
2944-
format!("the trait bound `{trait_predicate}` is not satisfied{post_message}")
2944+
if let ty::ImplPolarity::Positive = trait_predicate.polarity() {
2945+
format!(
2946+
"the trait `{}` is not implemented for `{}`{post_message}",
2947+
trait_predicate.print_modifiers_and_trait_path(),
2948+
self.tcx
2949+
.short_ty_string(trait_predicate.skip_binder().self_ty(), &mut None),
2950+
)
2951+
} else {
2952+
// "the trait bound `!Send: T` is not satisfied" reads better than "`!Send` is
2953+
// not implemented for `T`".
2954+
format!("the trait bound `{trait_predicate}` is not satisfied{post_message}")
2955+
}
29452956
})
29462957
}
29472958

tests/incremental/const-generics/hash-tyvid-regression-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ where
2020
{
2121
use std::convert::TryFrom;
2222
<[T; N.get()]>::try_from(())
23-
//~^ error: the trait bound
24-
//~| error: the trait bound
23+
//~^ ERROR the trait `From<()>` is not implemented for `[T; N.get()]`
24+
//~| ERROR the trait `From<()>` is not implemented for `[T; N.get()]`
2525
//~| error: mismatched types
2626
}
2727

tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ where
1111
C: Delegates<FileCap<{ false }>>,
1212
{
1313
writes_to_specific_path(&cap);
14-
//~^ error: the trait bound
14+
//~^ ERROR the trait `Delegates<FileCap<false>>` is not implemented for `&C`
1515
}
1616

1717
fn writes_to_specific_path<C>(cap: &C)

tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ where
1414
[(); { S * 2 }]: Default;
1515

1616
impl<'a, T, const S: usize> Iterator for BufferIter<'a, T, S> {
17-
//~^ error: the trait bound
18-
//~^^ error: unconstrained generic constant
17+
//~^ ERROR the trait `Default` is not implemented for `[(); { S * 2 }]`
18+
//~| ERROR unconstrained generic constant
1919
type Item = &'a T;
2020

2121
fn next(&mut self) -> Option<Self::Item> {
22-
//~^ error: the trait bound
23-
//~^^ error: unconstrained generic constant
22+
//~^ ERROR the trait `Default` is not implemented for `[(); { S * 2 }]`
23+
//~| ERROR unconstrained generic constant
2424
None
2525
}
2626
}

tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct Test {
3434
span: Span,
3535
/// A doc comment
3636
arg: NotIntoDiagnosticArg,
37-
//~^ ERROR the trait bound `NotIntoDiagnosticArg: IntoDiagnosticArg` is not satisfied
37+
//~^ ERROR trait `IntoDiagnosticArg` is not implemented for `NotIntoDiagnosticArg`
3838
}
3939

4040
#[derive(Subdiagnostic)]
@@ -44,5 +44,5 @@ struct SubTest {
4444
span: Span,
4545
/// A doc comment
4646
arg: NotIntoDiagnosticArg,
47-
//~^ ERROR the trait bound `NotIntoDiagnosticArg: IntoDiagnosticArg` is not satisfied
47+
//~^ ERROR trait `IntoDiagnosticArg` is not implemented for `NotIntoDiagnosticArg`
4848
}

tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `NotIntoDiagnosticArg: IntoDiagnosticArg` is not satisfied
1+
error[E0277]: the trait `IntoDiagnosticArg` is not implemented for `NotIntoDiagnosticArg`
22
--> $DIR/diagnostic-derive-doc-comment-field.rs:36:10
33
|
44
LL | #[derive(Diagnostic)]
@@ -12,7 +12,7 @@ note: required by a bound in `Diag::<'a, G>::arg`
1212
--> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
1313
= note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
1414

15-
error[E0277]: the trait bound `NotIntoDiagnosticArg: IntoDiagnosticArg` is not satisfied
15+
error[E0277]: the trait `IntoDiagnosticArg` is not implemented for `NotIntoDiagnosticArg`
1616
--> $DIR/diagnostic-derive-doc-comment-field.rs:46:10
1717
|
1818
LL | #[derive(Subdiagnostic)]

tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ struct ArgFieldWithoutSkip {
347347
#[primary_span]
348348
span: Span,
349349
other: Hello,
350-
//~^ ERROR the trait bound `Hello: IntoDiagnosticArg` is not satisfied
350+
//~^ ERROR trait `IntoDiagnosticArg` is not implemented for `Hello`
351351
}
352352

353353
#[derive(Diagnostic)]

tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ LL | #[derive(Diagnostic)]
618618
|
619619
= note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
620620

621-
error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
621+
error[E0277]: the trait `IntoDiagnosticArg` is not implemented for `Hello`
622622
--> $DIR/diagnostic-derive.rs:349:12
623623
|
624624
LL | #[derive(Diagnostic)]

tests/ui/allocator/not-an-allocator.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
1+
error[E0277]: the trait `GlobalAlloc` is not implemented for `usize`
22
--> $DIR/not-an-allocator.rs:2:11
33
|
44
LL | #[global_allocator]
@@ -9,7 +9,7 @@ LL | static A: usize = 0;
99
= help: the trait `GlobalAlloc` is implemented for `System`
1010
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
1111

12-
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
12+
error[E0277]: the trait `GlobalAlloc` is not implemented for `usize`
1313
--> $DIR/not-an-allocator.rs:2:11
1414
|
1515
LL | #[global_allocator]
@@ -21,7 +21,7 @@ LL | static A: usize = 0;
2121
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2222
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
2323

24-
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
24+
error[E0277]: the trait `GlobalAlloc` is not implemented for `usize`
2525
--> $DIR/not-an-allocator.rs:2:11
2626
|
2727
LL | #[global_allocator]
@@ -33,7 +33,7 @@ LL | static A: usize = 0;
3333
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3434
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
3535

36-
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
36+
error[E0277]: the trait `GlobalAlloc` is not implemented for `usize`
3737
--> $DIR/not-an-allocator.rs:2:11
3838
|
3939
LL | #[global_allocator]

tests/ui/array-slice-vec/repeat_empty_ok.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ pub struct Header<'a> {
66

77
pub fn test() {
88
let headers = [Header{value: &[]}; 128];
9-
//~^ ERROR the trait bound
9+
//~^ ERROR the trait
1010
}
1111

1212
pub fn test2() {
1313
let headers = [Header{value: &[0]}; 128];
14-
//~^ ERROR the trait bound
14+
//~^ ERROR the trait
1515
}

tests/ui/array-slice-vec/repeat_empty_ok.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `Header<'_>: Copy` is not satisfied
1+
error[E0277]: the trait `Copy` is not implemented for `Header<'_>`
22
--> $DIR/repeat_empty_ok.rs:8:20
33
|
44
LL | let headers = [Header{value: &[]}; 128];
@@ -13,7 +13,7 @@ LL + #[derive(Copy)]
1313
LL | pub struct Header<'a> {
1414
|
1515

16-
error[E0277]: the trait bound `Header<'_>: Copy` is not satisfied
16+
error[E0277]: the trait `Copy` is not implemented for `Header<'_>`
1717
--> $DIR/repeat_empty_ok.rs:13:20
1818
|
1919
LL | let headers = [Header{value: &[0]}; 128];

tests/ui/associated-consts/associated-const-array-len.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ trait Foo {
33
}
44

55
const X: [i32; <i32 as Foo>::ID] = [0, 1, 2];
6-
//~^ ERROR the trait bound `i32: Foo` is not satisfied
6+
//~^ ERROR trait `Foo` is not implemented for `i32`
77

88
fn main() {
99
assert_eq!(1, X);

tests/ui/associated-consts/associated-const-array-len.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `i32: Foo` is not satisfied
1+
error[E0277]: the trait `Foo` is not implemented for `i32`
22
--> $DIR/associated-const-array-len.rs:5:17
33
|
44
LL | const X: [i32; <i32 as Foo>::ID] = [0, 1, 2];

tests/ui/associated-consts/issue-105330.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ impl TraitWAssocConst for impl Demo { //~ ERROR E0404
1010

1111
fn foo<A: TraitWAssocConst<A=32>>() { //~ ERROR E0658
1212
foo::<Demo>()();
13-
//~^ ERROR is not satisfied
13+
//~^ ERROR is not implemented
1414
//~| ERROR type mismatch
1515
//~| ERROR expected function, found `()`
1616
}
@@ -20,5 +20,5 @@ fn main<A: TraitWAssocConst<A=32>>() {
2020
//~| ERROR E0131
2121
foo::<Demo>();
2222
//~^ ERROR type mismatch
23-
//~| ERROR is not satisfied
23+
//~| ERROR is not implemented
2424
}

tests/ui/associated-consts/issue-105330.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ error[E0131]: `main` function is not allowed to have generic parameters
4949
LL | fn main<A: TraitWAssocConst<A=32>>() {
5050
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `main` cannot have generic parameters
5151

52-
error[E0277]: the trait bound `Demo: TraitWAssocConst` is not satisfied
52+
error[E0277]: the trait `TraitWAssocConst` is not implemented for `Demo`
5353
--> $DIR/issue-105330.rs:12:11
5454
|
5555
LL | foo::<Demo>()();
@@ -86,7 +86,7 @@ LL | foo::<Demo>()();
8686
| |
8787
| call expression requires function
8888

89-
error[E0277]: the trait bound `Demo: TraitWAssocConst` is not satisfied
89+
error[E0277]: the trait `TraitWAssocConst` is not implemented for `Demo`
9090
--> $DIR/issue-105330.rs:21:11
9191
|
9292
LL | foo::<Demo>();

tests/ui/associated-inherent-types/generic-associated-types-bad.item.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `String: Copy` is not satisfied
1+
error[E0277]: the trait `Copy` is not implemented for `String`
22
--> $DIR/generic-associated-types-bad.rs:16:10
33
|
44
LL | const _: Ty::Pr<String> = String::new();
@@ -10,7 +10,7 @@ note: required by a bound in `Ty::Pr`
1010
LL | type Pr<T: Copy> = T;
1111
| ^^^^ required by this bound in `Ty::Pr`
1212

13-
error[E0277]: the trait bound `String: Copy` is not satisfied
13+
error[E0277]: the trait `Copy` is not implemented for `String`
1414
--> $DIR/generic-associated-types-bad.rs:16:27
1515
|
1616
LL | const _: Ty::Pr<String> = String::new();

tests/ui/associated-inherent-types/generic-associated-types-bad.local.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `Vec<()>: Copy` is not satisfied
1+
error[E0277]: the trait `Copy` is not implemented for `Vec<()>`
22
--> $DIR/generic-associated-types-bad.rs:21:12
33
|
44
LL | let _: Ty::Pr<Vec<()>>;

tests/ui/associated-inherent-types/generic-associated-types-bad.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ impl Ty {
1313
}
1414

1515
#[cfg(item)]
16-
const _: Ty::Pr<String> = String::new(); //[item]~ the trait bound `String: Copy` is not satisfied
17-
//[item]~^ the trait bound `String: Copy` is not satisfied
16+
const _: Ty::Pr<String> = String::new(); //[item]~ ERROR trait `Copy` is not implemented for `String`
17+
//[item]~^ ERROR trait `Copy` is not implemented for `String`
1818

1919
fn main() {
2020
#[cfg(local)]
21-
let _: Ty::Pr<Vec<()>>; //[local]~ ERROR the trait bound `Vec<()>: Copy` is not satisfied
21+
let _: Ty::Pr<Vec<()>>; //[local]~ ERROR trait `Copy` is not implemented for `Vec<()>`
2222
}
2323

2424
fn user<'a>() {

tests/ui/associated-inherent-types/unsatisfied-bounds-inferred-type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ impl<T: Copy> S<T> {
88
}
99

1010
fn main() {
11-
let _: S<_>::T = String::new(); //~ ERROR the trait bound `String: Copy` is not satisfied
11+
let _: S<_>::T = String::new(); //~ ERROR trait `Copy` is not implemented for `String`
1212
}

tests/ui/associated-inherent-types/unsatisfied-bounds-inferred-type.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `String: Copy` is not satisfied
1+
error[E0277]: the trait `Copy` is not implemented for `String`
22
--> $DIR/unsatisfied-bounds-inferred-type.rs:11:12
33
|
44
LL | let _: S<_>::T = String::new();

tests/ui/associated-inherent-types/unsatisfied-bounds-where-clause-on-assoc-ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ impl<T> S<T> {
1010
}
1111

1212
fn main() {
13-
let _: S::<String>::X; //~ ERROR the trait bound `String: Copy` is not satisfied
13+
let _: S::<String>::X; //~ ERROR trait `Copy` is not implemented for `String`
1414
}

tests/ui/associated-inherent-types/unsatisfied-bounds-where-clause-on-assoc-ty.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `String: Copy` is not satisfied
1+
error[E0277]: the trait `Copy` is not implemented for `String`
22
--> $DIR/unsatisfied-bounds-where-clause-on-assoc-ty.rs:13:12
33
|
44
LL | let _: S::<String>::X;

tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ trait Add<RHS=Self> {
2121
fn ice<A>(a: A) {
2222
let r = loop {};
2323
r = r + a;
24-
//~^ ERROR the trait bound `(): Add<A>` is not satisfied
24+
//~^ ERROR trait `Add<A>` is not implemented for `()`
2525
}

tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `(): Add<A>` is not satisfied
1+
error[E0277]: the trait `Add<A>` is not implemented for `()`
22
--> $DIR/associated-types-ICE-when-projecting-out-of-err.rs:23:11
33
|
44
LL | r = r + a;

tests/ui/associated-types/associated-types-bound-failure.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `<G as GetToInt>::R: ToInt` is not satisfied
1+
error[E0277]: the trait `ToInt` is not implemented for `<G as GetToInt>::R`
22
--> $DIR/associated-types-bound-failure.rs:19:19
33
|
44
LL | ToInt::to_int(&g.get())

tests/ui/associated-types/associated-types-for-unimpl-trait.fixed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ trait Get {
99

1010
trait Other {
1111
fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Sized, Self: Get, Self: Get {}
12-
//~^ ERROR the trait bound `Self: Get` is not satisfied
13-
//~| ERROR the trait bound `Self: Get` is not satisfied
12+
//~^ ERROR trait `Get` is not implemented for `Self`
13+
//~| ERROR trait `Get` is not implemented for `Self`
1414
}
1515

1616
fn main() {}

tests/ui/associated-types/associated-types-for-unimpl-trait.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ trait Get {
99

1010
trait Other {
1111
fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Sized {}
12-
//~^ ERROR the trait bound `Self: Get` is not satisfied
13-
//~| ERROR the trait bound `Self: Get` is not satisfied
12+
//~^ ERROR trait `Get` is not implemented for `Self`
13+
//~| ERROR trait `Get` is not implemented for `Self`
1414
}
1515

1616
fn main() {}

tests/ui/associated-types/associated-types-for-unimpl-trait.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `Self: Get` is not satisfied
1+
error[E0277]: the trait `Get` is not implemented for `Self`
22
--> $DIR/associated-types-for-unimpl-trait.rs:11:41
33
|
44
LL | fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Sized {}
@@ -9,7 +9,7 @@ help: consider further restricting `Self`
99
LL | fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Sized, Self: Get {}
1010
| +++++++++++
1111

12-
error[E0277]: the trait bound `Self: Get` is not satisfied
12+
error[E0277]: the trait `Get` is not implemented for `Self`
1313
--> $DIR/associated-types-for-unimpl-trait.rs:11:81
1414
|
1515
LL | fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Sized {}

tests/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ trait Foo<T> {
88

99
fn f<T:Foo<isize>>(t: &T) {
1010
let u: <T as Foo<usize>>::Bar = t.get_bar();
11-
//~^ ERROR the trait bound `T: Foo<usize>` is not satisfied
11+
//~^ ERROR trait `Foo<usize>` is not implemented for `T`
1212
}
1313

1414
fn main() { }

tests/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `T: Foo<usize>` is not satisfied
1+
error[E0277]: the trait `Foo<usize>` is not implemented for `T`
22
--> $DIR/associated-types-invalid-trait-ref-issue-18865.rs:10:13
33
|
44
LL | let u: <T as Foo<usize>>::Bar = t.get_bar();

tests/ui/associated-types/associated-types-no-suitable-bound.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ struct Struct {
99

1010
impl Struct {
1111
fn uhoh<T>(foo: <T as Get>::Value) {}
12-
//~^ ERROR the trait bound `T: Get` is not satisfied
13-
//~| ERROR the trait bound `T: Get` is not satisfied
12+
//~^ ERROR trait `Get` is not implemented for `T`
13+
//~| ERROR trait `Get` is not implemented for `T`
1414
}
1515

1616
fn main() {}

tests/ui/associated-types/associated-types-no-suitable-bound.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait bound `T: Get` is not satisfied
1+
error[E0277]: the trait `Get` is not implemented for `T`
22
--> $DIR/associated-types-no-suitable-bound.rs:11:21
33
|
44
LL | fn uhoh<T>(foo: <T as Get>::Value) {}
@@ -9,7 +9,7 @@ help: consider restricting type parameter `T`
99
LL | fn uhoh<T: Get>(foo: <T as Get>::Value) {}
1010
| +++++
1111

12-
error[E0277]: the trait bound `T: Get` is not satisfied
12+
error[E0277]: the trait `Get` is not implemented for `T`
1313
--> $DIR/associated-types-no-suitable-bound.rs:11:40
1414
|
1515
LL | fn uhoh<T>(foo: <T as Get>::Value) {}

tests/ui/associated-types/associated-types-no-suitable-supertrait-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ trait Get {
1515

1616
trait Other {
1717
fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
18-
//~^ ERROR the trait bound `Self: Get` is not satisfied
19-
//~| ERROR the trait bound `Self: Get` is not satisfied
18+
//~^ ERROR trait `Get` is not implemented for `Self`
19+
//~| ERROR trait `Get` is not implemented for `Self`
2020
}
2121

2222
fn main() { }

0 commit comments

Comments
 (0)