Rollup of 11 pull requests#159803
Closed
jhpratt wants to merge 32 commits into
Closed
Conversation
Replace most of the `.span_suggestion(` in `rustc_parse` with `.span_suggestion_verbose(`, as they are more readabale, if more verbose. Verbose suggestions also tend to highlight off-by-one `Span` errors better.
Currently, module summaries are only emitted with thin lto. If we would link full/fat lto'd rust code against lto'd c++ code built with CFI (or WPD), those passes would fail during the link step because the participating rust modules are missing module summaries. Rust code does not know at compile-time if it would be participating in some special link which may require module summaries, so this PR ensures module summaries are unconditionally emitted for full/fat lto, just like with thin lto. The WriteBitcodeToFile function just invokes the normal BitcodeWriterPass under the hood, but doesn't provide a way to set the argument for emitting module summaries. So this patch just adds the pass directly and sets that argument. Finally, now that we're generating module summaries for `-Clto=fat` without using ThinLTO, we need to update `rustc-metadata` to keep around a temporary directory that contains the `.rmeta` for a little longer before we deserialize it.
… `automatically_derived` attribute
also add regression test for rmeta reproducibility when unrelated `rlib` are in the search path Co-authored-by: mejrs <59372212+mejrs@users.noreply.github.com>
also add a test for cross-crate static initializers
Broaden `is_macos_ld` to `is_macos_linker` by matching `Darwin(..)` instead of `Darwin(_, Lld::No)`, so the linker output filtering also runs when lld is used. Add lld-specific version mismatch pattern to `deployment_mismatch` closure, routing these warnings to `linker_info` (default Allow) instead of `linker_messages` (default Warn). Add a real-lld sub-test to `macos-deployment-target-warning` that exercises the `ld64.lld` path via `-fuse-ld=`, verifying lld warnings are normalized and routed to `linker_info`. Signed-off-by: Ian Miller <milleryan2003@gmail.com>
…adata The recent Cargo submodule update picked up <rust-lang/cargo#17149> However, bootstrap was still using the old name, resulting in: ``` Building stage1 library artifacts (stage1 -> stage1, arm64ec-pc-windows-msvc) error: unknown `-Z` flag specified: no-embed-metadata ``` Fix is to switch to the rename. I also removed the diff in the Cranelift setup script, since they must have already hit this issue and no longer need the workaround.
…, r=Mark-Simulacrum Avoid spurious rebuilds of JSON docs in bootstrap Found this while working on rust-lang#159671. Before, repeated runs of e.g. `x dist rust-docs-json` always rebuilt the docs. It was caused by Cargo not knowing that the output should be JSON, so it was trying to find the HTML files. Instead of passing the output format through `RUSTDOCFLAGS`, which Cargo doesn't inspect, we now pass it to Cargo directly, which fixes the issue.
Update bootstrap to use -Zembed-metadata=no instead of -Zno-embed-metadata The recent Cargo submodule update picked up <rust-lang/cargo#17149> However, bootstrap was still using the old name, resulting in: ``` Building stage1 library artifacts (stage1 -> stage1, arm64ec-pc-windows-msvc) error: unknown `-Z` flag specified: no-embed-metadata ``` Fix is to switch to the rename. I also removed the diff in the Cranelift setup script, since they must have already hit this issue and no longer need the workaround.
…er_universe_bounds, r=BoxyUwU trait solver: account for universes from replace_bound_vars Fixes rust-lang#157840. The ICE was not really because eager placeholder handling looked at too many universes. Boxy was right: with `-Zassumptions-on-binders`, if the new solver creates a placeholder universe, that universe needs an assumptions entry. The bad path is `FindParamInClause` entering a binder through `replace_bound_vars`. `BoundVarReplacer` materializes a placeholder universe for the escaping bound vars, but nothing records placeholder assumptions for it. Later eager placeholder handling walks all non-input universes, which imo is the right behavior, and `get_placeholder_assumptions` hits the missing entry. This moves the empty-assumptions bookkeeping into `EvalCtxt::replace_bound_vars` instead of keeping it local to `FindParamInClause`. The helper snapshots the universe slots before replacement and inserts `Assumptions::empty()` for any slot that got filled. There is still a FIXME there because idk that empty assumptions is the final shape irl. `replace_bound_vars` does not have the param-env context to compute proper assumptions. But for this PR, imo this is the least weird local fix: it keeps the eager pass looking at all non-input universes and fixes the missing bookkeeping where the universe is created. The repro is covered by a UI test. It reports the overflow diagnostic instead of ICEing.
…iper rustc_llvm: Emit module summaries when using -Clto=fat Currently, module summaries are only emitted with thin lto. If we would link full/fat lto'd rust code against lto'd c++ code built with CFI (or WPD), those passes would fail during the link step because the participating rust modules are missing module summaries. Rust code does not know at compile-time if it would be participating in some special link which may require module summaries, so this PR ensures module summaries are unconditionally emitted for full/fat lto, just like with thin lto. The WriteBitcodeToFile function just invokes the normal BitcodeWriterPass under the hood, but doesn't provide a way to set the argument for emitting module summaries. So this patch just adds the pass directly and sets that argument. This is a rebase of @PiJoules's rust-lang#158099, which also should fix up the tests with the gcc tools.
…ngle-eii, r=JonathanBrouwer Add allowed list check on EII implementations attributes Fixes rust-lang#158293 Fixes rust-lang#159015 r? @bjorn3
…r=petrochenkov Make `DocLinkResMap` an `FxIndexMap` Previously it was `FxHashMap`, changed to `UnordMap` in rust-lang#119093. The rationale then was to make the iteration order unobservable, but it turned out to be leaky. This change means the encoder outputs `doc_link_resolutions` entries in insertion order, and iteration order of the `DocLinkResMap` is now observable. I believe this doesn't affect correctness elsewhere, but I'm not very familiar with the codebase so I may be missing something * Closes rust-lang#159677 Discussed on zulip: [#t-compiler/help > rust-lang#159677: rmeta encoding is not stable](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.23159677.3A.20rmeta.20encoding.20is.20not.20stable/with/612134270)
…=petrochenkov,mejrs,Urgau [rustdoc] Retrieve `cfg_attr` information for derived impls for `doc_cfg` feature Fixes rust-lang#103300. After long last, this PR finally allows the derive proc-macro `cfg_attr` cfg predicates information to be kept so rustdoc can use it for its `doc_cfg` feature (cc rust-lang#43781). It works as follows: for `impl` generated by macro expansion, we then look for the attributes on the type for which the `impl` block is implemented. Then, to know which `cfg_attr` attribute we want to look at, we use `expn_that_defined` on the impl's `DefId` which returns the `Span` where the macro was expanded. If it's part of a `cfg_attr`, then the `cfg_attr`'s `Span` will contain the derive's, so from then, we just need to add the `cfg` information. This PR also adds the cfg predicates into the `AttributeKind::CfgAttrTrace` variant so it can be reused by rustdoc (hence the `compiler/*` changes). Thanks a lot @petrochenkov for the pointers here! r? @petrochenkov
…ls, r=bjorn3 reuse regular exported_non_generic_symbols logic in Miri This is some gnarly code we have duplicated in Miri, let's try to reuse the version from rustc. r? @bjorn3
…li-obk constify `vec![1, 2, 3]` macro Tracking issues: `const_heap`: rust-lang#79597 makes all the parts needed for non-empty `vec![]` macros const: `alloc::boxed::box_assume_init_into_vec_unsafe` `alloc::boxed::Box::assume_init` `alloc::boxed::Box::into_raw_with_allocator` `alloc::boxed::Box::new_uninit` `alloc::slice::[T]::into_vec` Note that this does not allow for the use of the `vec![(); 4]` arm of this macro to be used in const-eval, since that uses specialization (spec and const traits don't really like each other so I didn't want to touch any of that in this).
…, r=TaKO8Ki Make some parser structured suggestions verbose and tweak their wording Replace most of the `.span_suggestion(` in `rustc_parse` with `.span_suggestion_verbose(`, as they are more readabale, if more verbose. Verbose suggestions also tend to highlight off-by-one `Span` errors better. Tweak some of the touched diagnostics to bring them more in-line with our house style. CC rust-lang#141973
Member
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 23, 2026
Rollup of 11 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-*
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
PR #159029, which is a member of this rollup, was unapproved. This rollup was thus unapproved. |
Contributor
|
💔 Test for 39857a5 failed: CI. Failed jobs:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
DocLinkResMapanFxIndexMap#159718 (MakeDocLinkResMapanFxIndexMap)cfg_attrinformation for derived impls fordoc_cfgfeature #159722 ( [rustdoc] Retrievecfg_attrinformation for derived impls fordoc_cfgfeature)vec![1, 2, 3]macro #155795 (constifyvec![1, 2, 3]macro)r? @ghost
Create a similar rollup