Unsound drop due to imperfect lifetime checks #90838
Labels
A-destructors
Area: Destructors (`Drop`, …)
A-lifetimes
Area: Lifetimes / regions
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
P-critical
Critical priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Looks like it's possible to
impl Drop
for a stricter lifetime than the one used in the type:... which allows to essentially transmute from
T: 'a
toT: 'static
, leading to unsoundness:On my machine, it prints:
The text was updated successfully, but these errors were encountered: