Skip to content

Rollup of 7 pull requests #141696

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

Merged
merged 31 commits into from
May 28, 2025
Merged

Rollup of 7 pull requests #141696

merged 31 commits into from
May 28, 2025

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented May 28, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Sa4dUs and others added 30 commits May 20, 2025 11:58
Pending fix.
```
error: cannot find a built-in macro with name `autodiff_forward`
    --> library\core\src\macros\mod.rs:1542:5
     |
1542 | /     pub macro autodiff_forward($item:item) {
1543 | |         /* compiler built-in */
1544 | |     }
     | |_____^

error: cannot find a built-in macro with name `autodiff_reverse`
    --> library\core\src\macros\mod.rs:1549:5
     |
1549 | /     pub macro autodiff_reverse($item:item) {
1550 | |         /* compiler built-in */
1551 | |     }
     | |_____^

error: could not compile `core` (lib) due to 2 previous errors
```
UI tests are pending, will depend on error messages change.
…des (`Forward`, `Reverse`)

Since the mode is no longer part of `meta_item`, we must insert it manually (otherwise macro expansion with `#[rustc_autodiff]` won't work).

This can be revised later if a more structured representation becomes necessary (using enums, annotated structs, etc).

Some tests are currently failing. I'll address them next.
Intrinsics are not real functions and as such don't have any calling
convention. Trying to compute a calling convention for an intrinsic
anyway is a nonsensical operation.
It's not needed, because `next` and `local` fields uniquely identify the
drop. This is a ~2% speed win on the very large program in rust-lang#134404, and
it's also a tiny bit simpler.
Because `Scope` also has a field named `drops`, and I found having two
fields with the same name made this code harder to read.
This pattern of iterating over scopes and drops occurs multiple times in
this file, with slight variations. All of them use `for` loops except
this one. This commits changes it for consistency.
fixes rust-lang#91274

Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
…manieu

Add data_ptr method to Mutex and RwLock

Implementation of rust-lang#140368 / rust-lang/libs-team#531.

I tried to write a useful safety section about when it is safe to read or write through the returned pointers, but couldn't come up with something nice. Hoping this PR is still useful without that. I'm happy to add any doc strings other people come up with if needed before merge, of course.

Unresolved questions:

- Return a `LockResult` or not?
- Return `*mut T` like existing APIs (`Cell::as_ptr` / `MaybeUninit::as[_mut]_ptr` / `Vec::as_ptr` / ...) or be more precise and return `NonNull<T>`?
Split `autodiff` into `autodiff_forward` and `autodiff_reverse`

This PR splits `#[autodiff]` macro so `#[autodiff(df, Reverse, args)]` would become `#[autodiff_reverse(df, args)]` and `#[autodiff(df, Forward, args)]` would become `#[autodiff_forwad(df, args)]`.
…n, r=davidtwco

Improve intrinsic handling in cg_ssa

* Move all intrinsic handling code to the start of `codegen_call_terminator`.
* Push some intrinsic handling code into `codegen_intrinsic_call`.
* Don't depend on FnAbi for intrinsics.
…ro-91274, r=GuillaumeGomez

rustdoc: linking to a local proc macro no longer warns

fixes rust-lang#91274

tried to keep the fix general in case we ever have any other kind of item that occupies
multiple namespaces simultaniously.
consider glob imports in cfg suggestion

Fixes rust-lang#141256

r? ```@petrochenkov```
…ewjasper

Drop-build cleanups

Some cleanups I made while trying to speed up the program in rust-lang#134404.

r? ```@matthewjasper```
…tracts, r=nnethercote

Fix ICE in tokenstream with contracts from parser recovery

Fixes rust-lang#140683

After two times of parsing error, the `recover_stmt_` constructs an error ast, then when we expand macors, the invalid tokenstream triggered ICE because of mismatched delims.

Expected `{` and get other tokens is an obvious error message, too much effort on recovery may introduce noise.

r? ```@nnethercote```
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. rollup A PR which is a rollup labels May 28, 2025
@tgross35
Copy link
Contributor Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented May 28, 2025

📌 Commit d6b1108 has been approved by tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 28, 2025
@bors
Copy link
Collaborator

bors commented May 28, 2025

⌛ Testing commit d6b1108 with merge 6f69710...

@bors
Copy link
Collaborator

bors commented May 28, 2025

☀️ Test successful - checks-actions
Approved by: tgross35
Pushing 6f69710 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 28, 2025
@bors bors merged commit 6f69710 into rust-lang:master May 28, 2025
8 checks passed
@rustbot rustbot added this to the 1.89.0 milestone May 28, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#140369 Add data_ptr method to Mutex and RwLock fa8d586e340456f74e47a48512104fcfff7ecb2c (link)
#140697 Split autodiff into autodiff_forward and `autodiff_reve… ba77718be3bcd4b39f050323c5199311c2d131d3 (link)
#141404 Improve intrinsic handling in cg_ssa c045e392f4fb0ea9ba2efc08f2a56a963dec1315 (link)
#141411 rustdoc: linking to a local proc macro no longer warns 8a63b672f03ab1bc0284310205045431e0311b08 (link)
#141548 consider glob imports in cfg suggestion e9ac149833515b4c0408fb8f6129f69b35e84087 (link)
#141627 Drop-build cleanups 0f4f550a79dbe6791a253bf3f6eaf7a70c6c2176 (link)
#141670 Fix ICE in tokenstream with contracts from parser recovery f32ce6a311117e415c9ceb9b9c45e6cc9d2df440 (link)

previous master: 40311c4dcf

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

Copy link
Contributor

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 40311c4 (parent) -> 6f69710 (this PR)

Test differences

Show 145 test diffs

Stage 1

  • errors::ad_fallback::verify_builtin_macros_autodiff_not_build_33: [missing] -> pass (J0)
  • errors::ad_fallback::verify_builtin_macros_autodiff_not_build_34: pass -> [missing] (J0)
  • errors::autodiff::verify_builtin_macros_autodiff_32: [missing] -> pass (J0)
  • errors::autodiff::verify_builtin_macros_autodiff_33: pass -> [missing] (J0)
  • errors::autodiff::verify_builtin_macros_autodiff_mode_31: pass -> [missing] (J0)
  • errors::autodiff::verify_builtin_macros_autodiff_width_31: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_attribute_not_supported_67: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_duplicate_arg_68: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_duplicate_arg_69: pass -> [missing] (J0)
  • errors::verify_builtin_macros_asm_explicit_register_name_63: pass -> [missing] (J0)
  • errors::verify_builtin_macros_asm_mayunwind_72: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_mayunwind_73: pass -> [missing] (J0)
  • errors::verify_builtin_macros_asm_modifier_invalid_66: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_modifier_invalid_67: pass -> [missing] (J0)
  • errors::verify_builtin_macros_asm_mutually_exclusive_64: pass -> [missing] (J0)
  • errors::verify_builtin_macros_asm_no_matched_argument_name_71: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_no_matched_argument_name_72: pass -> [missing] (J0)
  • errors::verify_builtin_macros_asm_noreturn_70: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_noreturn_71: pass -> [missing] (J0)
  • errors::verify_builtin_macros_asm_opt_already_provided_73: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_opt_already_provided_74: pass -> [missing] (J0)
  • errors::verify_builtin_macros_asm_pos_after_69: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_pure_combine_64: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_pure_combine_65: pass -> [missing] (J0)
  • errors::verify_builtin_macros_asm_pure_no_output_65: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_unsupported_clobber_abi_75: [missing] -> pass (J0)
  • errors::verify_builtin_macros_asm_unsupported_clobber_abi_76: pass -> [missing] (J0)
  • errors::verify_builtin_macros_asm_unsupported_option_74: [missing] -> pass (J0)
  • errors::verify_builtin_macros_bad_derive_target_42: [missing] -> pass (J0)
  • errors::verify_builtin_macros_cannot_derive_union_50: [missing] -> pass (J0)
  • errors::verify_builtin_macros_cannot_derive_union_51: pass -> [missing] (J0)
  • errors::verify_builtin_macros_concat_bytes_array_37: [missing] -> pass (J0)
  • errors::verify_builtin_macros_concat_bytes_array_38: pass -> [missing] (J0)
  • errors::verify_builtin_macros_concat_bytes_bad_repeat_38: [missing] -> pass (J0)
  • errors::verify_builtin_macros_concat_bytes_missing_literal_36: [missing] -> pass (J0)
  • errors::verify_builtin_macros_concat_bytes_missing_literal_37: pass -> [missing] (J0)
  • errors::verify_builtin_macros_concat_bytes_non_u8_35: [missing] -> pass (J0)
  • errors::verify_builtin_macros_concat_bytes_non_u8_36: pass -> [missing] (J0)
  • errors::verify_builtin_macros_concat_bytes_oob_34: [missing] -> pass (J0)
  • errors::verify_builtin_macros_concat_bytes_oob_35: pass -> [missing] (J0)
  • errors::verify_builtin_macros_concat_idents_ident_args_41: [missing] -> pass (J0)
  • errors::verify_builtin_macros_concat_idents_missing_args_39: [missing] -> pass (J0)
  • errors::verify_builtin_macros_concat_idents_missing_args_40: pass -> [missing] (J0)
  • errors::verify_builtin_macros_concat_idents_missing_comma_41: pass -> [missing] (J0)
  • errors::verify_builtin_macros_default_arg_49: pass -> [missing] (J0)
  • errors::verify_builtin_macros_derive_macro_call_49: [missing] -> pass (J0)
  • errors::verify_builtin_macros_derive_macro_call_50: pass -> [missing] (J0)
  • errors::verify_builtin_macros_derive_path_args_list_44: [missing] -> pass (J0)
  • errors::verify_builtin_macros_derive_path_args_list_45: pass -> [missing] (J0)
  • errors::verify_builtin_macros_derive_path_args_value_45: [missing] -> pass (J0)
  • errors::verify_builtin_macros_derive_path_args_value_46: pass -> [missing] (J0)
  • errors::verify_builtin_macros_env_not_defined_52: [missing] -> pass (J0)
  • errors::verify_builtin_macros_env_not_defined_54: pass -> [missing] (J0)
  • errors::verify_builtin_macros_env_not_unicode_54: [missing] -> pass (J0)
  • errors::verify_builtin_macros_env_not_unicode_55: pass -> [missing] (J0)
  • errors::verify_builtin_macros_env_takes_args_51: [missing] -> pass (J0)
  • errors::verify_builtin_macros_env_takes_args_52: pass -> [missing] (J0)
  • errors::verify_builtin_macros_expected_comma_in_list_78: [missing] -> pass (J0)
  • errors::verify_builtin_macros_expected_other_86: [missing] -> pass (J0)
  • errors::verify_builtin_macros_format_duplicate_arg_56: [missing] -> pass (J0)
  • errors::verify_builtin_macros_format_duplicate_arg_57: pass -> [missing] (J0)
  • errors::verify_builtin_macros_format_no_arg_named_58: [missing] -> pass (J0)
  • errors::verify_builtin_macros_format_no_arg_named_59: pass -> [missing] (J0)
  • errors::verify_builtin_macros_format_positional_after_named_58: pass -> [missing] (J0)
  • errors::verify_builtin_macros_format_requires_string_56: pass -> [missing] (J0)
  • errors::verify_builtin_macros_format_unused_arg_59: [missing] -> pass (J0)
  • errors::verify_builtin_macros_format_unused_arg_60: pass -> [missing] (J0)
  • errors::verify_builtin_macros_naked_functions_testing_attribute_85: pass -> [missing] (J0)
  • errors::verify_builtin_macros_non_exhaustive_default_47: [missing] -> pass (J0)
  • errors::verify_builtin_macros_non_exhaustive_default_48: pass -> [missing] (J0)
  • errors::verify_builtin_macros_non_generic_pointee_85: [missing] -> pass (J0)
  • errors::verify_builtin_macros_non_generic_pointee_86: pass -> [missing] (J0)
  • errors::verify_builtin_macros_non_unit_default_46: [missing] -> pass (J0)
  • errors::verify_builtin_macros_non_unit_default_47: pass -> [missing] (J0)
  • errors::verify_builtin_macros_only_one_argument_79: [missing] -> pass (J0)
  • errors::verify_builtin_macros_proc_macro_attribute_only_be_used_on_bare_functions_81: [missing] -> pass (J0)
  • errors::verify_builtin_macros_proc_macro_attribute_only_be_used_on_bare_functions_82: pass -> [missing] (J0)
  • errors::verify_builtin_macros_proc_macro_attribute_only_usable_with_crate_type_83: pass -> [missing] (J0)
  • errors::verify_builtin_macros_source_uitls_expected_item_83: [missing] -> pass (J0)
  • errors::verify_builtin_macros_source_uitls_expected_item_84: pass -> [missing] (J0)
  • errors::verify_builtin_macros_takes_no_arguments_80: [missing] -> pass (J0)
  • errors::verify_builtin_macros_takes_no_arguments_81: pass -> [missing] (J0)
  • errors::verify_builtin_macros_test_bad_fn_61: [missing] -> pass (J0)
  • errors::verify_builtin_macros_test_bad_fn_62: pass -> [missing] (J0)
  • errors::verify_builtin_macros_test_case_non_item_60: [missing] -> pass (J0)
  • errors::verify_builtin_macros_test_case_non_item_61: pass -> [missing] (J0)
  • errors::verify_builtin_macros_test_runner_invalid_76: [missing] -> pass (J0)
  • errors::verify_builtin_macros_test_runner_invalid_77: pass -> [missing] (J0)
  • errors::verify_builtin_macros_test_runner_nargs_78: pass -> [missing] (J0)
  • errors::verify_builtin_macros_tests_not_support_43: [missing] -> pass (J0)
  • errors::verify_builtin_macros_tests_not_support_44: pass -> [missing] (J0)
  • [crashes] tests/crashes/140683.rs: pass -> [missing] (J1)
  • [rustdoc] tests/rustdoc/intra-doc/link-to-proc-macro.rs: [missing] -> pass (J1)
  • [ui] tests/rustdoc-ui/intra-doc/bad-link-to-proc-macro.rs: [missing] -> pass (J1)
  • [ui] tests/ui/cfg/diagnostics-reexport-2.rs: [missing] -> pass (J1)
  • [ui] tests/ui/macros/ice-in-tokenstream-for-contracts-issue-140683.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/rustdoc-ui/intra-doc/bad-link-to-proc-macro.rs: [missing] -> pass (J2)
  • [ui] tests/ui/cfg/diagnostics-reexport-2.rs: [missing] -> pass (J3)
  • [ui] tests/ui/macros/ice-in-tokenstream-for-contracts-issue-140683.rs: [missing] -> pass (J3)
  • [rustdoc] tests/rustdoc/intra-doc/link-to-proc-macro.rs: [missing] -> pass (J4)

(and 21 additional test diffs)

Additionally, 24 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 6f69710780d579b180ab38da4c1384d630f7bd31 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-x86_64-apple: 7075.7s -> 10983.1s (55.2%)
  2. dist-apple-various: 7970.5s -> 6319.9s (-20.7%)
  3. aarch64-gnu: 8270.4s -> 6714.6s (-18.8%)
  4. x86_64-apple-1: 7928.8s -> 9210.7s (16.2%)
  5. aarch64-apple: 5392.9s -> 4764.9s (-11.6%)
  6. x86_64-apple-2: 5985.6s -> 5406.9s (-9.7%)
  7. dist-x86_64-freebsd: 5304.6s -> 4892.1s (-7.8%)
  8. x86_64-msvc-2: 7256.5s -> 6833.0s (-5.8%)
  9. x86_64-mingw-1: 8737.5s -> 9200.5s (5.3%)
  10. dist-x86_64-illumos: 5984.4s -> 5668.5s (-5.3%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@tgross35 tgross35 deleted the rollup-fhpj180 branch May 28, 2025 20:51
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6f69710): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.1%, secondary 1.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
5.2% [4.9%, 5.5%] 2
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 1
Improvements ✅
(secondary)
-2.1% [-2.8%, -1.3%] 2
All ❌✅ (primary) -0.1% [-1.6%, 1.5%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 778.629s -> 778.42s (-0.03%)
Artifact size: 368.47 MiB -> 368.59 MiB (0.03%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.