Commit Graph

55764 Commits

Author SHA1 Message Date
bors 8da2d28cbd Auto merge of #142531 - ohadravid:better-storage-calls-copy-prop, r=tmiasko,cjgillot,saethlin
Remove fewer Storage calls in CopyProp and GVN



Modify the CopyProp and GVN MIR optimization passes to remove fewer `Storage{Live,Dead}` calls, allowing for better optimizations by LLVM - see rust-lang/rust#141649.

### Details

The idea is to use a new `MaybeUninitializedLocals` analysis and remove only the storage calls of locals that are maybe-uninit when accessed in a new location.
2026-04-18 09:16:07 +00:00
Jacob Pratt e3676b5ab9 Rollup merge of #155428 - lapla-cogito:issue_139089, r=mejrs
Fix ICE in borrowck mutability suggestion with multi-byte ref sigil

Fixes rust-lang/rust#139089

Similarly to rust-lang/rust#155068, this is another instance where span arithmetic did not account for multi-byte characters. (Note that the ampersand in the test is full-width)

This change also results in correcting some inappropriate suggestions.
2026-04-18 00:05:19 -04:00
Jacob Pratt eb52efbbd2 Rollup merge of #155295 - lapla-cogito:issue_154350, r=JohnTitor
Fix misleading "borrowed data escapes outside of function" diagnostic

Fixes rust-lang/rust#154350

Fall back to `report_general_error()` when `fr_name_and_span` is `None` in function items, since the "escaping data" framing is only appropriate for closures capturing outside variables.
2026-04-18 00:05:18 -04:00
Jacob Pratt eb185531e1 Rollup merge of #154943 - Zalathar:for-each-subpat, r=Nadrieril
Move recursion out of `MatchPairTree::for_pattern` helpers

The helper functions now just iterate over the relevant subpatterns, while leaving recursion up to the main function.

This avoids passing parameters that were only used for recursive plumbing, and consolidates all recursive calls into `for_pattern` itself, which should make it easier to experiment with changes to the recursive structure.

There should be no change to compiler behaviour.
2026-04-18 00:05:17 -04:00
Jacob Pratt baf4388b8f Rollup merge of #147811 - folkertdev:naked-function-sections, r=Amanieu
naked functions: respect `function-sections`

fixes https://github.com/rust-lang/rust/issues/147789

r? @Amanieu
2026-04-18 00:05:15 -04:00
lapla a779e054a9 Fix ICE in borrowck mutability suggestion with multi-byte ref sigil 2026-04-18 08:52:11 +09:00
bors e9e32aca5a Auto merge of #155432 - JonathanBrouwer:rollup-dJVrrO0, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#154781 (Fix attribute order implementation)
 - rust-lang/rust#155242 (resolve: Introduce `(Local,Extern)Module` newtypes for local and external modules respectively)
 - rust-lang/rust#149614 (Use `MaybeDangling` in `std`)
 - rust-lang/rust#153178 (Add `TryFromIntError::kind` method and `IntErrorKind::NotAPowerOfTwo` variant)
 - rust-lang/rust#155049 (Documenting the case of `Weak::upgrade` returning `None` when the value behind the reference is missing)

Failed merges:

 - rust-lang/rust#155308 (Make `OnDuplicate::Error` the default for attributes)
2026-04-17 19:17:17 +00:00
bors f29256dd14 Auto merge of #155248 - JonathanBrouwer:no_hash_delayed_lints, r=GuillaumeGomez
Don't hash `DelayedLints`

This PR unblocks https://github.com/rust-lang/rust/pull/154432, and was also a minor perf win locally
2026-04-17 16:05:32 +00:00
Jonathan Brouwer d14311c4a1 Don't hash DelayedLints 2026-04-17 16:08:45 +02:00
Ohad Ravid 5632001f83 Improve copy_prop and GVN mir-opt passes to remove fewer storage calls 2026-04-17 16:55:43 +03:00
Jonathan Brouwer 89bec2cd37 Rollup merge of #155242 - petrochenkov:modmodmod, r=mu001999
resolve: Introduce `(Local,Extern)Module` newtypes for local and external modules respectively

Right now both `LocalModule` and `ExternModule` refer to the same `ModuleData`, but the module data for local and extern modules can potentially be made quite different, and we can specialize name lookup for both cases as an optimization.

