Skip to content

Rollup of 3 pull requests#152239

Merged
rust-bors[bot] merged 6 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-2BolGX5
Feb 6, 2026
Merged

Rollup of 3 pull requests#152239
rust-bors[bot] merged 6 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-2BolGX5

Conversation

@JonathanBrouwer
Copy link
Contributor

Successful merges:

r? @ghost

Create a similar rollup

JonathanBrouwer and others added 6 commits February 6, 2026 13:31
…e-consts, r=BoxyUwU

MGCA: require #[type_const] on free consts too

When investigating another issue, I discovered that following ICEs (the `const_of_item` query doesn't support non-type_const-marked constants and does a `span_delayed_bug`):

```rust
#![feature(min_generic_const_args)]
#![allow(incomplete_features)]

const N: usize = 4;

fn main() {
    let x = [(); N];
}
```

My initial thought of "only require `#[type_const]` on places that stable doesn't currently accept" ran into the issue of this compiling on stable today:

```rust
trait Trait {
    const N: usize;
}

impl<const PARAM: usize> Trait for [(); PARAM] {
    const N: usize = PARAM;
}

fn main() {
    let x = [(); <[(); 4] as Trait>::N];
}
```

Figuring out which specific cases are not currently accepted by stable is quite hairy.

Upon discussion with @BoxyUwU, she suggested that *all* consts, including free consts, should require `#[type_const]` to be able to be referred to. This is what this PR does.

---

~~The change to `tests/ui/const-generics/generic_const_exprs/non-local-const.rs` is unfortunate, reverting the fix in rust-lang#143106 no longer fails the test. Any suggestions to test it more appropriately would be most welcome!~~

edit: never mind, figured out how compiletests work :) - verified that the new test setup correctly ICEs when that PR's fix is reverted.

r? @BoxyUwU
…=BoxyUwU

mGCA: Support directly represented negated literals

fixes rust-lang#152123

PatExprKind already awkwardly tacks on a `negated: bool` for the same purpose:

https://github.com/rust-lang/rust/blob/8bccf1224deab49b54694c9090e577bfe90a94e6/compiler/rustc_hir/src/hir.rs#L1954-L1959

perhaps one day we should indeed do that FIXME...

r? @BoxyUwU
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Feb 6, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler 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. labels Feb 6, 2026
@JonathanBrouwer
Copy link
Contributor Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 6, 2026

📌 Commit ce8d09b has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Feb 6, 2026
@rust-bors

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 6, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 21m 4s
Pushing efc9e1b to main...

@rust-bors rust-bors bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 6, 2026
@rust-bors rust-bors bot merged commit efc9e1b into rust-lang:main Feb 6, 2026
12 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 6, 2026
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#152129 MGCA: require #[type_const] on free consts too ce85f859eade06c955590eaad6e2261e81e6d716 (link)
#152139 mGCA: Support directly represented negated literals a9aba71e52f4faf577e3197cb84041c0aef44ffc (link)
#152189 Convert to inline diagnostics in rustc_passes 202ae3331546f6385137fd7ec7065d8ec95769f3 (link)

previous master: bce89b6a56

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

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 bce89b6 (parent) -> efc9e1b (this PR)

Test differences

Show 246 test diffs

