-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
safe transmute: check lifetimes #129217
safe transmute: check lifetimes #129217
Conversation
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
dc9c673
to
ec61df0
Compare
This comment has been minimized.
This comment has been minimized.
ec61df0
to
330a66e
Compare
This comment has been minimized.
This comment has been minimized.
330a66e
to
e33ec91
Compare
This comment has been minimized.
This comment has been minimized.
e33ec91
to
68c087c
Compare
This comment has been minimized.
This comment has been minimized.
Modifies `BikeshedIntrinsicFrom` to forbid lifetime extensions on references. This static check can be opted out of with the `Assume::lifetimes` flag. Fixes rust-lang#129097
68c087c
to
17995d5
Compare
#[instrument(level = "debug", skip(tcx, obligation, predicate))] | ||
use rustc_transmute::{Answer, Assume, Condition}; | ||
|
||
/// Generate sub-obligations for reference-to-reference transmutations. |
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.
You should document or link to documentation for some sort of specification that explains when two references are safely transmutable.
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.
Or else, it would be nice to pull up these inline comments into some sort of bulleted list here.
LGTM otherwise |
But I guess I also don't care to block this further @bors r+ rollup |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#129194 (Fix bootstrap test `detect_src_and_out` on Windows) - rust-lang#129217 (safe transmute: check lifetimes) - rust-lang#129223 ( Fix wrong argument for `get_fn_decl`) - rust-lang#129235 (Check that `#[may_dangle]` is properly applied) - rust-lang#129245 (Fix a typo in `rustc_hir` doc comment) - rust-lang#129271 (Prevent double panic in query system, improve diagnostics) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#129217 - jswrenn:transmute-lifetimes, r=compiler-errors safe transmute: check lifetimes Modifies `BikeshedIntrinsicFrom` to forbid lifetime extensions on references. This static check can be opted out of with the `Assume::lifetimes` flag. Fixes rust-lang#129097 Tracking Issue: rust-lang#99571 r? `@compiler-errors`
Modifies
BikeshedIntrinsicFrom
to forbid lifetime extensions on references. This static check can be opted out of with theAssume::lifetimes
flag.Fixes #129097
Tracking Issue: #99571
r? @compiler-errors