Declaration creation for local and external modules was already specialized as a part of the parallel import resolution work (see `define_local` and `define_extern`, rust-lang/rust#145108 and previous PRs), because they have different properties with regards to ownership and synchronization.
2026-04-17 13:28:56 +02:00
Jonathan Brouwer c142d8013c Rollup merge of #154781 - JonathanBrouwer:fix-attr-order, r=jdonszelmann
Fix attribute order implementation

The implementation in https://github.com/rust-lang/rust/pull/153041 contained a mistake :c
I swapped the place where the error message was on, but did not change any code for which attribute was also selected, which explains the empty crater results.
**Interestingly, the original code is broken too, before https://github.com/rust-lang/rust/pull/153041 it always took the last attribute, regardless of what the `AttributeOrder` actually was...**

Let's first see crater results before making a decision

TODO for this PR: Make better tests for this
2026-04-17 13:28:55 +02:00
bors 4dbafc340b Auto merge of #153955 - aerooneqq:def-path-hash-collision, r=petrochenkov
delegation: fix def path hash collision, add per parent disambiguators



This PR addresses the following delegation issues:
- It fixes rust-lang/rust#153410 when generating new `DefId`s for generic parameters by ~saving `DisambiguatorState`s from resolve stage and using them at AST -> HIR lowering~ introducing per owner disambiguators and transferring them to AST -> HIR lowering stage
- ~Next it fixes the ICE which is connected to using `DUMMY_SP` in delegation code, which was found during previous fix~
- ~Finally, after those fixes the rust-lang/rust#143498 is also fixed, only bugs with propagating synthetic generic params are left.~

Fixes rust-lang/rust#153410. Part of rust-lang/rust#118212.

r? @petrochenkov
2026-04-17 11:13:11 +00:00
Vadim Petrochenkov 61bc404458 resolve: Introduce (Local,Extern)Module newtypes for local and external modules respectively 2026-04-17 13:09:04 +03:00
bors 27dbdb57a2 Auto merge of #155416 - Zalathar:rollup-D1EWnrR, r=Zalathar
Rollup of 19 pull requests

Successful merges:

 - rust-lang/rust#141633 (Suggest to bind `self.x` to `x` when field `x` may be in format string)
 - rust-lang/rust#152980 (c-variadic: fix implementation on `avr`)
 - rust-lang/rust#154491 (Extend `core::char`'s documentation of casing issues (and fix a rustdoc bug))
 - rust-lang/rust#155318 (Use mutable pointers for Unix path buffers)
 - rust-lang/rust#155335 (Bump bootstrap to 1.96 beta)
 - rust-lang/rust#155354 (Remove AttributeSafety from BUILTIN_ATTRIBUTES)
 - rust-lang/rust#154970 (rustdoc: preserve `doc(cfg)` on locally re-exported type aliases)
 - rust-lang/rust#155095 (changed the information provided by (mut x) to mut x (Fix 155030))
 - rust-lang/rust#155305 (Make `convert_while_ascii` unsafe)
 - rust-lang/rust#155358 (ImproperCTypes: Move erasing_region_normalisation into helper function)
 - rust-lang/rust#155377 (tests/debuginfo/basic-stepping.rs: Remove FIXME related to ZSTs)
 - rust-lang/rust#155383 (Rearrange `rustc_ast_pretty`)
 - rust-lang/rust#155384 (triagebot: notify on diagnostic attribute changes)
 - rust-lang/rust#155386 (Use `box_new` diagnostic item for Box::new suggestions)
 - rust-lang/rust#155391 (Small refactor of `QueryJob::latch` method)
 - rust-lang/rust#155395 (Tweak how the "copy path" rustdoc button works to allow some accessibility tool to work with rustdoc)
 - rust-lang/rust#155396 (`as_ref_unchecked` docs link fix)
 - rust-lang/rust#155411 (compiletest: Remove the `//@ should-ice` directive)
 - rust-lang/rust#155413 (fix: typo in `std::fs::hard_link` documentation)
2026-04-17 07:35:43 +00:00
aerooneqq 699eb29443 Fix delegation def path hash collision, add per-parent disambiguators 2026-04-17 09:46:54 +03:00
Stuart Cook 7e43cdf977 Rollup merge of #155391 - zetanumbers:query_latch_oneliner, r=petrochenkov
Small refactor of `QueryJob::latch` method

We can use `Option::get_or_insert_with` to avoid unwrapping there.
2026-04-17 16:17:59 +10:00
Stuart Cook b9d3efa317 Rollup merge of #155386 - cijiugechu:fix-box-new-diagnostic-item, r=Kivooeo
Use `box_new` diagnostic item for Box::new suggestions

When look this part of code, I noticed this FIXME and fixed it :)
2026-04-17 16:17:58 +10:00
Stuart Cook f9c4e61ac0 Rollup merge of #155383 - nnethercote:rearrange-rustc_ast_pretty, r=WaffleLapkin
Rearrange `rustc_ast_pretty`

