Skip to content

Rollup of 18 pull requests #143074

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 44 commits into from
Jun 27, 2025
Merged

Rollup of 18 pull requests #143074

merged 44 commits into from
Jun 27, 2025

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jun 27, 2025

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

the8472 and others added 30 commits June 15, 2025 22:40
No need to call into fold when the first item is already None,
this avoids some redundant work for empty iterators.

"But it uses Fuse" one might want to protest, but Fuse is specialized
and may call into the inner iterator anyway.
It is currently possible to create a dangling `Weak` to a DST by
calling `Weak::new()` for a sized type, then doing an unsized coercion.
Therefore, the comments are wrong.

These comments were added in <rust-lang#73845>.
As far as I can tell, the guarantee in the comment was only previously
used in the `as_ptr` method. However, the current implementation of
`as_ptr` no longer relies on this guarantee.
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
…he error

Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Co-authored-by: Josh Stone <cuviper@gmail.com>
…li-obk

make RefCell unstably const

Now that we can do interior mutability in `const`, most of the `RefCell` API can be `const fn`. The main exceptions are APIs which use `FnOnce` (`RefCell::replace_with` and `Ref[Mut]::[filter_]map[_split]`) and `RefCell::take` which calls `Default::default`.

Tracking issue: rust-lang#137844
const-eval: allow constants to refer to mutable/external memory, but reject such constants as patterns

This fixes rust-lang#140653 by accepting code such as this:
```rust
static FOO: AtomicU32 = AtomicU32::new(0);
const C: &'static AtomicU32 = &FOO;
```
This can be written entirely in safe code, so there can't really be anything wrong with it.

We also accept the much more questionable following code, since it looks very similar to the interpreter:
```rust
static mut FOO2: u32 = 0;
const C2: &'static u32 = unsafe { &mut FOO2 };
```
Using this without causing UB is at least very hard (the details are unclear since it is related to how the aliasing model deals with the staging of const-eval vs runtime code).

If a constant like `C2` is used as a pattern, we emit an error:
```
error: constant BAD_PATTERN cannot be used as pattern
  --> $DIR/const_refs_to_static_fail.rs:30:9
   |
LL |         BAD_PATTERN => {},
   |         ^^^^^^^^^^^
   |
   = note: constants that reference mutable or external memory cannot be used as pattern
```
(If you somehow manage to build a pattern with constant `C`, you'd get the same error, but that should be impossible: we don't have a type that can be used in patterns and that has interior mutability.)

The same treatment is afforded for shared references to `extern static`, for the same reason: the const evaluation is entirely fine with it, we just can't build a pattern for it -- and when using interior mutability, this can be totally sound.

We do still not accept anything where there is an `&mut` in the final value of the const, as that should always require unsafe code and it's hard to imagine a sound use-case that would require this.
…tgross35

small iter.intersperse.fold() optimization

No need to call into fold when the first item is already None, this avoids some redundant work for empty iterators.

"But it uses Fuse" one might want to protest, but Fuse is specialized and may call into the inner iterator anyway.
Remove some glob imports from the type system

