Skip to content

Commit ede2ddf

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 bf9c7a6 commit ede2ddf

File tree

739 files changed

+1423
-1403
lines changed

Some content is hidden

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

739 files changed

+1423
-1403
lines changed

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

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4774,21 +4774,23 @@ pub(super) fn get_explanation_based_on_obligation<'tcx>(
47744774
} else {
47754775
String::new()
47764776
};
4777-
match ty_desc {
4778-
Some(desc) => format!(
4779-
"{}the trait `{}` is not implemented for {} `{}`{post}",
4780-
pre_message,
4781-
trait_predicate.print_modifiers_and_trait_path(),
4782-
desc,
4783-
tcx.short_ty_string(trait_ref.skip_binder().self_ty(), &mut None),
4784-
),
4785-
None => format!(
4786-
"{}the trait `{}` is not implemented for `{}`{post}",
4787-
pre_message,
4788-
trait_predicate.print_modifiers_and_trait_path(),
4789-
tcx.short_ty_string(trait_ref.skip_binder().self_ty(), &mut None),
4790-
),
4791-
}
4777+
let desc = match ty_desc {
4778+
Some(desc) => format!(" {desc}"),
4779+
None => String::new(),
4780+
};
4781+
4782+
let pred = tcx.erase_regions(if tcx.features().non_lifetime_binders {
4783+
// We can't erase the lifetime bounds on their own when this feature is enabled.
4784+
// `instantiate_bound_regions_with_erased` expects there to be no type bounds.
4785+
trait_predicate.skip_binder()
4786+
} else {
4787+
tcx.instantiate_bound_regions_with_erased(*trait_predicate)
4788+
});
4789+
format!(
4790+
"{pre_message}the trait `{}` is not implemented for{desc} `{}`{post}",
4791+
pred.print_modifiers_and_trait_path(),
4792+
tcx.short_ty_string(pred.self_ty(), &mut None),
4793+
)
47924794
}
47934795
}
47944796

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2950,7 +2950,24 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
29502950
}
29512951
})
29522952
.unwrap_or_else(|| {
2953-
format!("the trait bound `{trait_predicate}` is not satisfied{post_message}")
2953+
let pred = self.tcx.erase_regions(if self.tcx.features().non_lifetime_binders {
2954+
// We can't erase the lifetime bounds on their own when this feature is enabled.
2955+
// `instantiate_bound_regions_with_erased` expects there to be no type bounds.
2956+
trait_predicate.skip_binder()
2957+
} else {
2958+
self.tcx.instantiate_bound_regions_with_erased(*trait_predicate)
2959+
});
2960+
if let ty::ImplPolarity::Positive = pred.polarity {
2961+
format!(
2962+
"the trait `{}` is not implemented for `{}`{post_message}",
2963+
pred.print_modifiers_and_trait_path(),
2964+
self.tcx.short_ty_string(pred.self_ty(), &mut None),
2965+
)
2966+
} else {
2967+
// "the trait bound `!Send: T` is not satisfied" reads better than "`!Send` is
2968+
// not implemented for `T`".
2969+
format!("the trait bound `{pred}` is not satisfied{post_message}")
2970+
}
29542971
})
29552972
}
29562973

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 `DiagnosticBuilder::<'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)