`rustc_ast_pretty` has two modules, `pp::convenience` and `helpers`, that are small and silly. This PR eliminates them. Details in the individual commits.

r? @WaffleLapkin
2026-04-17 16:17:57 +10:00
Stuart Cook e59e8f0412 Rollup merge of #155358 - niacdoial:improperctypes-refactor2.1, r=petrochenkov
ImproperCTypes: Move erasing_region_normalisation into helper function

This is "part 1/3 of 2/3 of 1/2" of the original pull request https://github.com/rust-lang/rust/pull/134697 (refactor plus overhaul of the ImproperCTypes family of lints)
(all pulls of this series of pulls are supersets of the previous pulls. If this pull is "too small" to be worth the effort, you can instead look at the next in the series)

This pull is a small internal change among the efforts to refactor the ImproperCTypes lints, by moving some "unwrapping" code (`cx.tcx.try_normalize_erasing_regions`) into a helper function.

r? petrochenkov
2026-04-17 16:17:55 +10:00
Stuart Cook 350e0d7fad Rollup merge of #155095 - lms0806:issue_155030, r=nnethercote
changed the information provided by (mut x) to mut x (Fix 155030)

When trying to change a value without using mut in a for loop, the recommendation for this change is incorrect, so I am correcting it.

resolve: rust-lang/rust#155030
2026-04-17 16:17:54 +10:00
Stuart Cook d4b573d95c Rollup merge of #155354 - JonathanBrouwer:attr-safety-port-2, r=mejrs
Remove AttributeSafety from BUILTIN_ATTRIBUTES

Encodes the expected attribute safety in the attribute parsers, rather than in `BUILTIN_ATTRIBUTES`, with the goal of removing `BUILTIN_ATTRIBUTES` soon.
We can remove the old attribute safety logic already because unparsed attributes, just like the as of yet unparsed lint attributes, need to be safe.

r? @jdonszelmann  (or @mejrs if you feel like doing it, since you are in T-compiler now 🎉)
2026-04-17 16:17:53 +10:00
Stuart Cook 6951f83914 Rollup merge of #155335 - Mark-Simulacrum:bootstrap-bump, r=jieyouxu
Bump bootstrap to 1.96 beta

See https://forge.rust-lang.org/release/process.html#default-branch-bootstrap-update-tuesday

I think this will wind up needing another PR in a week or so when we pick up assert_matches getting destabilized in beta? But that seems like it can be split into its own PR.
2026-04-17 16:17:52 +10:00
Stuart Cook 91a7d1b498 Rollup merge of #152980 - folkertdev:c-variadic-avr, r=tgross35
c-variadic: fix implementation on `avr`

tracking issue: https://github.com/rust-lang/rust/issues/44930
cc target maintainer @Patryk27

I ran into multiple issues, and although with this PR and a little harness I can run the test with qemu on avr, the implementation is perhaps not ideal.

The problem we found is that on `avr` the `c_int/c_uint` types are `i16/u16`, and this was not handled in the c-variadic checks. Luckily there is a field in the target configuration that contains the targets `c_int_width`. However, this field is not actually used in `core` at all, there the 16-bit targets are just hardcoded.

https://github.com/rust-lang/rust/blob/1500f0f47f5fe8ddcd6528f6c6c031b210b4eac5/library/core/src/ffi/primitives.rs#L174-L185

Perhaps we should expose this like endianness and pointer width?

---

Finally there are some changes to the test to make it compile with `no_std`.
2026-04-17 16:17:50 +10:00
Stuart Cook 1ff95e018f Rollup merge of #141633 - xizheyin:issue-141350, r=nnethercote
Suggest to bind `self.x` to `x` when field `x` may be in format string

Fixes rust-lang/rust#141350

I added the new test in the first commit, and committed the changes in the second one.

r? @fmease
cc @mejrs
2026-04-17 16:17:49 +10:00
bors 1b8f2e46e1 Auto merge of #155207 - quiode:writable, r=RalfJung
add llvm writable attribute conditionally




This PR tries to address https://github.com/rust-lang/unsafe-code-guidelines/issues/584#issue-3440604811. It is part of a bachelor thesis supervised by @JoJoDeveloping and @RalfJung, for more information, see: [Project_Description.pdf](https://github.com/user-attachments/files/26537277/Project_Description.pdf).
If the new `-Zllvm-writable` flag is set, the [llvm writable attribute](https://llvm.org/docs/LangRef.html#writable) is inserted for all mutable borrows. This can be conditionally turned off on a per-function basis using the `#[rustc_no_writable]` attribute. The new Undefined Behaviour introduced by this can detected by Miri, which is implemented here: https://github.com/rust-lang/miri/pull/4947.

Two library functions already received the `#[rustc_no_writable]` attribute, as they are known to cause problems under the Tree Borrows aliasing model with implicit writes enabled.
2026-04-17 04:13:36 +00:00
Mark Rousskov a64c420c70 Bump stage0 to 1.96 beta 2026-04-16 19:30:56 -04:00
bors 7af3402cda Auto merge of #155380 - jhpratt:rollup-j1e7DVL, r=jhpratt
Rollup of 18 pull requests

Successful merges:

 - rust-lang/rust#154451 (Require that a `<_ as Try>::Residual` implement the `Residual` trait)
 - rust-lang/rust#154595 (Emit fatal on invalid const args with nested defs)
 - rust-lang/rust#154599 (report the `varargs_without_pattern` lint in deps)
 - rust-lang/rust#154699 (`core::unicode`: Replace `Cased` table with `Lt`)
 - rust-lang/rust#155353 (resolve: Remove `inaccessible_ctor_reexport` resolver field)
 - rust-lang/rust#155357 (Add `--remap-path-scope` as unstable in rustdoc)
 - rust-lang/rust#150649 (clippy fix: non_canonical_clone_impl)
 - rust-lang/rust#154604 (abort in core)
 - rust-lang/rust#154616 (Add `--quiet` flag to x.py and bootstrap to suppress output)
 - rust-lang/rust#155215 (Clean up `AttributeLintKind` and refactor diagnostic attribute linting)
 - rust-lang/rust#155228 (Check diagnostic output in incremental `cpass` and `rpass` revisions)
 - rust-lang/rust#155266 (Adjust release notes for post-merge feedback)
 - rust-lang/rust#155326 (Disallow ZST allocations with `TypedArena`.)
 - rust-lang/rust#155334 (docs: Use `0b1` instead of `NonZero::MIN` in `NonZero::bit_width` doctests)
 - rust-lang/rust#155340 (Handle nonnull pattern types in size skeleton)
 - rust-lang/rust#155347 (Add push_mut and new Layout methods to release notes)
 - rust-lang/rust#155356 (remove calls to AliasTyKind::def_id)
 - rust-lang/rust#155364 (Reduce diagnostic type visibilities.)
2026-04-16 18:19:58 +00:00
Dominik Schwaiger da2bbfbbec add llvm writable attribute conditionally 2026-04-16 12:29:39 +00:00
Daria Sukhonina d0f5b5caa8 Replace redundant unwrap with get_or_insert_with 2026-04-16 15:19:42 +03:00
bors 18b439f84e Auto merge of #154605 - estebank:attr-suggest, r=jieyouxu
Make `span_suggestions` always verbose



`span_suggestions` is to provide mutually exclusive suggestions. When it was introduced, we made its behavior be that if a single suggestion is given to it, we present the suggestion inline, otherwise in patch format. Changing this to make all of its uses be verbose, as that is closer in intent of output.
2026-04-16 11:23:18 +00:00
cijiugechu 78a465a86d Use box_new diagnostic item for Box::new suggestions 2026-04-16 18:09:36 +08:00
Folkert de Vries a875e140b6 c-variadic: make VaArgSafe a lang item
so that we can check whether a type implements the trait
2026-04-16 11:48:06 +02:00
Folkert de Vries b8ba4002f5 c-variadic: handle c_int being i16 and c_double being f32 on avr 2026-04-16 11:48:02 +02:00
Folkert de Vries 41afd5f8d6 handle uefi and test assembly versus regular functions 2026-04-16 11:37:46 +02:00
Folkert de Vries 7787bd915b fix macho section specifier & windows test 2026-04-16 11:37:46 +02:00
Folkert de Vries bc4aad37ca naked-functions: properly document the -Zfunction-sections windows status 2026-04-16 11:37:45 +02:00
Folkert de Vries 872301bfdd naked functions: respect function_sections on linux/macos 2026-04-16 11:37:45 +02:00
Folkert de Vries 0e522d6c62 naked functions: respect function_sections on windows
For `gnu` function_sections is off by default.
2026-04-16 11:37:45 +02:00
Nicholas Nethercote 9e940e4051 Merge Printer impl blocks.
`rustc_ast_pretty::pp` defines `Printer` and has a 346 line `impl
Printer` block for it. `rustc_ast_pretty::pp::convenience` has another
`impl Printer` block with 85 lines. `rustc_ast_pretty::helpers` has
another `impl Printer` block with 45 lines.

This commit merges the two small `impl Printer` blocks into the bigger
one, because there is no good reason for them to be separate. Doing this
eliminates the `rustc_ast_pretty::pp::convenience` and
`rustc_ast_pretty::helpers` modules; no great loss given that they were
small and had extremely generic names.
2026-04-16 18:22:56 +10:00
Nicholas Nethercote 0529b94578 Move Token impl block.
For no apparent reason it's in a different file to `Token` itself. This
commit moves it.
2026-04-16 18:19:41 +10:00
Jacob Pratt 92f640115a Rollup merge of #155364 - nnethercote:reduce-err-struct-visibilities, r=Kivooeo
Reduce diagnostic type visibilities.

Most diagnostic types are only used within their own crate, and so have a `pub(crate)` visibility. We have some diagnostic types that are unnecessarily `pub`. This is bad because (a) information hiding, and (b) if a `pub(crate)` type becomes unused the compiler will warn but it won't warn for a `pub` type.

This commit eliminates unnecessary `pub` visibilities for some diagnostic types, and also some related things due to knock-on effects. (I found these types with some ad hoc use of `grep`.)

r? @Kivooeo
2026-04-16 01:54:15 -04:00
Jacob Pratt 94d946ea69 Rollup merge of #155356 - WilliamTakeshi:remove_calls_to_def_id, r=WaffleLapkin
remove calls to AliasTyKind::def_id

ref https://github.com/rust-lang/rust/issues/154941

I asked the LSP where `AliasTyKind::def_id` and then checked where the `AliasTyKind::def_id` was trivial to change. Could only find 2 places, and I am not sure about the `opaque_types.rs` (open to feedback!! :) ). All the others need refactoring or will end up with a logic as complex as `AliasTyKind::def_id`

This is the list checked:
- [X] compiler/rustc_borrowck/src/region_infer/opaque_types/member_constraints.rs — 1
- [X] compiler/rustc_borrowck/src/region_infer/opaque_types/mod.rs — 1
- [X] compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs — 5
- [X] compiler/rustc_hir_analysis/src/check/mod.rs — 1
- [X] compiler/rustc_infer/src/infer/outlives/for_liveness.rs — 2
- [X] compiler/rustc_infer/src/infer/outlives/obligations.rs — 1
- [X] compiler/rustc_infer/src/infer/outlives/verify.rs — 3
- [X] compiler/rustc_middle/src/ty/print/pretty.rs — 1
- [X] compiler/rustc_middle/src/ty/sty.rs — 1
- [X] compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs — 3
- [X] compiler/rustc_next_trait_solver/src/solve/effect_goals.rs — 3
- [X] compiler/rustc_pattern_analysis/src/rustc.rs — 1
- [X] compiler/rustc_public/src/unstable/convert/stable/ty.rs — 1
- [X] compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs — 2
- [X] compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs — 4
- [X] compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs — 2
- [X] compiler/rustc_trait_selection/src/traits/effects.rs — 1
- [X] compiler/rustc_trait_selection/src/traits/query/normalize.rs — 1
- [X] compiler/rustc_ty_utils/src/opaque_types.rs — 7
- [X] compiler/rustc_ty_utils/src/ty.rs — 1
- [X] compiler/rustc_type_ir/src/outlives.rs — 1
- [X] compiler/rustc_type_ir/src/predicate.rs — 1
- [X] compiler/rustc_type_ir/src/relate.rs — 5
- [X] compiler/rustc_type_ir/src/ty_kind.rs — 2