Stage 0

  • check_attr::verify_passes_diagnostic_diagnostic_on_const_only_for_non_const_trait_impls_2: pass -> [missing] (J1)
  • check_attr::verify_passes_diagnostic_diagnostic_on_unimplemented_only_for_traits_0: pass -> [missing] (J1)
  • errors::verify_passes_const_continue_attr_6: pass -> [missing] (J1)
  • errors::verify_passes_custom_mir_phase_requires_dialect_100: pass -> [missing] (J1)
  • errors::verify_passes_deprecated_attribute_72: pass -> [missing] (J1)
  • errors::verify_passes_doc_alias_bad_location_10: pass -> [missing] (J1)
  • errors::verify_passes_doc_alias_not_an_alias_11: pass -> [missing] (J1)
  • errors::verify_passes_doc_keyword_attribute_empty_mod_12: pass -> [missing] (J1)
  • errors::verify_passes_doc_keyword_only_impl_15: pass -> [missing] (J1)
  • errors::verify_passes_doc_masked_not_extern_crate_self_20: pass -> [missing] (J1)
  • errors::verify_passes_doc_masked_only_extern_crate_19: pass -> [missing] (J1)
  • errors::verify_passes_duplicate_diagnostic_item_in_crate_48: pass -> [missing] (J1)
  • errors::verify_passes_eii_fn_with_track_caller_103: pass -> [missing] (J1)
  • errors::verify_passes_extern_main_61: pass -> [missing] (J1)
  • errors::verify_passes_function_not_have_default_implementation_106: pass -> [missing] (J1)
  • errors::verify_passes_incorrect_crate_type_63: pass -> [missing] (J1)
  • errors::verify_passes_incorrect_do_not_recommend_location_3: pass -> [missing] (J1)
  • errors::verify_passes_ineffective_unstable_impl_87: pass -> [missing] (J1)
  • errors::verify_passes_inner_crate_level_attr_8: pass -> [missing] (J1)
  • errors::verify_passes_layout_align_50: pass -> [missing] (J1)
  • errors::verify_passes_layout_size_51: pass -> [missing] (J1)
  • errors::verify_passes_link_22: pass -> [missing] (J1)
  • errors::verify_passes_macro_only_attribute_29: pass -> [missing] (J1)
  • errors::verify_passes_may_dangle_36: pass -> [missing] (J1)
  • errors::verify_passes_missing_const_stab_attr_77: pass -> [missing] (J1)
  • errors::verify_passes_missing_panic_handler_41: pass -> [missing] (J1)
  • errors::verify_passes_missing_stability_attr_76: pass -> [missing] (J1)
  • errors::verify_passes_mixed_export_name_and_no_mangle_7: pass -> [missing] (J1)
  • errors::verify_passes_multiple_rustc_main_60: pass -> [missing] (J1)
  • errors::verify_passes_non_exhaustive_with_default_field_values_9: pass -> [missing] (J1)
  • errors::verify_passes_panic_unwind_without_std_42: pass -> [missing] (J1)
  • errors::verify_passes_proc_macro_bad_sig_84: pass -> [missing] (J1)
  • errors::verify_passes_repr_align_greater_than_target_max_27: pass -> [missing] (J1)
  • errors::verify_passes_rustc_const_stable_indirect_pairing_89: pass -> [missing] (J1)
  • errors::verify_passes_rustc_force_inline_coro_33: pass -> [missing] (J1)
  • errors::verify_passes_rustc_legacy_const_generics_index_exceed_25: pass -> [missing] (J1)
  • errors::verify_passes_rustc_pub_transparent_32: pass -> [missing] (J1)
  • errors::verify_passes_sanitize_attribute_not_allowed_88: pass -> [missing] (J1)
  • errors::verify_passes_unexportable_generic_fn_92: pass -> [missing] (J1)
  • errors::verify_passes_unexportable_item_91: pass -> [missing] (J1)
  • errors::verify_passes_unexportable_type_in_interface_95: pass -> [missing] (J1)
  • errors::verify_passes_unexportable_type_repr_94: pass -> [missing] (J1)
  • errors::verify_passes_unknown_external_lang_item_40: pass -> [missing] (J1)
  • errors::verify_passes_unstable_attr_for_already_stable_feature_75: pass -> [missing] (J1)
  • errors::verify_passes_unused_duplicate_37: pass -> [missing] (J1)

Stage 1

  • errors::verify_passes_abi_invalid_attribute_56: pass -> [missing] (J0)
  • errors::verify_passes_attr_application_struct_68: pass -> [missing] (J0)
  • errors::verify_passes_attr_application_struct_union_69: pass -> [missing] (J0)
  • errors::verify_passes_autodiff_attr_4: pass -> [missing] (J0)
  • errors::verify_passes_cannot_stabilize_deprecated_74: pass -> [missing] (J0)
  • errors::verify_passes_const_continue_attr_6: pass -> [missing] (J0)
  • errors::verify_passes_custom_mir_incompatible_dialect_and_phase_101: pass -> [missing] (J0)
  • errors::verify_passes_debug_visualizer_unreadable_30: pass -> [missing] (J0)
  • errors::verify_passes_doc_alias_bad_location_10: pass -> [missing] (J0)
  • errors::verify_passes_doc_alias_not_an_alias_11: pass -> [missing] (J0)
  • errors::verify_passes_doc_inline_only_use_18: pass -> [missing] (J0)
  • errors::verify_passes_doc_keyword_attribute_empty_mod_12: pass -> [missing] (J0)
  • errors::verify_passes_doc_masked_not_extern_crate_self_20: pass -> [missing] (J0)
  • errors::verify_passes_duplicate_eii_impls_105: pass -> [missing] (J0)
  • errors::verify_passes_duplicate_feature_err_81: pass -> [missing] (J0)
  • errors::verify_passes_feature_previously_declared_59: pass -> [missing] (J0)
  • errors::verify_passes_feature_stable_twice_58: pass -> [missing] (J0)
  • errors::verify_passes_function_not_found_in_trait_107: pass -> [missing] (J0)
  • errors::verify_passes_incorrect_crate_type_63: pass -> [missing] (J0)
  • errors::verify_passes_incorrect_do_not_recommend_location_3: pass -> [missing] (J0)
  • errors::verify_passes_ineffective_unstable_impl_87: pass -> [missing] (J0)
  • errors::verify_passes_inline_ignored_for_exported_65: pass -> [missing] (J0)
  • errors::verify_passes_lang_item_fn_with_target_feature_45: pass -> [missing] (J0)
  • errors::verify_passes_lang_item_on_incorrect_target_46: pass -> [missing] (J0)
  • errors::verify_passes_layout_abi_49: pass -> [missing] (J0)
  • errors::verify_passes_layout_homogeneous_aggregate_52: pass -> [missing] (J0)
  • errors::verify_passes_layout_size_51: pass -> [missing] (J0)
  • errors::verify_passes_link_22: pass -> [missing] (J0)
  • errors::verify_passes_loop_match_attr_5: pass -> [missing] (J0)
  • errors::verify_passes_macro_only_attribute_29: pass -> [missing] (J0)
  • errors::verify_passes_may_dangle_36: pass -> [missing] (J0)
  • errors::verify_passes_missing_const_err_82: pass -> [missing] (J0)
  • errors::verify_passes_mixed_export_name_and_no_mangle_7: pass -> [missing] (J0)
  • errors::verify_passes_object_lifetime_err_66: pass -> [missing] (J0)
  • errors::verify_passes_panic_unwind_without_std_42: pass -> [missing] (J0)
  • errors::verify_passes_repr_align_should_be_align_static_99: pass -> [missing] (J0)
  • errors::verify_passes_repr_conflicting_26: pass -> [missing] (J0)
  • errors::verify_passes_repr_conflicting_28: pass -> [missing] (J0)
  • errors::verify_passes_rustc_force_inline_coro_33: pass -> [missing] (J0)
  • errors::verify_passes_rustc_legacy_const_generics_index_exceed_25: pass -> [missing] (J0)
  • errors::verify_passes_rustc_legacy_const_generics_only_23: pass -> [missing] (J0)
  • errors::verify_passes_transparent_incompatible_71: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_adt_with_private_fields_97: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_fn_abi_93: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_item_91: pass -> [missing] (J0)
  • errors::verify_passes_unexportable_type_repr_94: pass -> [missing] (J0)
  • errors::verify_passes_unknown_external_lang_item_40: pass -> [missing] (J0)
  • errors::verify_passes_unnecessary_partial_stable_feature_86: pass -> [missing] (J0)
  • errors::verify_passes_unstable_attr_for_already_stable_feature_75: pass -> [missing] (J0)
  • errors::verify_passes_unused_duplicate_37: pass -> [missing] (J0)
  • errors::verify_passes_useless_assignment_64: pass -> [missing] (J0)
  • errors::verify_passes_useless_stability_73: pass -> [missing] (J0)

Stage 2

  • [ui] tests/ui/const-generics/mgca/negated-literal.rs: [missing] -> pass (J2)
  • [ui] tests/ui/const-generics/mgca/non-local-const-without-type_const.rs: [missing] -> pass (J2)
  • [ui] tests/ui/const-generics/mgca/unmarked-free-const.rs: [missing] -> pass (J2)

(and 124 additional test diffs)

Additionally, 22 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 efc9e1b50cbf2cede7ebe25f0a1fc64fd8b3e942 --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: 2h 21m -> 1h 41m (-28.5%)
  2. dist-x86_64-solaris: 1h 30m -> 1h 49m (+21.2%)
  3. aarch64-apple: 2h 49m -> 3h 12m (+13.6%)
  4. aarch64-msvc-2: 1h 56m -> 1h 40m (-13.0%)
  5. dist-apple-various: 1h 6m -> 1h 13m (+10.4%)
  6. arm-android: 1h 44m -> 1h 36m (-8.2%)
  7. x86_64-gnu-gcc: 1h 4m -> 1h 9m (+8.1%)
  8. x86_64-gnu-llvm-20: 1h 16m -> 1h 11m (-7.3%)
  9. pr-check-2: 42m 36s -> 39m 56s (-6.2%)
  10. aarch64-gnu-debug: 1h 15m -> 1h 20m (+6.1%)
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

Finished benchmarking commit (efc9e1b): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.9% [0.5%, 1.4%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.7% [-15.6%, -0.4%] 32
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.9%, secondary -2.1%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.1% [5.1%, 5.1%] 1
Improvements ✅
(primary)
-0.9% [-1.1%, -0.6%] 4
Improvements ✅
(secondary)
-2.6% [-3.6%, -1.1%] 14
All ❌✅ (primary) -0.9% [-1.1%, -0.6%] 4

Cycles

Results (secondary -4.7%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.6%, 2.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.9% [-10.1%, -3.0%] 12
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 474.508s -> 474.536s (0.01%)
Artifact size: 397.96 MiB -> 397.98 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Feb 6, 2026
@nnethercote
Copy link
Contributor

Some huge perf wins in secondary benchmarks issue-46449 and wf-projection-stress-65510. I have very little sense of which PR might be responsible, let's try them one at a time.

@rust-timer build ce85f85

@rust-timer
Copy link
Collaborator

Missing artifact for sha ce85f859eade06c955590eaad6e2261e81e6d716 (https://ci-artifacts.rust-lang.org/rustc-builds/ce85f859eade06c955590eaad6e2261e81e6d716/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz); not built yet, try again later.

@JonathanBrouwer
Copy link
Contributor Author

It is #152189, all the other inline diagnostics PRs had similar results

@nnethercote
Copy link
Contributor

Good to know, thanks!

@JonathanBrouwer
Copy link
Contributor Author

JonathanBrouwer commented Feb 6, 2026

The perf regression is also likely #152189, just checked and that benchmark emits 300 diagnostics. Inline diagnostics are slightly slower when actually used, while being much faster when not used. Will wait with making it as triaged until we can run the build for that PR, but pretty sure

@panstromek
Copy link
Contributor

just checked and that benchmark emits 300 diagnostics.

Is the benchmark output somewhere on the website or did you run it locally? I was looking for the output other day and couldn't find anything.

@JonathanBrouwer
Copy link
Contributor Author

I checked it locally, it is helpfully already in the rust repo in collector/compile-benchmarks/derive

@JonathanBrouwer
Copy link
Contributor Author

@rust-timer build 202ae33

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (202ae33): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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.9% [0.5%, 1.4%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.5% [-15.6%, -0.4%] 33
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.9%, secondary -2.0%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.4% [5.4%, 5.4%] 1
Improvements ✅
(primary)
-0.9% [-1.2%, -0.6%] 3
Improvements ✅
(secondary)
-2.6% [-3.4%, -1.1%] 13
All ❌✅ (primary) -0.9% [-1.2%, -0.6%] 3

Cycles

Results (secondary -5.2%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.9% [2.9%, 2.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.9% [-9.4%, -2.7%] 11
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 474.508s -> 474.986s (0.10%)
Artifact size: 397.96 MiB -> 398.00 MiB (0.01%)

@JonathanBrouwer
Copy link
Contributor Author

Yep, caused by #152189
Overall positive so @rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. rollup A PR which is a rollup T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants