Don't CoerceUnsized dyn* to dyn*
This commit is contained in:
parent
0af211af67
commit
6e6c49e7ce
3 changed files with 28 additions and 2 deletions
|
@ -779,7 +779,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
|
||||
match (source.kind(), target.kind()) {
|
||||
// Trait+Kx+'a -> Trait+Ky+'b (upcasts).
|
||||
(&ty::Dynamic(ref data_a, ..), &ty::Dynamic(ref data_b, ..)) => {
|
||||
(&ty::Dynamic(ref data_a, _, ty::Dyn), &ty::Dynamic(ref data_b, _, ty::Dyn)) => {
|
||||
// Upcast coercions permit several things:
|
||||
//
|
||||
// 1. Dropping auto traits, e.g., `Foo + Send` to `Foo`
|
||||
|
|
|
@ -1145,7 +1145,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
}));
|
||||
}
|
||||
|
||||
_ => bug!(),
|
||||
_ => bug!("source: {source}, target: {target}"),
|
||||
};
|
||||
|
||||
Ok(ImplSourceBuiltinData { nested })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue