Skip to content

Commit 25fe474

Browse files
Note concrete type being coerced into object
1 parent c06d8f9 commit 25fe474

28 files changed

+50
-49
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -2217,9 +2217,10 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
22172217
err.span_note(tcx.def_span(item_def_id), &descr);
22182218
}
22192219
}
2220-
ObligationCauseCode::ObjectCastObligation(_, object_ty) => {
2220+
ObligationCauseCode::ObjectCastObligation(concrete_ty, object_ty) => {
22212221
err.note(&format!(
2222-
"required for the cast to the object type `{}`",
2222+
"required for the cast from `{}` to the object type `{}`",
2223+
self.ty_to_string(concrete_ty),
22232224
self.ty_to_string(object_ty)
22242225
));
22252226
}

src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `String: Copy` is not satisfied
44
LL | Box::new(AssocNoCopy)
55
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
66
|
7-
= note: required for the cast to the object type `dyn Bar<Assoc = <AssocNoCopy as Thing>::Out::{opaque#0}>`
7+
= note: required for the cast from `AssocNoCopy` to the object type `dyn Bar<Assoc = <AssocNoCopy as Thing>::Out::{opaque#0}>`
88

99
error: aborting due to previous error
1010

src/test/ui/associated-types/associated-types-eq-3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ note: expected this to be `Bar`
4141
|
4242
LL | type A = usize;
4343
| ^^^^^
44-
= note: required for the cast to the object type `dyn Foo<A = Bar>`
44+
= note: required for the cast from `isize` to the object type `dyn Foo<A = Bar>`
4545

4646
error: aborting due to 3 previous errors
4747

src/test/ui/associated-types/associated-types-overridden-binding-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0271]: type mismatch resolving `<std::vec::IntoIter<u32> as Iterator>::It
44
LL | let _: &dyn I32Iterator<Item = u32> = &vec![42].into_iter();
55
| ^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
66
|
7-
= note: required for the cast to the object type `dyn Iterator<Item = u32, Item = i32>`
7+
= note: required for the cast from `std::vec::IntoIter<u32>` to the object type `dyn Iterator<Item = u32, Item = i32>`
88

99
error: aborting due to previous error
1010

src/test/ui/associated-types/issue-65774-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ note: required because of the requirements on the impl of `MyDisplay` for `&mut
2323
|
2424
LL | impl<'a, T: MyDisplay> MyDisplay for &'a mut T { }
2525
| ^^^^^^^^^ ^^^^^^^^^
26-
= note: required for the cast to the object type `dyn MyDisplay`
26+
= note: required for the cast from `&mut T` to the object type `dyn MyDisplay`
2727

2828
error: aborting due to 2 previous errors
2929

src/test/ui/associated-types/issue-65774-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | writer.my_write(valref)
1818
| ^^^^^^ the trait `MyDisplay` is not implemented for `T`
1919
|
2020
= help: the trait `MyDisplay` is implemented for `&'a mut T`
21-
= note: required for the cast to the object type `dyn MyDisplay`
21+
= note: required for the cast from `T` to the object type `dyn MyDisplay`
2222

2323
error: aborting due to 2 previous errors
2424

src/test/ui/async-await/async-block-control-flow-static-semantics.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ error[E0271]: type mismatch resolving `<impl Future<Output = u8> as Future>::Out
3737
LL | let _: &dyn Future<Output = ()> = &block;
3838
| ^^^^^^ expected `()`, found `u8`
3939
|
40-
= note: required for the cast to the object type `dyn Future<Output = ()>`
40+
= note: required for the cast from `impl Future<Output = u8>` to the object type `dyn Future<Output = ()>`
4141

4242
error[E0308]: mismatched types
4343
--> $DIR/async-block-control-flow-static-semantics.rs:12:43
@@ -53,7 +53,7 @@ error[E0271]: type mismatch resolving `<impl Future<Output = u8> as Future>::Out
5353
LL | let _: &dyn Future<Output = ()> = &block;
5454
| ^^^^^^ expected `()`, found `u8`
5555
|
56-
= note: required for the cast to the object type `dyn Future<Output = ()>`
56+
= note: required for the cast from `impl Future<Output = u8>` to the object type `dyn Future<Output = ()>`
5757

5858
error[E0308]: mismatched types
5959
--> $DIR/async-block-control-flow-static-semantics.rs:47:44

src/test/ui/async-await/issue-86507.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ note: captured value is not `Send` because `&` references cannot be sent unless
1313
|
1414
LL | let x = x;
1515
| ^ has type `&T` which is not `Send`, because `T` is not `Sync`
16-
= note: required for the cast to the object type `dyn Future<Output = ()> + Send`
16+
= note: required for the cast from `impl Future<Output = ()>` to the object type `dyn Future<Output = ()> + Send`
1717
help: consider further restricting this bound
1818
|
1919
LL | fn bar<'me, 'async_trait, T: Send + std::marker::Sync>(x: &'me T)

src/test/ui/coercion/coerce-issue-49593-box-never.nofallback.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ error[E0277]: the trait bound `(): std::error::Error` is not satisfied
44
LL | /* *mut $0 is coerced to Box<dyn Error> here */ Box::<_ /* ! */>::new(x)
55
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
66
|
7-
= note: required for the cast to the object type `dyn std::error::Error`
7+
= note: required for the cast from `()` to the object type `dyn std::error::Error`
88

99
error[E0277]: the trait bound `(): std::error::Error` is not satisfied
1010
--> $DIR/coerce-issue-49593-box-never.rs:23:49
1111
|
1212
LL | /* *mut $0 is coerced to *mut Error here */ raw_ptr_box::<_ /* ! */>(x)
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
1414
|
15-
= note: required for the cast to the object type `(dyn std::error::Error + 'static)`
15+
= note: required for the cast from `()` to the object type `(dyn std::error::Error + 'static)`
1616

1717
error: aborting due to 2 previous errors
1818

src/test/ui/const-generics/defaults/trait_objects_fail.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | foo(&10_u32);
77
| required by a bound introduced by this call
88
|
99
= help: the trait `Trait<2_u8>` is implemented for `u32`
10-
= note: required for the cast to the object type `dyn Trait`
10+
= note: required for the cast from `u32` to the object type `dyn Trait`
1111

1212
error[E0277]: the trait bound `bool: Traitor<{_: u8}>` is not satisfied
1313
--> $DIR/trait_objects_fail.rs:28:9
@@ -18,7 +18,7 @@ LL | bar(&true);
1818
| required by a bound introduced by this call
1919
|
2020
= help: the trait `Traitor<2_u8, 3_u8>` is implemented for `bool`
21-
= note: required for the cast to the object type `dyn Traitor<{_: u8}>`
21+
= note: required for the cast from `bool` to the object type `dyn Traitor<{_: u8}>`
2222

2323
error: aborting due to 2 previous errors
2424

src/test/ui/custom_test_frameworks/mismatch.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | #[test]
66
LL | fn wrong_kind(){}
77
| ^^^^^^^^^^^^^^^^^ the trait `Testable` is not implemented for `TestDescAndFn`
88
|
9-
= note: required for the cast to the object type `dyn Testable`
9+
= note: required for the cast from `TestDescAndFn` to the object type `dyn Testable`
1010
= note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
1111

1212
error: aborting due to previous error

src/test/ui/dst/dst-bad-coerce1.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ error[E0277]: the trait bound `Foo: Bar` is not satisfied
1515
LL | let f3: &Fat<dyn Bar> = f2;
1616
| ^^ the trait `Bar` is not implemented for `Foo`
1717
|
18-
= note: required for the cast to the object type `dyn Bar`
18+
= note: required for the cast from `Foo` to the object type `dyn Bar`
1919

2020
error[E0308]: mismatched types
2121
--> $DIR/dst-bad-coerce1.rs:28:27
@@ -34,7 +34,7 @@ error[E0277]: the trait bound `Foo: Bar` is not satisfied
3434
LL | let f3: &(dyn Bar,) = f2;
3535
| ^^ the trait `Bar` is not implemented for `Foo`
3636
|
37-
= note: required for the cast to the object type `dyn Bar`
37+
= note: required for the cast from `Foo` to the object type `dyn Bar`
3838

3939
error: aborting due to 4 previous errors
4040

src/test/ui/dst/dst-object-from-unsized-type.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn test1<T: ?Sized + Foo>(t: &T) {
66
LL | let u: &dyn Foo = t;
77
| ^ doesn't have a size known at compile-time
88
|
9-
= note: required for the cast to the object type `dyn Foo`
9+
= note: required for the cast from `T` to the object type `dyn Foo`
1010
help: consider removing the `?Sized` bound to make the type parameter `Sized`
1111
|
1212
LL - fn test1<T: ?Sized + Foo>(t: &T) {
@@ -21,7 +21,7 @@ LL | fn test2<T: ?Sized + Foo>(t: &T) {
2121
LL | let v: &dyn Foo = t as &dyn Foo;
2222
| ^ doesn't have a size known at compile-time
2323
|
24-
= note: required for the cast to the object type `dyn Foo`
24+
= note: required for the cast from `T` to the object type `dyn Foo`
2525
help: consider removing the `?Sized` bound to make the type parameter `Sized`
2626
|
2727
LL - fn test2<T: ?Sized + Foo>(t: &T) {
@@ -35,7 +35,7 @@ LL | let _: &[&dyn Foo] = &["hi"];
3535
| ^^^^ doesn't have a size known at compile-time
3636
|
3737
= help: the trait `Sized` is not implemented for `str`
38-
= note: required for the cast to the object type `dyn Foo`
38+
= note: required for the cast from `str` to the object type `dyn Foo`
3939

4040
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
4141
--> $DIR/dst-object-from-unsized-type.rs:23:23
@@ -44,7 +44,7 @@ LL | let _: &dyn Foo = x as &dyn Foo;
4444
| ^ doesn't have a size known at compile-time
4545
|
4646
= help: the trait `Sized` is not implemented for `[u8]`
47-
= note: required for the cast to the object type `dyn Foo`
47+
= note: required for the cast from `[u8]` to the object type `dyn Foo`
4848

4949
error: aborting due to 4 previous errors
5050

src/test/ui/generic-associated-types/issue-79422.extended.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ LL | type VRefCont<'a> = &'a V where Self: 'a;
2727
| ^^^^^
2828
= note: expected trait object `(dyn RefCont<'_, u8> + 'static)`
2929
found reference `&u8`
30-
= note: required for the cast to the object type `dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>`
30+
= note: required for the cast from `BTreeMap<u8, u8>` to the object type `dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>`
3131

3232
error: aborting due to 2 previous errors
3333

src/test/ui/issues/issue-14366.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let _x = "test" as &dyn (::std::any::Any);
55
| ^^^^^^ doesn't have a size known at compile-time
66
|
77
= help: the trait `Sized` is not implemented for `str`
8-
= note: required for the cast to the object type `dyn Any`
8+
= note: required for the cast from `str` to the object type `dyn Any`
99
help: consider borrowing the value, since `&str` can be coerced into `dyn Any`
1010
|
1111
LL | let _x = &"test" as &dyn (::std::any::Any);

src/test/ui/issues/issue-22034.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | &mut *(ptr as *mut dyn Fn())
66
|
77
= help: the trait `Fn<()>` is not implemented for `()`
88
= note: wrap the `()` in a closure with no arguments: `|| { /* code */ }`
9-
= note: required for the cast to the object type `dyn Fn()`
9+
= note: required for the cast from `()` to the object type `dyn Fn()`
1010

1111
error: aborting due to previous error
1212

src/test/ui/issues/issue-22872.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: required because of the requirements on the impl of `for<'b> Wrap<'b>` for
1010
|
1111
LL | impl<'b, P> Wrap<'b> for Wrapper<P>
1212
| ^^^^^^^^ ^^^^^^^^^^
13-
= note: required for the cast to the object type `dyn for<'b> Wrap<'b>`
13+
= note: required for the cast from `Wrapper<P>` to the object type `dyn for<'b> Wrap<'b>`
1414
help: consider further restricting the associated type
1515
|
1616
LL | fn push_process<P>(process: P) where P: Process<'static>, <P as Process<'_>>::Item: Iterator {

src/test/ui/issues/issue-7013.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: required because it appears within the type `B`
1111
|
1212
LL | struct B {
1313
| ^
14-
= note: required for the cast to the object type `dyn Foo + Send`
14+
= note: required for the cast from `B` to the object type `dyn Foo + Send`
1515

1616
error: aborting due to previous error
1717

src/test/ui/kindck/kindck-impl-type-params.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T
99
|
1010
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
1111
| ^^^^^^^^^^^ ^^^^
12-
= note: required for the cast to the object type `dyn Gettable<T>`
12+
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
1313
help: consider restricting type parameter `T`
1414
|
1515
LL | fn f<T: std::marker::Send>(val: T) {
@@ -26,7 +26,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T
2626
|
2727
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
2828
| ^^^^^^^^^^^ ^^^^
29-
= note: required for the cast to the object type `dyn Gettable<T>`
29+
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
3030
help: consider restricting type parameter `T`
3131
|
3232
LL | fn f<T: std::marker::Copy>(val: T) {
@@ -43,7 +43,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T
4343
|
4444
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
4545
| ^^^^^^^^^^^ ^^^^
46-
= note: required for the cast to the object type `dyn Gettable<T>`
46+
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
4747
help: consider restricting type parameter `T`
4848
|
4949
LL | fn g<T: std::marker::Send>(val: T) {
@@ -60,7 +60,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T
6060
|
6161
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
6262
| ^^^^^^^^^^^ ^^^^
63-
= note: required for the cast to the object type `dyn Gettable<T>`
63+
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
6464
help: consider restricting type parameter `T`
6565
|
6666
LL | fn g<T: std::marker::Copy>(val: T) {
@@ -78,7 +78,7 @@ note: required because of the requirements on the impl of `Gettable<String>` for
7878
|
7979
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
8080
| ^^^^^^^^^^^ ^^^^
81-
= note: required for the cast to the object type `dyn Gettable<String>`
81+
= note: required for the cast from `S<String>` to the object type `dyn Gettable<String>`
8282

8383
error[E0277]: the trait bound `Foo: Copy` is not satisfied
8484
--> $DIR/kindck-impl-type-params.rs:43:37
@@ -92,7 +92,7 @@ note: required because of the requirements on the impl of `Gettable<Foo>` for `S
9292
|
9393
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
9494
| ^^^^^^^^^^^ ^^^^
95-
= note: required for the cast to the object type `dyn Gettable<Foo>`
95+
= note: required for the cast from `S<Foo>` to the object type `dyn Gettable<Foo>`
9696
help: consider annotating `Foo` with `#[derive(Copy)]`
9797
|
9898
LL | #[derive(Copy)]

src/test/ui/mismatched_types/cast-rfc0401.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ LL | let _ = fat_v as *const dyn Foo;
220220
| ^^^^^ doesn't have a size known at compile-time
221221
|
222222
= help: the trait `Sized` is not implemented for `[u8]`
223-
= note: required for the cast to the object type `dyn Foo`
223+
= note: required for the cast from `[u8]` to the object type `dyn Foo`
224224
help: consider borrowing the value, since `&[u8]` can be coerced into `dyn Foo`
225225
|
226226
LL | let _ = &fat_v as *const dyn Foo;
@@ -233,7 +233,7 @@ LL | let _ = a as *const dyn Foo;
233233
| ^ doesn't have a size known at compile-time
234234
|
235235
= help: the trait `Sized` is not implemented for `str`
236-
= note: required for the cast to the object type `dyn Foo`
236+
= note: required for the cast from `str` to the object type `dyn Foo`
237237
help: consider borrowing the value, since `&str` can be coerced into `dyn Foo`
238238
|
239239
LL | let _ = &a as *const dyn Foo;

src/test/ui/never_type/fallback-closure-wrap.fallback.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | | }) as Box<dyn FnMut()>);
1010
|
1111
= note: expected unit type `()`
1212
found type `!`
13-
= note: required for the cast to the object type `dyn FnMut()`
13+
= note: required for the cast from `[closure@$DIR/fallback-closure-wrap.rs:18:40: 21:6]` to the object type `dyn FnMut()`
1414

1515
error: aborting due to previous error
1616

src/test/ui/suggestions/derive-macro-missing-bounds.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ LL | impl<T: Debug + Trait> Debug for Inner<T> {
3333
| ^^^^^ ^^^^^^^^
3434
= note: 1 redundant requirement hidden
3535
= note: required because of the requirements on the impl of `Debug` for `&c::Inner<T>`
36-
= note: required for the cast to the object type `dyn Debug`
36+
= note: required for the cast from `&c::Inner<T>` to the object type `dyn Debug`
3737
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
3838
help: consider restricting type parameter `T`
3939
|
@@ -55,7 +55,7 @@ LL | impl<T> Debug for Inner<T> where T: Debug, T: Trait {
5555
| ^^^^^ ^^^^^^^^
5656
= note: 1 redundant requirement hidden
5757
= note: required because of the requirements on the impl of `Debug` for `&d::Inner<T>`
58-
= note: required for the cast to the object type `dyn Debug`
58+
= note: required for the cast from `&d::Inner<T>` to the object type `dyn Debug`
5959
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
6060
help: consider restricting type parameter `T`
6161
|
@@ -77,7 +77,7 @@ LL | impl<T> Debug for Inner<T> where T: Debug + Trait {
7777
| ^^^^^ ^^^^^^^^
7878
= note: 1 redundant requirement hidden
7979
= note: required because of the requirements on the impl of `Debug` for `&e::Inner<T>`
80-
= note: required for the cast to the object type `dyn Debug`
80+
= note: required for the cast from `&e::Inner<T>` to the object type `dyn Debug`
8181
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
8282
help: consider restricting type parameter `T`
8383
|
@@ -99,7 +99,7 @@ LL | impl<T: Debug> Debug for Inner<T> where T: Trait {
9999
| ^^^^^ ^^^^^^^^
100100
= note: 1 redundant requirement hidden
101101
= note: required because of the requirements on the impl of `Debug` for `&f::Inner<T>`
102-
= note: required for the cast to the object type `dyn Debug`
102+
= note: required for the cast from `&f::Inner<T>` to the object type `dyn Debug`
103103
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
104104
help: consider restricting type parameter `T`
105105
|

src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | check(s);
88
|
99
= help: within `OsStr`, the trait `Sized` is not implemented for `[u8]`
1010
= note: required because it appears within the type `OsStr`
11-
= note: required for the cast to the object type `dyn AsRef<Path>`
11+
= note: required for the cast from `OsStr` to the object type `dyn AsRef<Path>`
1212
help: consider borrowing the value, since `&OsStr` can be coerced into `dyn AsRef<Path>`
1313
|
1414
LL | check(&s);

src/test/ui/traits/coercion-generic-bad.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let s: Box<dyn Trait<isize>> = Box::new(Struct { person: "Fred" });
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<isize>` is not implemented for `Struct`
66
|
77
= help: the trait `Trait<&'static str>` is implemented for `Struct`
8-
= note: required for the cast to the object type `dyn Trait<isize>`
8+
= note: required for the cast from `Struct` to the object type `dyn Trait<isize>`
99

1010
error: aborting due to previous error
1111

src/test/ui/traits/map-types.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let y: Box<dyn Map<usize, isize>> = Box::new(x);
55
| ^^^^^^^^^^^ the trait `Map<usize, isize>` is not implemented for `Box<dyn Map<isize, isize>>`
66
|
77
= help: the trait `Map<K, V>` is implemented for `HashMap<K, V>`
8-
= note: required for the cast to the object type `dyn Map<usize, isize>`
8+
= note: required for the cast from `Box<dyn Map<isize, isize>>` to the object type `dyn Map<usize, isize>`
99

1010
error: aborting due to previous error
1111

src/test/ui/traits/trait-upcasting/type-checking-test-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ error[E0277]: the trait bound `&dyn Foo: Bar<_>` is not satisfied
1515
LL | let _ = x as &dyn Bar<_>; // Ambiguous
1616
| ^ the trait `Bar<_>` is not implemented for `&dyn Foo`
1717
|
18-
= note: required for the cast to the object type `dyn Bar<_>`
18+
= note: required for the cast from `&dyn Foo` to the object type `dyn Bar<_>`
1919

2020
error: aborting due to 2 previous errors
2121

0 commit comments

Comments
 (0)