-
Notifications
You must be signed in to change notification settings - Fork 13.8k
remove explicit deref of AbiAlign for most methods #147134
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
remove explicit deref of AbiAlign for most methods #147134
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt HIR ty lowering was modified cc @fmease The Miri subtree was changed cc @rust-lang/miri Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred in compiler/rustc_codegen_gcc Some changes occurred to the CTFE machinery Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
f798c9d
to
9f404e6
Compare
This comment has been minimized.
This comment has been minimized.
Much of the compiler calls functions on Align projected from AbiAlign. AbiAlign impls Deref to its inner Align, so we can simplify these away. Also, it will minimize disruption when AbiAlign is removed. For now, preserve usages that might resolve to PartialOrd or PartialEq, as those have odd inference.
9f404e6
to
0c9d0df
Compare
(i128_type, u128_type) | ||
} else { | ||
/*let layout = tcx.layout_of(ParamEnv::reveal_all().and(tcx.types.i128)).unwrap(); | ||
let i128_align = layout.align.abi.bytes(); |
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.
Remark: This code is commented out, but I guess including it in a find-replace isn't wrong.
) { | ||
let l = eval_goal(ra_fixture, minicore).unwrap(); | ||
assert_eq!(l.size.bytes(), size, "size mismatch"); | ||
assert_eq!(l.align.abi.bytes(), align, "align mismatch"); |
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.
Remark: From a review perspective it's unclear whether these rust-analyzer changes are intended/accurate (and not just a find-replace mishap), but they seem plausible and I guess CI would complain if they were broken, so it seems fine to rubber-stamp them.
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.
most of r-a's test suite currently does not run on CI #136779
The changes should be proper though.
My remarks don't require any further action, so LGTM. @bors r+ |
Rollup merge of #147134 - workingjubilee:remove-explicit-abialign-deref, r=Zalathar remove explicit deref of AbiAlign for most methods Much of the compiler calls functions on Align projected from AbiAlign. AbiAlign impls Deref to its inner Align, so we can simplify these away. Also, it will minimize disruption when AbiAlign is removed. For now, preserve usages that might resolve to PartialOrd or PartialEq, as those have odd inference.
Much of the compiler calls functions on Align projected from AbiAlign. AbiAlign impls Deref to its inner Align, so we can simplify these away. Also, it will minimize disruption when AbiAlign is removed.
For now, preserve usages that might resolve to PartialOrd or PartialEq, as those have odd inference.
Same sentiment as #147116 in that this seemed the most reviewable chunk to submit.