-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
min_specialization is unsound due to trivially-false lifetime bound #149257
Copy link
Copy link
Open
Labels
A-impossible-boundsArea: Issues related to have impossible trait bounds in scope (impossible predicates)Area: Issues related to have impossible trait bounds in scope (impossible predicates)A-specializationArea: Trait impl specializationArea: Trait impl specializationA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.F-min_specialization`#![feature(min_specialization)]``#![feature(min_specialization)]`I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-impossible-boundsArea: Issues related to have impossible trait bounds in scope (impossible predicates)Area: Issues related to have impossible trait bounds in scope (impossible predicates)A-specializationArea: Trait impl specializationArea: Trait impl specializationA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.F-min_specialization`#![feature(min_specialization)]``#![feature(min_specialization)]`I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The
min_specializationfeature is supposed to be sound, except for the existence ofrustc_unsafe_specialization_marker. However, the following code compiles without errors and SIGILLs when ran.I am unsure whether this unsoundness is observable in stable code (via std specializations). (Edit: Probably not.)
Miri output:
Meta
Reproducible on the playground with version
1.93.0-nightly (2025-11-23 c23ed3ef28b3cc306583)