-
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
rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync" #136731
Conversation
We don't need to "short circuit trait resolution", because DynSend and DynSync are auto traits and thus coinductive
Thanks! @bors r+ |
@SparrowLii , I'm writing another PR, which will turn |
Actually, I'm not sure. The efficiency of RwLock is not slow in single-thread, and the enum needs runtime matching, which may affect the optimization effect. |
…22, r=SparrowLii rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync" rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync" We don't need to "short circuit trait resolution", because DynSend and DynSync are auto traits and thus coinductive cc "Parallel Rustc Front-end" rust-lang#113349 r? SparrowLii `@rustbot` label: +WG-compiler-parallel (rustbot sometimes ignores me and doesn't attach labels on my behalf. rustbot banned me?)
…kingjubilee Rollup of 9 pull requests Successful merges: - rust-lang#134626 (Add Four Codegen Tests) - rust-lang#135408 (x86: make SSE2 required for i686 hardfloat targets and use it to pass SIMD types) - rust-lang#136155 (Enable sanitizers on MSVC CI jobs) - rust-lang#136419 (adding autodiff tests) - rust-lang#136603 (compiler: gate `extern "{abi}"` in ast_lowering) - rust-lang#136628 (ci: upgrade to crosstool-ng 1.27.0) - rust-lang#136714 (Update `compiler-builtins` to 0.1.146) - rust-lang#136731 (rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync") - rust-lang#136761 (tests: `-Copt-level=3` instead of `-O` in codegen tests) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#136419 (adding autodiff tests) - rust-lang#136628 (ci: upgrade to crosstool-ng 1.27.0) - rust-lang#136681 (resolve `llvm-config` path properly on cross builds) - rust-lang#136714 (Update `compiler-builtins` to 0.1.146) - rust-lang#136731 (rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync") - rust-lang#136791 (Disable DWARF in linker options for i686-unknown-uefi) Failed merges: - rust-lang#136767 (improve host/cross target checking) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136731 - safinaskar:parallel-2025-02-08-07-22, r=SparrowLii rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync" rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync" We don't need to "short circuit trait resolution", because DynSend and DynSync are auto traits and thus coinductive cc "Parallel Rustc Front-end" rust-lang#113349 r? SparrowLii ``@rustbot`` label: +WG-compiler-parallel (rustbot sometimes ignores me and doesn't attach labels on my behalf. rustbot banned me?)
Not having these short circuits regresses compile time. |
@Zoxc You mean this increases the build time of the rustc itself? I think this should be acceptable, as we can check if the |
That's already checked. There's no reason to add 7 seconds of compile time to every rustc build. |
How can we guarantee that in the future someone won't incorrectly modify |
There are asserts that |
We do have |
You got that the wrong way around. |
@Zoxc , I think we should have as few as possible |
@Zoxc Ah, it makes me wonder why |
It does add an extra check, but it also avoids the checks on other uses of |
OK. But it's hard for me to say that using `unsafe impl' is necessary to save some build time, since the average build time for rustc is around 15 minutes. On the other hand, I think there should be cache for each solved trait to avoid extra 7 seconds of check time. This is probably where trait solver should be optimized. |
rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync"
We don't need to "short circuit trait resolution", because DynSend and DynSync are auto traits and thus coinductive
cc "Parallel Rustc Front-end" #113349
r? SparrowLii
@rustbot label: +WG-compiler-parallel
(rustbot sometimes ignores me and doesn't attach labels on my behalf. rustbot banned me?)