Namely, remove the glob imports for `BoundRegionConversionTime`, `RegionVariableOrigin`, `SubregionOrigin`, `TyOrConstInferVar`, `RegionResolutionError`, `SelectionError`, `ProjectionCandidate`, `ProjectionCandidateSet`, and some more specific scoped globs (like `Inserted` in the impl overlap graph construction.

These glob imports are IMO very low value, since they're not used nearly as often as other globs (like `TyKind`).
@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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-release Relevant to the release subteam, 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Jun 27, 2025
@compiler-errors
Copy link
Member Author

compiler-errors commented Jun 27, 2025

This should be disjoint from #143057, but I fear that PR will fail anyways with a CI timeout since it seems like the apple-1 job is hanging.

@compiler-errors
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Collaborator

bors commented Jun 27, 2025

📌 Commit cb0b621 has been approved by compiler-errors

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 Jun 27, 2025
@bors
Copy link
Collaborator

bors commented Jun 27, 2025

⌛ Testing commit cb0b621 with merge e61dd43...

@bors
Copy link
Collaborator

bors commented Jun 27, 2025

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing e61dd43 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 27, 2025
@bors bors merged commit e61dd43 into rust-lang:master Jun 27, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jun 27, 2025
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 513999b (parent) -> e61dd43 (this PR)

Test differences

Show 1060 test diffs

Stage 1

  • error::verify_middle_max_num_nodes_in_valtree_17: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_add_native_library_34: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_compiler_builtins_cannot_call_125: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_copy_path_28: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_copy_path_29: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_copy_path_buf_27: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_create_temp_dir_33: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_error_calling_dlltool_124: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_error_creating_import_library_126: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_extract_bundled_libs_convert_name_69: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_extract_bundled_libs_mmap_file_65: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_extract_bundled_libs_open_file_64: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_extract_bundled_libs_write_file_71: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_failed_to_write_61: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_ignoring_emit_path_31: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_illegal_link_ordinal_format_118: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_basic_float_type_81: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_cast_wide_pointer_109: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_expected_element_type_107: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_simd_first_87: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_simd_return_91: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_third_argument_length_95: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_unsupported_symbol_of_size_108: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_link_script_unavailable_58: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_link_script_write_failure_59: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_multiple_external_func_decl_35: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_rlib_incompatible_dependency_formats_39: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_rlib_only_rmeta_found_37: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_target_feature_safe_trait_118: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_unable_to_run_dsymutil_52: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_unable_to_run_dsymutil_53: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_xcrun_failed_invoking_130: pass -> [missing] (J0)
  • errors::verify_const_eval_interior_mutable_ref_escaping_23: pass -> [missing] (J0)
  • errors::verify_const_eval_non_const_await_29: [missing] -> pass (J0)
  • errors::verify_const_eval_non_const_await_31: pass -> [missing] (J0)
  • errors::verify_const_eval_non_const_deref_coercion_32: pass -> [missing] (J0)
  • errors::verify_const_eval_non_const_for_loop_into_iter_27: pass -> [missing] (J0)
  • errors::verify_const_eval_non_const_intrinsic_17: [missing] -> pass (J0)
  • errors::verify_const_eval_non_const_match_eq_26: pass -> [missing] (J0)
  • errors::verify_const_eval_unallowed_inline_asm_20: [missing] -> pass (J0)
  • errors::verify_const_eval_unstable_const_fn_10: pass -> [missing] (J0)
  • errors::verify_const_eval_unstable_intrinsic_11: [missing] -> pass (J0)
  • errors::verify_const_eval_unstable_intrinsic_12: pass -> [missing] (J0)
  • errors::verify_passes_align_should_be_repr_align_176: pass -> [missing] (J0)
  • errors::verify_passes_attr_application_enum_138: pass -> [missing] (J0)
  • errors::verify_passes_attr_application_struct_139: pass -> [missing] (J0)
  • errors::verify_passes_both_ffi_const_and_pure_55: pass -> [missing] (J0)
  • errors::verify_passes_cold_60: pass -> [missing] (J0)
  • errors::verify_passes_cold_61: [missing] -> pass (J0)
  • errors::verify_passes_const_stable_not_stable_155: pass -> [missing] (J0)
  • errors::verify_passes_doc_alias_bad_location_26: pass -> [missing] (J0)
  • errors::verify_passes_doc_alias_bad_location_27: [missing] -> pass (J0)
  • errors::verify_passes_doc_alias_not_string_literal_30: [missing] -> pass (J0)
  • errors::verify_passes_doc_attr_not_crate_level_42: [missing] -> pass (J0)
  • errors::verify_passes_doc_cfg_hide_takes_list_45: pass -> [missing] (J0)
  • errors::verify_passes_doc_expect_str_22: pass -> [missing] (J0)
  • errors::verify_passes_doc_fake_variadic_not_valid_34: pass -> [missing] (J0)
  • errors::verify_passes_doc_inline_only_use_38: pass -> [missing] (J0)
  • errors::verify_passes_doc_invalid_52: [missing] -> pass (J0)
  • errors::verify_passes_doc_keyword_only_impl_35: pass -> [missing] (J0)
  • errors::verify_passes_doc_masked_not_extern_crate_self_41: [missing] -> pass (J0)
  • errors::verify_passes_doc_masked_only_extern_crate_39: pass -> [missing] (J0)
  • errors::verify_passes_doc_search_unbox_invalid_36: pass -> [missing] (J0)
  • errors::verify_passes_doc_test_literal_44: [missing] -> pass (J0)
  • errors::verify_passes_doc_test_takes_list_45: [missing] -> pass (J0)
  • errors::verify_passes_doc_test_unknown_42: pass -> [missing] (J0)
  • errors::verify_passes_doc_test_unknown_include_50: pass -> [missing] (J0)
  • errors::verify_passes_doc_test_unknown_include_51: [missing] -> pass (J0)
  • errors::verify_passes_feature_previously_declared_128: pass -> [missing] (J0)
  • errors::verify_passes_feature_stable_twice_127: pass -> [missing] (J0)
  • errors::verify_passes_ffi_pure_invalid_target_56: pass -> [missing] (J0)
  • errors::verify_passes_ffi_pure_invalid_target_57: [missing] -> pass (J0)
  • errors::verify_passes_ignored_attr_10: [missing] -> pass (J0)
  • errors::verify_passes_ignored_attr_with_macro_9: [missing] -> pass (J0)
  • errors::verify_passes_incorrect_target_132: pass -> [missing] (J0)
  • errors::verify_passes_incorrect_target_133: [missing] -> pass (J0)
  • errors::verify_passes_inline_ignored_function_prototype_11: [missing] -> pass (J0)
  • errors::verify_passes_layout_invalid_attribute_122: pass -> [missing] (J0)
  • errors::verify_passes_layout_invalid_attribute_123: [missing] -> pass (J0)
  • errors::verify_passes_may_dangle_101: pass -> [missing] (J0)
  • errors::verify_passes_must_use_no_effect_59: [missing] -> pass (J0)
  • errors::verify_passes_object_lifetime_err_138: [missing] -> pass (J0)
  • errors::verify_passes_optimize_invalid_target_14: pass -> [missing] (J0)
  • errors::verify_passes_proc_macro_bad_sig_157: [missing] -> pass (J0)
  • errors::verify_passes_rustc_allow_const_fn_unstable_84: pass -> [missing] (J0)
  • errors::verify_passes_rustc_const_stable_indirect_pairing_167: [missing] -> pass (J0)
  • errors::verify_passes_rustc_dirty_clean_71: pass -> [missing] (J0)
  • errors::verify_passes_should_be_applied_to_static_21: pass -> [missing] (J0)
  • errors::verify_passes_stability_promotable_94: [missing] -> pass (J0)
  • errors::verify_passes_unexportable_fn_abi_171: [missing] -> pass (J0)
  • errors::verify_passes_unexportable_priv_item_173: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_type_repr_172: [missing] -> pass (J0)
  • errors::verify_passes_unknown_external_lang_item_109: [missing] -> pass (J0)
  • errors::verify_passes_unrecognized_argument_126: pass -> [missing] (J0)
  • errors::verify_passes_unstable_attr_for_already_stable_feature_146: pass -> [missing] (J0)
  • errors::verify_passes_unused_assign_passed_164: pass -> [missing] (J0)
  • errors::verify_passes_unused_var_assigned_only_161: [missing] -> pass (J0)
  • errors::verify_passes_unused_var_maybe_capture_ref_159: [missing] -> pass (J0)
  • errors::verify_passes_useless_assignment_135: [missing] -> pass (J0)
  • cell::refcell_swap: [missing] -> pass (J1)

(and 552 additional test diffs)

Additionally, 408 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 e61dd437f33b5a640e67dc3628397689c664c17f --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. x86_64-apple-1: 15588.4s -> 6875.9s (-55.9%)
  2. dist-aarch64-linux: 5881.8s -> 8716.3s (48.2%)
  3. dist-apple-various: 10477.7s -> 6058.3s (-42.2%)
  4. x86_64-apple-2: 6249.3s -> 5350.2s (-14.4%)
  5. dist-aarch64-apple: 6333.2s -> 5668.8s (-10.5%)
  6. mingw-check-tidy: 67.1s -> 73.2s (9.2%)
  7. dist-x86_64-apple: 8244.8s -> 8938.8s (8.4%)
  8. x86_64-gnu-nopt: 7900.5s -> 7362.9s (-6.8%)
  9. x86_64-gnu-aux: 6148.9s -> 6544.1s (6.4%)
  10. dist-x86_64-linux-alt: 7848.3s -> 7393.2s (-5.8%)
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.

@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#137843 make RefCell unstably const fd5b5d911ea154d98a3740b482feae761f0b5079 (link)
#140942 const-eval: allow constants to refer to mutable/external me… 6b8c6b4bb3ff8b24b49f63edd87d757048f5e698 (link)
#142549 small iter.intersperse.fold() optimization 3a6a0a518e01ddb44da9951c10042012559d323d (link)
#142637 Remove some glob imports from the type system 2d99b5a5a015d4b48c9737be7ac66a7ee23dd319 (link)
#142647 [perf] Compute hard errors without diagnostics in impl_inte… 339fb3748c335bc28ef37946f2b44f604337d7ae (link)
#142700 Remove incorrect comments in Weak eba0eeb975c6695d033623fe7ae676fca9ba1f82 (link)
#142927 Add note to find_const_ty_from_env 928b209224a5c28dc1f5f7451af5ef3c004a1152 (link)
#142967 Fix RwLock::try_write documentation for WouldBlock condition 67979ce9c80ae501e8b9f9263d1fea2ef7472d59 (link)
#142986 Port #[export_name] to the new attribute parsing infrastr… 35da7106c8310687a5db3df0e18cadf9f960d55b (link)
#143001 Rename run always 2c37a2099cc871c0d98ba8381fd842748eedb582 (link)
#143010 Update browser-ui-test version to 0.20.7 11a09f79158826eaf9053d9a04bb1f5cb5437552 (link)
#143015 Add sym::macro_pin diagnostic item for core::pin::pin!() 12344de11eb24321fd3bfd430f28946312b87e54 (link)
#143033 Expand const-stabilized API links in relnotes a82360efe55ca9ce1e2c84590b5cc6fd4373dd5c (link)
#143041 Remove cache for citool b522e2c4d987ece2ac922a607157d6ff0a36765c (link)
#143056 Move an ACE test out of the GCI directory 06987cadc4c6d95e098f91be8bf3621c11d7fb15 (link)
#143059 Fix 1.88 relnotes e4f3ca9605eea5e6c4bfa7a2eab60a5968eed8c9 (link)
#143067 Tracking issue number for iter_macro db532c0d85ac8d066183c8c2f74f04fcaba3fbce (link)
#143073 Fix some fixmes that were waiting for let chains 2c0d666e8c9ee803d6881881b07611659237de9f (link)

previous master: 513999b936

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

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e61dd43): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

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

Max RSS (memory usage)

Results (primary -2.7%, secondary 2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.7% [1.7%, 1.7%] 1
Regressions ❌
(secondary)
2.8% [2.1%, 4.0%] 3
Improvements ✅
(primary)
-4.8% [-4.9%, -4.7%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.7% [-4.9%, 1.7%] 3

Cycles

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

Binary size

Results (primary -0.0%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 4
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 38
Improvements ✅
(primary)
-0.2% [-0.4%, -0.0%] 2
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 1
All ❌✅ (primary) -0.0% [-0.4%, 0.0%] 6

Bootstrap: 692.298s -> 692.733s (0.06%)
Artifact size: 372.03 MiB -> 372.08 MiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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-release Relevant to the release subteam, 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy