-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Rollup of 10 pull requests #145551
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
Rollup of 10 pull requests #145551
Conversation
set * Enforce the `-Zregparm=N` flag by setting the NumRegisterParameters LLVM module flag * Add assembly tests verifying that the parameters are passed in registers for reparm values 1, 2, and 3, for both LLVM intrinsics and non-builtin functions * Add c_void type to minicore
This handles various kinds of errors, but does not allow applying the derive yet. This adds the feature gate `macro_derive`.
Add infrastructure to apply a derive macro to arguments, consuming and returning a `TokenTree` only. Handle `SyntaxExtensionKind::MacroRules` when expanding a derive, if the macro's kinds support derive. Add tests covering various cases of `macro_rules` derives. Note that due to a pre-existing FIXME in `expand.rs`, derives are re-queued and some errors get emitted twice. Duplicate diagnostic suppression makes them not visible, but the FIXME should still get fixed.
this fixes `tests/ui/process/nofile-limit.rs` which fails to link on nixos for me without this change
"privalage" -> "privilege"
The target is removed by `copy_link` too, so no need to duplicate the syscall.
Fix outdated doc comment This updates the documentation comment for `Type::is_doc_subtype_of` to more accurately describe its purpose as a subtyping check, rather than equality fixes rust-lang#138572 r? ````````````@tgross35````````````
…szelmann Port `#[custom_mir(..)]` to the new attribute system r? ``````````@jdonszelmann``````````
…enkov Implement declarative (`macro_rules!`) derive macros (RFC 3698) This is a draft for review, and should not be merged yet. This is layered atop rust-lang#145153 , and has only two additional commits atop that. The first handles parsing and provides a test for various parse errors. The second implements expansion and handles application. This implements RFC 3698, "Declarative (`macro_rules!`) derive macros". Tracking issue: rust-lang#143549 This has one remaining issue, which I could use some help debugging: in `tests/ui/macros/macro-rules-derive-error.rs`, the diagnostics for `derive(fn_only)` (for a `fn_only` with no `derive` rules) and `derive(ForwardReferencedDerive)` both get emitted twice, as a duplicate diagnostic. From what I can tell via adding some debugging code, `unresolved_macro_suggestions` is getting called twice from `finalize_macro_resolutions` for each of them, because `self.single_segment_macro_resolutions` has two entries for the macro, with two different `parent_scope` values. I'm not clear on why that happened; it doesn't happen with the equivalent code using attrs. I'd welcome any suggestions for fixing this.
…ross35 Fix `-Zregparm` for LLVM builtins This fixes the issue where `-Zregparm=N` was not working correctly when calling LLVM intrinsics By default on `x86-32`, arguments are passed on the stack. The `-Zregparm=N` flag allows the first `N` arguments to be passed in registers instead. When calling intrinsics like `memset`, LLVM still passes parameters on the stack, which prevents optimizations like tail calls. As proposed by ````@tgross35,```` I fixed this by setting the `NumRegisterParameters` LLVM module flag to `N` when the `-Zregparm=N` is set. ```rust // compiler/rust_codegen_llvm/src/context.rs#375-382 if let Some(regparm_count) = sess.opts.unstable_opts.regparm { llvm::add_module_flag_u32( llmod, llvm::ModuleFlagMergeBehavior::Error, "NumRegisterParameters", regparm_count, ); } ``` [Here](https://rust.godbolt.org/z/YMezreo48) is a before/after compiler explorer. Here is the final result for the code snippet in the original issue: ```asm entrypoint: push esi mov esi, eax mov eax, ecx mov ecx, esi pop esi jmp memset ; Tail call parameters in registers ``` Fixes: rust-lang#145271
Add codegen test for issue 122734 Closes rust-lang#122734
cg_llvm: Use LLVM-C bindings for `LLVMSetTailCallKind`, `LLVMGetTypeKind` This PR replaces two existing `LLVMRust` bindings with equivalent calls to the LLVM-C API. For `LLVMGetTypeKind`, we avoid the UB hazard by declaring the foreign function to return `RawEnum<TypeKind>` (which is a wrapper around `u32`), and then perform checked conversion from `u32` to `TypeKind`.
…rieb Add static glibc to the nix dev shell This fixes `tests/ui/process/nofile-limit.rs` which fails to link on nixos for me without this change.
…dirs, r=jieyouxu Speedup `copy_src_dirs` in bootstrap I was kinda offended by how slow it was. Just the `copy_src_dirs` part took ~3s locally in the `x dist rustc-src` step. In release mode it was just 1s, but that's kind of cheating (I wonder if we should build bootstrap in release mode on CI though...). Did some basic optimizations to bring it down to ~1s also in debug mode. Maybe it's overkill, due to rust-lang#145455. Up to you whether we should merge it or close it :) r? `````````@jieyouxu`````````
Fix typo in doc for library/std/src/fs.rs#set_permissions "privalage" -> "privilege". Was reading the docs and have noticed this.
…rgets, r=jdonszelmann Fix deprecation attributes on foreign statics r? ````````@jdonszelmann```````` Fixes rust-lang#145437
Rollup of 10 pull requests Successful merges: - #144838 (Fix outdated doc comment) - #145206 (Port `#[custom_mir(..)]` to the new attribute system) - #145208 (Implement declarative (`macro_rules!`) derive macros (RFC 3698)) - #145309 (Fix `-Zregparm` for LLVM builtins) - #145355 (Add codegen test for issue 122734) - #145420 (cg_llvm: Use LLVM-C bindings for `LLVMSetTailCallKind`, `LLVMGetTypeKind`) - #145451 (Add static glibc to the nix dev shell) - #145460 (Speedup `copy_src_dirs` in bootstrap) - #145476 (Fix typo in doc for library/std/src/fs.rs#set_permissions) - #145485 (Fix deprecation attributes on foreign statics) r? `@ghost` `@rustbot` modify labels: rollup
💔 Test failed - checks-actions |
Given that this succeeded in the past, and that GitHub won't even let me see the failure logs, I think it's reasonable to assume yet more CI flakiness. @bors retry |
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 425a9c0 (parent) -> 239e8b1 (this PR) Test differencesShow 37 test diffsStage 1
Stage 2
Additionally, 16 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 239e8b1b47b34120287ec36b33228c1e177f0c38 --output-dir test-dashboard And then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
📌 Perf builds for each rolled up PR:
previous master: 425a9c0a0e In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (239e8b1): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -4.5%, secondary 3.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -10.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 470.373s -> 470.133s (-0.05%) |
Successful merges:
#[custom_mir(..)]
to the new attribute system #145206 (Port#[custom_mir(..)]
to the new attribute system)macro_rules!
) derive macros (RFC 3698) #145208 (Implement declarative (macro_rules!
) derive macros (RFC 3698))-Zregparm
for LLVM builtins #145309 (Fix-Zregparm
for LLVM builtins)LLVMSetTailCallKind
,LLVMGetTypeKind
#145420 (cg_llvm: Use LLVM-C bindings forLLVMSetTailCallKind
,LLVMGetTypeKind
)copy_src_dirs
in bootstrap #145460 (Speedupcopy_src_dirs
in bootstrap)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup