Skip to content

Rollup of 9 pull requests#155309

Closed
JonathanBrouwer wants to merge 21 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-jdUZekM
Closed

Rollup of 9 pull requests#155309
JonathanBrouwer wants to merge 21 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-jdUZekM

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

krtab and others added 21 commits April 3, 2026 19:04
This especially means that for c: char, c.is_ascii() &&
c.is_whitespace() does **not** imply c.is_ascii_whitespace().
* Fix ICE when Self is used in enum discriminant of a generic enum

Move the validation into the existing `check_param_uses_if_mcg` machinery
in HIR ty lowering instead of adding a new check in wfcheck. After the
`AnonConstKind` refactoring, `ForbidMCGParamUsesFolder` was only gated on
`AnonConstKind::MCG`, causing discriminant anon consts (`NonTypeSystem`) to
bypass it entirely.

Add `anon_const_forbids_generic_params()` which returns the appropriate
`ForbidParamContext` for both MCG and enum discriminant contexts. Wire it
into `check_param_uses_if_mcg` so that `Self` aliasing a generic type is
caught before reaching `const_eval_poly`. Convert the `TooGeneric` span_bug
into a proper diagnostic as a fallback for anything slipping through
type-dependent path resolution.
* Address review comments

- Rename `ForbidMCGParamUsesFolder` to `ForbidParamUsesFolder`
- Rename `MinConstGenerics` variant to `ConstArgument` with updated doc
- Simplify doc comment on `anon_const_forbids_generic_params`
- Make match on `AnonConstKind` exhaustive
- Move `anon_const_def_id` inside the `if let` in `check_param_uses_if_mcg`
- Remove now-unreachable `TooGeneric` span_err in wfcheck
* Revert TooGeneric arm back to span_bug! as requested by reviewer
* Use generics_of to determine if NonTypeSystem anon consts allow generic params
* Also check InlineConst and Closure defs nested in enum discriminants
* Simplify logic for determining anonymous constant parent in generic contexts
* add test
…ate, r=BoxyUwU

Add `const_param_ty_unchecked` gate

Add `const_param_ty_unchecked` internal feature gate to skip `ConstParamTy_` trait enforcement on type. Provides an escape hatch for writing tests and examples that use const generics without needing to ensure all fields implement `ConstParamTy_`.

r? BoxyUwU
…eric-self, r=BoxyUwU

Fix ICE when Self is used in enum discriminant of a generic enum

Fixes rust-lang#153756
Let discriminant AnonConst inherit parent generics via Node::Variant in generics_of, and emit a proper error instead of span_bug! for the TooGeneric case in wfcheck.
…=BoxyUwU

Gate tuple const params behind `min_adt_const_params` feature

r? BoxyUwU
…umeGomez

fix arch names in cfg pretty printer

It's introduced in rust-lang#154328.

@rustbot label +beta-nominated

(it affects the documentation of [`core::arch::loongarch32`](https://doc.rust-lang.org/beta/core/arch/loongarch32/index.html) and [`core::arch::loongarch64`](https://doc.rust-lang.org/beta/core/arch/loongarch64/index.html))
…-Simulacrum,WaffleLapkin

Clarify ascii whitespace exclusion of vertical tab in the doc

This especially means that for `c: char`, `c.is_ascii() && c.is_whitespace()` does **not** imply `c.is_ascii_whitespace()`, which can cause bug and is highly counterintuitive.
…nup, r=lcnr

Some small nits for supertrait_item_shadowing, and additional testing

cc rust-lang#89151

r? types
…rn-white-space, r=jdonszelmann

Test/lexer unicode pattern white space

This PR adds a test for the Rust lexer to verify it correctly accepts vertical tab (`\x0B`) as valid whitespace between tokens. Vertical tab is part of Unicode Pattern_White_Space, which the Rust language specification uses to define whitespace.

Related: Outreachy tracking [Pattern_White_Space](https://www.unicode.org/reports/tr31/#R3a)
…athanBrouwer

Tests for precise-capture through RPIT and TAIT

- Tests for rust-lang#155151.

These tests succeed under `-Znext-solver`, but incorrectly fail under the old trait solver.

---

The bug can be triggered via return-position `impl Trait` on stable, but requires some rather contrived code. When using type-alias `impl Trait`, it's easier to imagine the issue being triggered by real code.
…onathanBrouwer

remove PointeeParser

this parser does nothing currently, as the current scope of `rustc_attr_parsing` only includes builtin attributes, and not derive macros

it isn't defined in `compiler/rustc_feature/src/builtin_attrs.rs`

all the actual parsing for `#[pointee]` is actually handled in `compiler/rustc_builtin_macros/src/deriving/coerce_pointee.rs`

r? @JonathanBrouwer
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Apr 14, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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. labels Apr 14, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1,i686-msvc-2

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 14, 2026

📌 Commit 8b4c5ef 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 Apr 14, 2026
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Apr 14, 2026
Rollup of 9 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple
try-job: x86_64-mingw-1
try-job: i686-msvc-2
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Apr 14, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #153536 (Add `const_param_ty_unchecked` gate)
 - #153815 (Fix ICE when Self is used in enum discriminant of a generic enum)
 - #154882 (Gate tuple const params behind `min_adt_const_params` feature)
 - #155293 (fix arch names in cfg pretty printer)
 - #154765 (Clarify ascii whitespace exclusion of vertical tab in the doc)
 - #155172 (Some small nits for supertrait_item_shadowing, and additional testing)
 - #155279 (Test/lexer unicode pattern white space)
 - #155280 (Tests for precise-capture through RPIT and TAIT)
 - #155304 (remove PointeeParser)
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 15, 2026

☀️ Try build successful (CI)
Build commit: ccf31aa (ccf31aae877cb024ad23d187e3dda4a6c394b564, parent: a5c825cd824ee0ef9463021078a2f464b4cc1a0d)

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-nopt failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/const-generics/adt_const_params/const_param_ty_unchecked.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/const-generics/adt_const_params/const_param_ty_unchecked.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/adt_const_params/const_param_ty_unchecked/a" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
##[error]error: internal compiler error: compiler/rustc_symbol_mangling/src/v0.rs:829:17: symbol_names: unsupported constant of type `f64` (1f64)


thread 'rustc' (105584) panicked at compiler/rustc_symbol_mangling/src/v0.rs:829:17:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: <rustc_symbol_mangling::v0::V0SymbolMangler as rustc_middle::ty::print::Printer>::print_const
   7: <rustc_symbol_mangling::v0::V0SymbolMangler as rustc_middle::ty::print::Printer>::print_path_with_generic_args::<<rustc_symbol_mangling::v0::V0SymbolMangler as rustc_middle::ty::print::Printer>::default_print_def_path::{closure#0}>
   8: <rustc_symbol_mangling::v0::V0SymbolMangler as rustc_middle::ty::print::Printer>::print_def_path
   9: rustc_symbol_mangling::v0::mangle
  10: rustc_symbol_mangling::symbol_name_provider
      [... omitted 1 frame ...]
  11: <rustc_middle::mono::MonoItem>::symbol_name
  12: <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::mono::MonoItem>, rustc_monomorphize::partitioning::assert_symbols_are_distinct<core::slice::iter::Iter<rustc_middle::mono::MonoItem>>::{closure#0}> as core::iter::traits::iterator::Iterator>::fold::<(), core::iter::traits::iterator::Iterator::for_each::call<(&rustc_middle::mono::MonoItem, rustc_middle::ty::SymbolName), <alloc::vec::Vec<(&rustc_middle::mono::MonoItem, rustc_middle::ty::SymbolName)>>::extend_trusted<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::mono::MonoItem>, rustc_monomorphize::partitioning::assert_symbols_are_distinct<core::slice::iter::Iter<rustc_middle::mono::MonoItem>>::{closure#0}>>::{closure#0}>::{closure#0}>
  13: <alloc::vec::Vec<(&rustc_middle::mono::MonoItem, rustc_middle::ty::SymbolName)> as alloc::vec::spec_from_iter::SpecFromIter<(&rustc_middle::mono::MonoItem, rustc_middle::ty::SymbolName), core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::mono::MonoItem>, rustc_monomorphize::partitioning::assert_symbols_are_distinct<core::slice::iter::Iter<rustc_middle::mono::MonoItem>>::{closure#0}>>>::from_iter
  14: rustc_monomorphize::partitioning::assert_symbols_are_distinct::<core::slice::iter::Iter<rustc_middle::mono::MonoItem>>
  15: <rustc_session::session::Session>::time::<(&[rustc_middle::mono::CodegenUnit], ()), rustc_monomorphize::partitioning::collect_and_partition_mono_items::{closure#0}>
  16: rustc_monomorphize::partitioning::collect_and_partition_mono_items
      [... omitted 1 frame ...]
  17: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  18: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  19: rustc_interface::passes::start_codegen
  20: <rustc_interface::queries::Linker>::codegen_and_build_linker
  21: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  22: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
  23: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  24: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
  25: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
  26: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: rustc 1.97.0-nightly (9c8ebe4b3 2026-04-14) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [symbol_name] computing the symbol for `something::<ValTree(Leaf(0x3ff0000000000000): f64)>`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: aborting due to 1 previous error
------------------------------------------

---- [ui] tests/ui/const-generics/adt_const_params/const_param_ty_unchecked.rs stdout end ----

@rust-bors rust-bors bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 15, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 15, 2026

💔 Test for 9c8ebe4 failed: CI. Failed job:

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 15, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 15, 2026

PR #153536, which is a member of this rollup, was unapproved.

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) rollup A PR which is a rollup 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.