about summary refs log tree commit diff
path: root/tests/ui/impl-trait/in-trait/missing-static-bound-from-impl.stderr
AgeCommit message (Collapse)AuthorLines
2024-02-27Print RPITIT like an opaqueMichael Goulet-2/+2
2024-02-27rename RPITIT from opaque to syntheticMichael Goulet-2/+2
2024-02-22Account for RPITIT in E0310 explicit lifetime constraint suggestionEsteban Küber-0/+12
When given ```rust trait Original { fn f() -> impl Fn(); } trait Erased { fn f(&self) -> Box<dyn Fn()>; } impl<T: Original> Erased for T { fn f(&self) -> Box<dyn Fn()> { Box::new(<T as Original>::f()) } } ``` avoid suggestion to restrict the `Trait::{opaque}` type in a `where` clause: ``` error[E0310]: the associated type `<T as Original>::{opaque#0}` may not live long enough --> $DIR/missing-static-bound-from-impl.rs:11:9 | LL | Box::new(<T as Original>::f()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | the associated type `<T as Original>::{opaque#0}` must be valid for the static lifetime... | ...so that the type `impl Fn()` will meet its required lifetime bounds ``` CC #119773.