-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
library: Use size_of
from the prelude instead of imported
#138034
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
Please revert all the changes to tests. We don't typically "correct" tests for things like this, formatting, etc. It's simply unnecessary churn. Especially unless you want to verify that every test that was changed doesn't implicitly change the meaning or intention of the test that when it was originally committed (e.g. that the test wasn't exercising minutiae of resolver or path semantics or something else). You also probably should split this out between library, compiler, and changes to the various tools in src/tools. Different parts of the repository are the responsibility of different teams, and right now the review-ability of a 444 file test is really not great. @rustbot author |
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr Some changes occurred in src/tools/compiletest cc @jieyouxu Some changes occurred in coverage tests. cc @Zalathar This PR changes Stable MIR cc @oli-obk, @celinval, @ouz-a Some changes occurred in compiler/rustc_codegen_gcc The Miri subtree was changed cc @rust-lang/miri 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 Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr Portable SIMD is developed in its own repository. If possible, consider making this change to rust-lang/portable-simd instead. cc @calebzulawski, @programmerjake Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred in cc @BoxyUwU Some changes occurred in tests/ui/sanitizer cc @rust-lang/project-exploit-mitigations, @rcvalle |
This comment has been minimized.
This comment has been minimized.
88cec8c
to
ae1a15a
Compare
I've removed changes to files in the following directories:
|
This comment has been minimized.
This comment has been minimized.
Roughly by team, the distribution is now: library/: 124 files Unless I'm splitting library/ somehow, compiler/ might not even be worth splitting out. It's just a lot of files. But, I'm open if you have ideas on how to split it well. |
By split, I mean there's no reason this needs to happen in a single PR, since it's not like this changes something that needs to be applied concurrently across all the repository in a singular PR. It's just a bunch of changes squashed into one by choice. The 31 changes in This PR also touches several tools that really should have PRs made to their own repositories, like rust-analyzer, rustfmt, etc (pls re-read the rustbot ping list for some of those submodules by name), since this is not a critical change or something that breaks rust-analyzer or rustfmt in CI or anything. |
I can review the bootstrap/compiletest bits if you split those out. But the rust-analyzer, rustfmt, clippy changes need (well, really should) to be sent against their own repos since they're subtrees and does not otherwise need compiler changes to minimize subtree sync conflicts. |
1297a50
to
4f07a0b
Compare
size_of
from the prelude instead of importedsize_of
from the prelude instead of imported
I've now split it into several PRs:
This PR is now only changes to library/. If you'd like me to split it further, perhaps by crate, just let me know. r? libs @rustbot review |
I have checked it with List of targets checked# Tier 1:
x check library --target=aarch64-apple-darwin
x check library --target=aarch64-unknown-linux-gnu
x check library --target=i686-pc-windows-gnu
x check library --target=i686-pc-windows-msvc
x check library --target=i686-unknown-linux-gnu
x check library --target=x86_64-apple-darwin
x check library --target=x86_64-pc-windows-gnu
x check library --target=x86_64-pc-windows-msvc
x check library --target=x86_64-unknown-linux-gnu
# Tier 2 with host tools:
x check library --target=aarch64-pc-windows-msvc
x check library --target=aarch64-unknown-linux-musl
x check library --target=arm-unknown-linux-gnueabi
x check library --target=arm-unknown-linux-gnueabihf
x check library --target=armv7-unknown-linux-gnueabihf
x check library --target=loongarch64-unknown-linux-gnu
x check library --target=loongarch64-unknown-linux-musl
x check library --target=powerpc-unknown-linux-gnu
x check library --target=powerpc64-unknown-linux-gnu
x check library --target=powerpc64le-unknown-linux-gnu
x check library --target=powerpc64le-unknown-linux-musl
x check library --target=riscv64gc-unknown-linux-gnu
x check library --target=riscv64gc-unknown-linux-musl
x check library --target=s390x-unknown-linux-gnu
x check library --target=x86_64-unknown-freebsd
x check library --target=x86_64-unknown-illumos
x check library --target=x86_64-unknown-linux-musl
x check library --target=x86_64-unknown-netbsd
# Other:
x check library --target=wasm32-wasip1
x check library --target=wasm32-wasip1-threads
x check library --target=wasm32-wasip2
x check library --target=x86_64-fortanix-unknown-sgx
# Fail (but unrelated):
x check library --target=aarch64-kmc-solid_asp3
x check library --target=aarch64-unknown-teeos
x check library --target=riscv32im-risc0-zkvm-elf
x check library --target=riscv32imac-unknown-xous-elf
x check library --target=wasm32-unknown-unknown
x check library --target=x86_64-unknown-hermit
x check library --target=x86_64-unknown-uefi |
This comment has been minimized.
This comment has been minimized.
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.
Notes from my initial quick pass, mostly use
statements that could be removed. Based on CI it seems like there may be other instances that aren't picked up by ./x c library
?
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.
why does this change some docs to use turbofish syntax? (second commit)
Because it's not valid rust, perhaps? |
4f07a0b
to
94f866c
Compare
That was at Jubilee's suggestion: #138034 (comment)
Exactly |
@tgross35 I've now fixed (what should be) all the now-unnecessary imports for doc tests. Running |
This comment has been minimized.
This comment has been minimized.
94f866c
to
3f51211
Compare
…and now benches are fixed |
This comment has been minimized.
This comment has been minimized.
3f51211
to
7f4ce71
Compare
This round caught some tests in library/coretests, which I couldn't check locally with All this CI bouncing isn't really inspiring confidence, so while this run is going, I'll do a manual review of the imports. |
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. These functions were added to all preludes in Rust 1.80.
7f4ce71
to
b4a107d
Compare
I reviewed every file to check whether a I was hoping to wait until the previus CI run finished, but builders weren't picking up the last two jobs, since the tree is currently closed, so I've pushed the fixes I found. But the jobs which actually did run passed, so that's a good sign. |
Use
std::mem::{size_of, size_of_val, align_of, align_of_val}
from the prelude instead of importing or qualifying them.These functions were added to all preludes in Rust 1.80.