r? @WaffleLapkin
2026-04-16 01:54:14 -04:00
Jacob Pratt a5f590a1d6 Rollup merge of #155340 - oli-obk:size-skeleton-pat-tys, r=mati865
Handle nonnull pattern types in size skeleton

The original comment was correct, the size is always the same, but we have more information now. In theory there was an additional bug that would have allowed transmuting things of different sizes, but I don't see how that would have been actually doable as the `tail` types would always have differed.

fixes rust-lang/rust#155330
2026-04-16 01:54:13 -04:00
Jacob Pratt 52d6a1e376 Rollup merge of #155326 - nnethercote:disallow-ZST-TypedArena, r=Nadrieril
Disallow ZST allocations with `TypedArena`.

`DroplessArena::alloc` already disallows ZST allocation. `TypedArena::alloc` allows it but:
- (a) it's never used, and
- (b) writing to `NonNull::dangling()` seems dubious, even if the write is zero-sized.

This commit just changes it to panic on a ZST. This eliminates an untested code path, and we shouldn't be allocating ZSTs anyway. It also eliminates an unused ZST code path in `clear_last_chunk`.

r? @Nadrieril
2026-04-16 01:54:12 -04:00
Jacob Pratt 0d98e0d54f Rollup merge of #155215 - mejrs:condense_diag_lints, r=JonathanBrouwer
Clean up `AttributeLintKind` and refactor diagnostic attribute linting

There was a fair amount of duplication here, and thanks to the proliferation of new diagnostic attributes these days, it was threatening to grow bigger.
2026-04-16 01:54:10 -04:00
Jacob Pratt a25356babb Rollup merge of #155357 - Urgau:rustdoc-remap-path-scope, r=GuillaumeGomez
Add `--remap-path-scope` as unstable in rustdoc

This PR adds support for `rustc` `--remap-path-scope` flag in rustdoc as unstable.

`rustc` documentation for the flag is [here](https://doc.rust-lang.org/nightly/rustc/remap-source-paths.html#--remap-path-scope).

I added some complementary tests for `rustdoc`, no need I think to duplicate `rustc` UI tests.
2026-04-16 01:54:07 -04:00
Jacob Pratt 700f2a7967 Rollup merge of #155353 - petrochenkov:globdedup, r=mu001999
resolve: Remove `inaccessible_ctor_reexport` resolver field

Collect the necessary information during error reporting instead of doing it on a good path from the core name resolution infra.

Also cleanup the related diagnostic code for struct constructors in general, see the individual commits.

This mitigates most of the harm brought by https://github.com/rust-lang/rust/pull/133477.
2026-04-16 01:54:07 -04:00
Jacob Pratt 0238243b5f Rollup merge of #154599 - folkertdev:varargs-without-pattern-in-deps, r=mati865
report the `varargs_without_pattern` lint in deps

tracking issue: https://github.com/rust-lang/rust/issues/44930

After discussion in https://github.com/rust-lang/reference/pull/2177#discussion_r2864885208.

Based on https://github.com/rust-lang/rust/pull/143619#issuecomment-3133157725 there was only one actual impacted crate https://crates.io/crates/binrw. The issue was fixed in https://github.com/jam1garner/binrw/issues/342, and has since been released https://github.com/jam1garner/binrw/issues/342#issuecomment-3994700268.

Hence we may as well report this loudly.

r? @ghost
2026-04-16 01:54:05 -04:00
Jacob Pratt 402748551a Rollup merge of #154595 - mu001999-contrib:fix/154539, r=BoxyUwU
Emit fatal on invalid const args with nested defs

Fixed https://github.com/rust-lang/rust/issues/123629
Fixes https://github.com/rust-lang/rust/issues/154539

Invalid const args are rejected, so their surrounding HIR is not preserved. But nested defs inside them can still get created, leaving children lowered without a valid HIR parent and causing an ICE when later error handling walks HIR parents.

r? @BoxyUwU
2026-04-16 01:54:05 -04:00