-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
make abort intrinsic safe, and correct its documentation #72204
Conversation
r? @shepmaster (rust_highfive has picked a reviewer for you, use r? to override) |
This looks correct to me. Since it's just changing an unstable intrinsic I'm going to go ahead and @bors r+ |
📌 Commit 43b479b14afa54f11a48a3752176f21f60604a59 has been approved by |
|
This comment has been minimized.
This comment has been minimized.
Oh that's a weird build failure:
@oli-obk any idea in which other place I need to mark the intrinsic as safe? |
rust/src/librustc_typeck/check/intrinsic.rs Lines 133 to 134 in 750db09
|
Interesting, that seems redundant... |
It seems to be yeah, but perhaps not entirely -- I'm not sure. |
sigh tidy (sometimes) doesn't like attributes with comments in the same line... :( |
This comment has been minimized.
This comment has been minimized.
r? @Mark-Simulacrum |
r=me with commits squashed |
@bors r=Mark-Simulacrum |
📌 Commit 4839a1c2e801794a945a5bf3cc9a8874ea9519e0 has been approved by |
} else if &name[..] == "abort" || &name[..] == "unreachable" { | ||
} else if &name[..] == "abort" { | ||
(0, Vec::new(), tcx.types.never, hir::Unsafety::Normal) | ||
} else if &name[..] == "unreachable" { | ||
(0, Vec::new(), tcx.types.never, hir::Unsafety::Unsafe) | ||
} else { | ||
let unsafety = intrinsic_operation_unsafety(&name[..]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, we should just pull this function call out of the if
and remove the manual computation of it in for the above cases.
⌛ Testing commit 4839a1c2e801794a945a5bf3cc9a8874ea9519e0 with merge a4455c9a8e09b1ebdb7da88a6a1cb885dcb46c46... |
💔 Test failed - checks-azure |
@bors r=Mark-Simulacrum |
📌 Commit 09d30a883e308396d2ad8d8eb018a16a6679c018 has been approved by |
Fixed formatting. |
📌 Commit 5980d97 has been approved by |
☀️ Test successful - checks-azure |
…ulacrum abort_internal is safe `sys::abort_internal` is stably exposed as a safe function. Forward that assumption "inwards" to the `sys` module by making the function itself safe, too. This corresponds to what rust-lang#72204 did for the intrinsic. We should probably wait until that lands because some of the intrinsic calls in this PR might then need adjustments.
…acrum abort_internal is safe `sys::abort_internal` is stably exposed as a safe function. Forward that assumption "inwards" to the `sys` module by making the function itself safe, too. This corresponds to what rust-lang#72204 did for the intrinsic. We should probably wait until that lands because some of the intrinsic calls in this PR might then need adjustments.
Turns out
std::process::abort
is not the same as the intrinsic, the comment was just wrong. Quoting from the unix implementation: