mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-03 09:32:42 +00:00
When a type param `T` is not `Sized` (i.e. `is_sized` returns false), removing an explicit `T: 'r` bound can silently change trait object lifetime defaults per RFC 599 — `Struct<dyn Trait>` would shift from `dyn Trait + 'r` to `dyn Trait + 'static`. Suppress the lint in that case using `Ty::new_param(...).is_sized(tcx, typing_env)`. Fixes https://github.com/rust-lang/rust/issues/134902