-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Random musing on the library-level UB casting problem #139036
Copy link
Copy link
Closed as not planned
Labels
C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-langRelevant to the language teamRelevant to the language teamT-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
C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-langRelevant to the language teamRelevant to the language teamT-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.
Over in:
We're talking about how safe lifetime casts can allow library-level UB. It's interesting to think about other things that fit this pattern that also might be said to cause library-level UB under certain expectations.
steffahn described in #136702 (comment) a plan for using
dyn Traitand nightly features for triggering library-level UB. It looks like this:Playground link
Translating this to a non-
dyncontext, we get this, which has a similar shape to it:Playground link
@rustbot labels +T-lang +T-types +C-discussion