Hide lifetimes of impl Trait in force trimmed paths

This commit is contained in:
Esteban Küber 2023-01-06 01:22:24 +00:00
parent 252c43b42b
commit ab8dc9a0ad
2 changed files with 6 additions and 4 deletions

View File

@ -1084,9 +1084,11 @@ pub trait PrettyPrinter<'tcx>:
write!(self, "Sized")?; write!(self, "Sized")?;
} }
for re in lifetimes { if !FORCE_TRIMMED_PATH.with(|flag| flag.get()) {
write!(self, " + ")?; for re in lifetimes {
self = self.print_region(re)?; write!(self, " + ")?;
self = self.print_region(re)?;
}
} }
Ok(self) Ok(self)

View File

@ -114,7 +114,7 @@ LL | union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
| |
= help: within `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)` = help: within `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)`
= note: required because it appears within the type `ManuallyDrop<dyn Iterator<Item = impl Sized + 'static>>` = note: required because it appears within the type `ManuallyDrop<dyn Iterator<Item = impl Sized>>`
= note: no field of a union may have a dynamically sized type = note: no field of a union may have a dynamically sized type
= help: change the field's type to have a statically known size = help: change the field's type to have a statically known size
help: borrowed types always have a statically known size help: borrowed types always have a statically known size