Rustc pull update#2943
Merged
Merged
Conversation
rustdoc: Only inline impls for local primitives Previously, the code inlined impls for primitives even if primitives were not defined in the current crate at all. Since most crates do not define `#[doc(primitive)]`s, this is a bunch of wasted work that is done in every crate. Really, rustdoc should have a more pull-based model for inlining impls rather than trying to predict ahead of item what needs to be collected. This also includes a couple of small perf-related followups to rust-lang/rust#159623.
Reorganize `tests/ui/issues` [26/N] Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues) r? Kivooeo @Teapot4195
Update comments and add tests for `-Zrandomize-layout` for some guaranteed ZSTs See rust-lang/reference#2262 . T-lang wants to make some additional guarantees about zero-sized `repr(Rust)` structs and enums, that changes to `-Zrandomize-layout` could theoretically break in the future. This PR adds comments to `-Zrandomize-layout`'s implementation and tests to `tests/ui/layout/randomize.rs` to prevent breaking those guarantees. First commit is the guarantees that T-lang already FCP'd in rust-lang/reference#2262 . Second commit is an additional guarantee (that zero-variant repr(Rust) enums are ZSTs) that's at rust-lang/reference#2293 (FCP now completed)
Reorganize `tests/ui/issues` [22/N] Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues) r? Kivooeo @Teapot4195
Reorganize `tests/ui/issues` [23/N] Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues) r? Kivooeo @Teapot4195
doc: document wasm import symbol mangling Document that foreign items from wasm_import_module extern blocks are mangled even with #[no_mangle] or #[link_name], so same-named imports from different WebAssembly modules remain distinct.
Reorganize `tests/ui/issues` [28/N] Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues) r? Kivooeo @Teapot4195
early_otherwise: Don't hoist dereferences when the otherwise branch is reachable Fixes rust-lang/rust#159591. A place may contain a dereference that cannot be safely hoisted when the otherwise branch is reachable.
Reorganize `tests/ui/issues` [29/N] Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues) r? Kivooeo @Teapot4195
run `tests/assembly-llvm/asm/aarch64-types.rs` for `aarch64_be` We may as well, tangentially related to rust-lang/rust#154342. r? davidtwco
rustc-dev-guide subtree update Subtree update of `rustc-dev-guide` to a6e0ea1. Created using https://github.com/rust-lang/josh-sync. r? @ghost
…n-typeck, r=lcnr Remove outdated comment for resolve_vars_with_obligations from [#t-types/trait-system-refactor > incorrect `resolve_vars_with_obligations` fixme ](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/incorrect.20.60resolve_vars_with_obligations.60.20fixme/with/612312074) r? @lcnr
use `minicore::simd::Simd` more follow-up to rust-lang/rust#159656. I've used `grep -rlZ "repr_simd" . | xargs -0 grep -l "use minicore"` to find all test files that used both `repr_simd` and `use minicore`, they now all use `minicore::simd` to `repr_simd` is no longer needed for them.
Remove outdated workaround for `P` type P is long gone, so this workaround is no longer necessary. The workaround took attrs out of node, inspected and possibly modified it and then put it back at the end of each branch of the following match.
use lowest edition the test accepts
Avoid ICEing in RPIT method chain suggestion In the case that the return type captures a lifetime, `skip_binder()` will cause the later `can_eq()` call to ICE, so we call `enter_forall()` with the binder instead. Probably best reviewed with ignore-whitespace. fixes rust-lang/rust#159685
Rollup of 20 pull requests Successful merges: - rust-lang/rust#150161 (Remove 'static requirement on try_as_dyn) - rust-lang/rust#159412 (Reorganize `tests/ui/issues` [26/N]) - rust-lang/rust#159466 (cmse: clear variant-dependent padding in `enum`s) - rust-lang/rust#157905 (Update comments and add tests for `-Zrandomize-layout` for some guaranteed ZSTs) - rust-lang/rust#158479 (Reject static item as direct const generic arg) - rust-lang/rust#159041 (Reorganize `tests/ui/issues` [22/N]) - rust-lang/rust#159108 (Reorganize `tests/ui/issues` [23/N]) - rust-lang/rust#159138 (doc: document wasm import symbol mangling) - rust-lang/rust#159531 (Reorganize `tests/ui/issues` [28/N]) - rust-lang/rust#159608 (early_otherwise: Don't hoist dereferences when the otherwise branch is reachable) - rust-lang/rust#159612 (Reorganize `tests/ui/issues` [29/N]) - rust-lang/rust#159653 (run `tests/assembly-llvm/asm/aarch64-types.rs` for `aarch64_be`) - rust-lang/rust#159719 (tests: add UI test for `.swap()` suggestion) - rust-lang/rust#159737 (rustfmt fix: allow file not found errors for external mods annotated with `#[my_macro]`) - rust-lang/rust#159759 (rustc-dev-guide subtree update) - rust-lang/rust#159761 (Remove outdated comment for resolve_vars_with_obligations) - rust-lang/rust#159764 (use `minicore::simd::Simd` more) - rust-lang/rust#159773 (Remove outdated workaround for `P` type) - rust-lang/rust#159778 (use lowest edition the test accepts) - rust-lang/rust#159788 (Avoid ICEing in RPIT method chain suggestion)
…Simulacrum Avoid spurious rebuilds of JSON docs in bootstrap Found this while working on rust-lang/rust#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.
…se_bounds, r=BoxyUwU trait solver: account for universes from replace_bound_vars Fixes rust-lang/rust#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.
…imi,jieyouxu rustfmt: Discover modules via `cfg_select!` This PR renames all occurrences of `cfg_match!` in rustfmt to `cfg_select!`. This makes the module file detection logic from rust-lang/rustfmt#6522 kick in for `cfg_select!` instead of `cfg_match!`, which no longer exists. This PR performs no other adjustments to the logic to be as small as possible. I am opening this PR in this repo since that is also the target for the more comprehensive rust-lang/rust#154202, which covers more than merely detecting other files through `cfg_select!`. Closes rust-lang/rust#158371. CC: @ytmimi, @CAD97
… r=JonathanBrouwer Add allowed list check on EII implementations attributes Fixes rust-lang/rust#158293 Fixes rust-lang/rust#159015 r? @bjorn3
…enkov Make `DocLinkResMap` an `FxIndexMap` Previously it was `FxHashMap`, changed to `UnordMap` in rust-lang/rust#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/rust#159677 Discussed on zulip: [#t-compiler/help > #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)
…nkov,mejrs,Urgau [rustdoc] Retrieve `cfg_attr` information for derived impls for `doc_cfg` feature Fixes rust-lang/rust#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/rust#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
std: Implement futex on wasip3 targets, update target spec This commit is in preparation for eventual [tier 2 status] for the `wasm32-wasip3` target. Initially this target will not have support for threads but it's expected to come ~later this year. The first step in supporting this is switching internal `#[cfg]` in the standard library to "ok this target has threads", and this commit is the update for synchronization primitives. All synchronization primitives on the `wasm32-wasip3` now use a `futex`-based implementation, and the implementation of the futex itself is located in wasi-libc (see WebAssembly/wasi-libc#834). Other WASI targets can eventually all use this implementation as well, but `wasi-libc`'s implementation of these symbols will need to percolate, so those targets aren't changed yet. For `wasm32-wasip3`, however, any supporting `wasi-libc` will have these symbols. This then additionally fixes the target to actually build with a modern LLVM by passing a necessary flag to `wasm-ld`. This flag isn't supported until LLVM 23, but the `wasm32-wasip3` target isn't fully supported until LLVM 23 anyway (hence its Tier 3 status currently). [tier 2 status]: rust-lang/compiler-team#1001
…ebank Improve consistency of attribute error messages This PR aims to improve how attributes are referred to in error messages. A lot of test outputs will change, so there will be follow-ups, but this PR has enough changes to cover a lot of cases and give a good feel for where things are headed. r? @estebank
constify `vec![1, 2, 3]` macro Tracking issues: `const_heap`: rust-lang/rust#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).
ci: Enable autodiff tests on x86_64 linux ## Summary Enable autodiff tests on x86_64 linux For now, this is an `optional-*` Merge CI only job, and is not enabled in PR CI. r? @ZuseZ4
Promote riscv64-unknown-linux-musl to tier 2 with host tools MCP: rust-lang/compiler-team#982 Implements rust-lang/rust#156191
…clarfonthey str: add ASCII fast path to word_to_titlecase The word_to_titlecase function had a FIXME comment since a long time asking to add a fast path for ASCII text. Before this change, even simple English text like "hello world" was going through slow Unicode lookup tables. That was unnecessary. This fixes it by using the same trick that to_lowercase already uses — plain English letters are now handled much faster, and only Greek/Chinese/etc still use the Unicode tables. No behavior changes, just faster for normal English text.
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/rust#141973
Rollup of 14 pull requests Successful merges: - rust-lang/rust#159765 (Avoid spurious rebuilds of JSON docs in bootstrap) - rust-lang/rust#159781 (Update bootstrap to use -Zembed-metadata=no instead of -Zno-embed-metadata) - rust-lang/rust#158362 (trait solver: account for universes from replace_bound_vars) - rust-lang/rust#158372 (rustfmt: Discover modules via `cfg_select!`) - rust-lang/rust#159173 (Add allowed list check on EII implementations attributes) - rust-lang/rust#159718 (Make `DocLinkResMap` an `FxIndexMap`) - rust-lang/rust#159722 ( [rustdoc] Retrieve `cfg_attr` information for derived impls for `doc_cfg` feature) - rust-lang/rust#159731 (std: Implement futex on wasip3 targets, update target spec) - rust-lang/rust#159755 (Improve consistency of attribute error messages) - rust-lang/rust#155795 (constify `vec![1, 2, 3]` macro) - rust-lang/rust#157776 (ci: Enable autodiff tests on x86_64 linux) - rust-lang/rust#158766 (Promote riscv64-unknown-linux-musl to tier 2 with host tools) - rust-lang/rust#159271 (str: add ASCII fast path to word_to_titlecase) - rust-lang/rust#159667 (Make some parser structured suggestions verbose and tweak their wording)
Use dylib build in distcheck This reduces disk usage, and thus avoids the distcheck job running out of disk space.
This updates the rust-version file to da86f4d0726be475afbbffe40cb2f65741c51ad3.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@da86f4d Filtered ref: af919e8 Upstream diff: rust-lang/rust@390279b...da86f4d This merge was created using https://github.com/rust-lang/josh-sync.
Collaborator
|
Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using |
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.
Latest update from rustc.