Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meeting proposal: behavior of _ in match patterns #16

Closed
RalfJung opened this issue Sep 9, 2023 · 1 comment
Closed

Meeting proposal: behavior of _ in match patterns #16

RalfJung opened this issue Sep 9, 2023 · 1 comment
Labels
meeting-proposal Proposal for a discussion topic at a team meeting

Comments

@RalfJung
Copy link
Member

RalfJung commented Sep 9, 2023

Summary

Does this code have UB?

fn main() {
    let ptr = 32 as *const (u8, u8);
    unsafe {
        match (*ptr).1 { _ => {} }
    }
}

Currently the answer Miri gives is no. That is inconsistent with let _ = (*ptr).1, which creates a PlaceMention that is picked up by Miri and hence raises UB (the UB error will change with rust-lang/rust#114330, since it will be UB at the projection rather than the deref, but it will remain UB).

We should determine whether we want to make this behavior consistent.

Reading

Meeting document

Issues/PRs:

Comment policy

These issues are meant to be used as an "announcements channel" regarding the proposal, and not as a
place to discuss the technical details. Feel free to subscribe to updates. We'll post comments when
reviewing the proposal in meetings or making a scheduling decision. In the meantime, if you have
questions or ideas, ping the proposers on Zulip (or elsewhere).

@RalfJung RalfJung added the meeting-proposal Proposal for a discussion topic at a team meeting label Sep 9, 2023
@RalfJung
Copy link
Member Author

Meeting summary: everyone is fine with the opsem implications of rust-lang/rust#103208.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meeting-proposal Proposal for a discussion topic at a team meeting
Projects
None yet
Development

No branches or pull requests

1 participant