Skip to content

Rollup of 9 pull requests #98472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
00da0e7
make const_err show up in future breakage reports
RalfJung Jun 4, 2022
4a4d877
bless remaining tests
RalfJung Jun 4, 2022
ab3a2a0
Unify copying data from enclave to userspace
raoulstrackx Mar 29, 2022
531752f
Mitigate MMIO stale data vulnerabilities
raoulstrackx Mar 28, 2022
6f7d193
Ensure userspace allocation is 8-byte aligned
raoulstrackx Mar 23, 2022
a27aace
Test `copy_to_userspace` function
raoulstrackx Mar 22, 2022
edb6c4b
Add a test for issue #33172
rylev May 16, 2022
f30c76a
Turn off cdb test for now, link to issue
rylev Jun 20, 2022
3ea686f
Turn CDB test back on and all clarifying test
rylev Jun 20, 2022
e5402e4
Fix linux tests
rylev Jun 21, 2022
1a25ac9
Add comment about issue caused with multiple statics
rylev Jun 21, 2022
6a6910e
Address reviewer comments
raoulstrackx Jun 22, 2022
d23eea5
Add tracking issues to `--extern` option docs.
ehuss Jun 22, 2022
cc4f804
Move help popup into a pocket menu as well
GuillaumeGomez Jun 20, 2022
3eb9e1a
Add/update GUI tests for help pocket menu
GuillaumeGomez Jun 20, 2022
e4b2b41
Merge all popover hide functions into one
GuillaumeGomez Jun 22, 2022
23d325e
Update FIXME comment
rylev Jun 23, 2022
3c7f1f1
Suggest defining variable as mutable on `&mut _` type mismatch in pats
WaffleLapkin Jun 23, 2022
4c4fb71
add test
b-naber Jun 23, 2022
2e3221a
use correct substs in enum discriminant hack
b-naber Jun 23, 2022
38814fc
small refactor
b-naber Jun 24, 2022
f39c0d6
address review
b-naber Jun 24, 2022
ada2acc
Set relocation_model to Pic on emscripten target
hoodmane Jun 15, 2022
bf48b62
fmt
b-naber Jun 24, 2022
e25129b
take advantage of a labelled block
WaffleLapkin Jun 24, 2022
1dfb53b
improve wording of a suggestion
WaffleLapkin Jun 24, 2022
c06d8f9
Fix trait object reborrow suggestion
compiler-errors Jun 20, 2022
25fe474
Note concrete type being coerced into object
compiler-errors Jun 20, 2022
459b151
Rollup merge of #97085 - rylev:test-issue-33172, r=wesleywiser
compiler-errors Jun 25, 2022
7cf4f09
Rollup merge of #97743 - RalfJung:const-err-future-breakage, r=estebank
compiler-errors Jun 25, 2022
11cb0bb
Rollup merge of #98126 - fortanix:raoul/mitigate_stale_data_vulnerabi…
compiler-errors Jun 25, 2022
0bfffb7
Rollup merge of #98149 - hoodmane:emscripten-pic, r=petrochenkov
compiler-errors Jun 25, 2022
be2ef3e
Rollup merge of #98277 - compiler-errors:issue-93596, r=estebank
compiler-errors Jun 25, 2022
1c2e6b6
Rollup merge of #98297 - GuillaumeGomez:help-pocket-menu, r=notriddle
compiler-errors Jun 25, 2022
a6f8881
Rollup merge of #98401 - ehuss:extern-tracking, r=Dylan-DPC
compiler-errors Jun 25, 2022
6030d20
Rollup merge of #98429 - b-naber:use-correct-substs-discriminant-cast…
compiler-errors Jun 25, 2022
bdd6a25
Rollup merge of #98431 - WaffleLapkin:mut_pat_suggestions, r=compiler…
compiler-errors Jun 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Note concrete type being coerced into object
  • Loading branch information
compiler-errors committed Jun 24, 2022
commit 25fe474c3be1fb1893e4d32d3e59781c01a9a875
Original file line number Diff line number Diff line change
Expand Up @@ -2217,9 +2217,10 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
err.span_note(tcx.def_span(item_def_id), &descr);
}
}
ObligationCauseCode::ObjectCastObligation(_, object_ty) => {
ObligationCauseCode::ObjectCastObligation(concrete_ty, object_ty) => {
err.note(&format!(
"required for the cast to the object type `{}`",
"required for the cast from `{}` to the object type `{}`",
self.ty_to_string(concrete_ty),
self.ty_to_string(object_ty)
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0277]: the trait bound `String: Copy` is not satisfied
LL | Box::new(AssocNoCopy)
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
|
= note: required for the cast to the object type `dyn Bar<Assoc = <AssocNoCopy as Thing>::Out::{opaque#0}>`
= note: required for the cast from `AssocNoCopy` to the object type `dyn Bar<Assoc = <AssocNoCopy as Thing>::Out::{opaque#0}>`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/associated-types/associated-types-eq-3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ note: expected this to be `Bar`
|
LL | type A = usize;
| ^^^^^
= note: required for the cast to the object type `dyn Foo<A = Bar>`
= note: required for the cast from `isize` to the object type `dyn Foo<A = Bar>`

error: aborting due to 3 previous errors

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

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/associated-types/issue-65774-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ note: required because of the requirements on the impl of `MyDisplay` for `&mut
|
LL | impl<'a, T: MyDisplay> MyDisplay for &'a mut T { }
| ^^^^^^^^^ ^^^^^^^^^
= note: required for the cast to the object type `dyn MyDisplay`
= note: required for the cast from `&mut T` to the object type `dyn MyDisplay`

error: aborting due to 2 previous errors

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/associated-types/issue-65774-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LL | writer.my_write(valref)
| ^^^^^^ the trait `MyDisplay` is not implemented for `T`
|
= help: the trait `MyDisplay` is implemented for `&'a mut T`
= note: required for the cast to the object type `dyn MyDisplay`
= note: required for the cast from `T` to the object type `dyn MyDisplay`

error: aborting due to 2 previous errors

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

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

error[E0308]: mismatched types
--> $DIR/async-block-control-flow-static-semantics.rs:47:44
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/async-await/issue-86507.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ note: captured value is not `Send` because `&` references cannot be sent unless
|
LL | let x = x;
| ^ has type `&T` which is not `Send`, because `T` is not `Sync`
= note: required for the cast to the object type `dyn Future<Output = ()> + Send`
= note: required for the cast from `impl Future<Output = ()>` to the object type `dyn Future<Output = ()> + Send`
help: consider further restricting this bound
|
LL | fn bar<'me, 'async_trait, T: Send + std::marker::Sync>(x: &'me T)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ error[E0277]: the trait bound `(): std::error::Error` is not satisfied
LL | /* *mut $0 is coerced to Box<dyn Error> here */ Box::<_ /* ! */>::new(x)
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
|
= note: required for the cast to the object type `dyn std::error::Error`
= note: required for the cast from `()` to the object type `dyn std::error::Error`

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

error: aborting due to 2 previous errors

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/const-generics/defaults/trait_objects_fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | foo(&10_u32);
| required by a bound introduced by this call
|
= help: the trait `Trait<2_u8>` is implemented for `u32`
= note: required for the cast to the object type `dyn Trait`
= note: required for the cast from `u32` to the object type `dyn Trait`

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

error: aborting due to 2 previous errors

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/custom_test_frameworks/mismatch.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | #[test]
LL | fn wrong_kind(){}
| ^^^^^^^^^^^^^^^^^ the trait `Testable` is not implemented for `TestDescAndFn`
|
= note: required for the cast to the object type `dyn Testable`
= note: required for the cast from `TestDescAndFn` to the object type `dyn Testable`
= note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/dst/dst-bad-coerce1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ error[E0277]: the trait bound `Foo: Bar` is not satisfied
LL | let f3: &Fat<dyn Bar> = f2;
| ^^ the trait `Bar` is not implemented for `Foo`
|
= note: required for the cast to the object type `dyn Bar`
= note: required for the cast from `Foo` to the object type `dyn Bar`

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

error: aborting due to 4 previous errors

Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/dst/dst-object-from-unsized-type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | fn test1<T: ?Sized + Foo>(t: &T) {
LL | let u: &dyn Foo = t;
| ^ doesn't have a size known at compile-time
|
= note: required for the cast to the object type `dyn Foo`
= note: required for the cast from `T` to the object type `dyn Foo`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - fn test1<T: ?Sized + Foo>(t: &T) {
Expand All @@ -21,7 +21,7 @@ LL | fn test2<T: ?Sized + Foo>(t: &T) {
LL | let v: &dyn Foo = t as &dyn Foo;
| ^ doesn't have a size known at compile-time
|
= note: required for the cast to the object type `dyn Foo`
= note: required for the cast from `T` to the object type `dyn Foo`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - fn test2<T: ?Sized + Foo>(t: &T) {
Expand All @@ -35,7 +35,7 @@ LL | let _: &[&dyn Foo] = &["hi"];
| ^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
= note: required for the cast to the object type `dyn Foo`
= note: required for the cast from `str` to the object type `dyn Foo`

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

error: aborting due to 4 previous errors

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

error: aborting due to 2 previous errors

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-14366.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | let _x = "test" as &dyn (::std::any::Any);
| ^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
= note: required for the cast to the object type `dyn Any`
= note: required for the cast from `str` to the object type `dyn Any`
help: consider borrowing the value, since `&str` can be coerced into `dyn Any`
|
LL | let _x = &"test" as &dyn (::std::any::Any);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-22034.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | &mut *(ptr as *mut dyn Fn())
|
= help: the trait `Fn<()>` is not implemented for `()`
= note: wrap the `()` in a closure with no arguments: `|| { /* code */ }`
= note: required for the cast to the object type `dyn Fn()`
= note: required for the cast from `()` to the object type `dyn Fn()`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-22872.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ note: required because of the requirements on the impl of `for<'b> Wrap<'b>` for
|
LL | impl<'b, P> Wrap<'b> for Wrapper<P>
| ^^^^^^^^ ^^^^^^^^^^
= note: required for the cast to the object type `dyn for<'b> Wrap<'b>`
= note: required for the cast from `Wrapper<P>` to the object type `dyn for<'b> Wrap<'b>`
help: consider further restricting the associated type
|
LL | fn push_process<P>(process: P) where P: Process<'static>, <P as Process<'_>>::Item: Iterator {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-7013.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ note: required because it appears within the type `B`
|
LL | struct B {
| ^
= note: required for the cast to the object type `dyn Foo + Send`
= note: required for the cast from `B` to the object type `dyn Foo + Send`

error: aborting due to previous error

Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/kindck/kindck-impl-type-params.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
= note: required for the cast to the object type `dyn Gettable<T>`
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
LL | fn f<T: std::marker::Send>(val: T) {
Expand All @@ -26,7 +26,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
= note: required for the cast to the object type `dyn Gettable<T>`
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
LL | fn f<T: std::marker::Copy>(val: T) {
Expand All @@ -43,7 +43,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
= note: required for the cast to the object type `dyn Gettable<T>`
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Send>(val: T) {
Expand All @@ -60,7 +60,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
= note: required for the cast to the object type `dyn Gettable<T>`
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Copy>(val: T) {
Expand All @@ -78,7 +78,7 @@ note: required because of the requirements on the impl of `Gettable<String>` for
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
= note: required for the cast to the object type `dyn Gettable<String>`
= note: required for the cast from `S<String>` to the object type `dyn Gettable<String>`

error[E0277]: the trait bound `Foo: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:43:37
Expand All @@ -92,7 +92,7 @@ note: required because of the requirements on the impl of `Gettable<Foo>` for `S
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
= note: required for the cast to the object type `dyn Gettable<Foo>`
= note: required for the cast from `S<Foo>` to the object type `dyn Gettable<Foo>`
help: consider annotating `Foo` with `#[derive(Copy)]`
|
LL | #[derive(Copy)]
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/mismatched_types/cast-rfc0401.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ LL | let _ = fat_v as *const dyn Foo;
| ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[u8]`
= note: required for the cast to the object type `dyn Foo`
= note: required for the cast from `[u8]` to the object type `dyn Foo`
help: consider borrowing the value, since `&[u8]` can be coerced into `dyn Foo`
|
LL | let _ = &fat_v as *const dyn Foo;
Expand All @@ -233,7 +233,7 @@ LL | let _ = a as *const dyn Foo;
| ^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
= note: required for the cast to the object type `dyn Foo`
= note: required for the cast from `str` to the object type `dyn Foo`
help: consider borrowing the value, since `&str` can be coerced into `dyn Foo`
|
LL | let _ = &a as *const dyn Foo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LL | | }) as Box<dyn FnMut()>);
|
= note: expected unit type `()`
found type `!`
= note: required for the cast to the object type `dyn FnMut()`
= note: required for the cast from `[closure@$DIR/fallback-closure-wrap.rs:18:40: 21:6]` to the object type `dyn FnMut()`

error: aborting due to previous error

Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/suggestions/derive-macro-missing-bounds.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ LL | impl<T: Debug + Trait> Debug for Inner<T> {
| ^^^^^ ^^^^^^^^
= note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `Debug` for `&c::Inner<T>`
= note: required for the cast to the object type `dyn Debug`
= note: required for the cast from `&c::Inner<T>` to the object type `dyn Debug`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
|
Expand All @@ -55,7 +55,7 @@ LL | impl<T> Debug for Inner<T> where T: Debug, T: Trait {
| ^^^^^ ^^^^^^^^
= note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `Debug` for `&d::Inner<T>`
= note: required for the cast to the object type `dyn Debug`
= note: required for the cast from `&d::Inner<T>` to the object type `dyn Debug`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
|
Expand All @@ -77,7 +77,7 @@ LL | impl<T> Debug for Inner<T> where T: Debug + Trait {
| ^^^^^ ^^^^^^^^
= note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `Debug` for `&e::Inner<T>`
= note: required for the cast to the object type `dyn Debug`
= note: required for the cast from `&e::Inner<T>` to the object type `dyn Debug`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
|
Expand All @@ -99,7 +99,7 @@ LL | impl<T: Debug> Debug for Inner<T> where T: Trait {
| ^^^^^ ^^^^^^^^
= note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `Debug` for `&f::Inner<T>`
= note: required for the cast to the object type `dyn Debug`
= note: required for the cast from `&f::Inner<T>` to the object type `dyn Debug`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | check(s);
|
= help: within `OsStr`, the trait `Sized` is not implemented for `[u8]`
= note: required because it appears within the type `OsStr`
= note: required for the cast to the object type `dyn AsRef<Path>`
= note: required for the cast from `OsStr` to the object type `dyn AsRef<Path>`
help: consider borrowing the value, since `&OsStr` can be coerced into `dyn AsRef<Path>`
|
LL | check(&s);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/traits/coercion-generic-bad.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | let s: Box<dyn Trait<isize>> = Box::new(Struct { person: "Fred" });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<isize>` is not implemented for `Struct`
|
= help: the trait `Trait<&'static str>` is implemented for `Struct`
= note: required for the cast to the object type `dyn Trait<isize>`
= note: required for the cast from `Struct` to the object type `dyn Trait<isize>`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/traits/map-types.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | let y: Box<dyn Map<usize, isize>> = Box::new(x);
| ^^^^^^^^^^^ the trait `Map<usize, isize>` is not implemented for `Box<dyn Map<isize, isize>>`
|
= help: the trait `Map<K, V>` is implemented for `HashMap<K, V>`
= note: required for the cast to the object type `dyn Map<usize, isize>`
= note: required for the cast from `Box<dyn Map<isize, isize>>` to the object type `dyn Map<usize, isize>`

error: aborting due to previous error

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

error: aborting due to 2 previous errors

Expand Down
Loading