about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-09-29Auto merge of #147162 - matthiaskrgr:rollup-4bv1xzb, r=matthiaskrgrbors-112/+296
Rollup of 5 pull requests Successful merges: - rust-lang/rust#146937 (std: implement `hostname`) - rust-lang/rust#147040 (mbe: macro_check: Fix function comments referencing non-existent parameters) - rust-lang/rust#147131 (Use MirPatch in simplify_branches.) - rust-lang/rust#147133 (Remove one loop in `extract_cfg_from_attrs`) - rust-lang/rust#147150 (Emit allocator attributes for allocator shim) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-30explicitly implement `!Send` and `!Sync`cyrgani-31/+12
2025-09-30remove unused `#![feature(stmt_expr_attributes)]`cyrgani-1/+0
2025-09-29remove `reverse_{encode, decode}!`cyrgani-22/+2
2025-09-29Rollup merge of #147150 - nikic:alloc-shim-attributes, r=bjorn3Matthias Krüger-4/+26
Emit allocator attributes for allocator shim This emits the same attributes we place on allocator declarations on the definitions in the allocator shim as well. This complements https://github.com/rust-lang/rust/pull/146766, which added the attribute for `#[global_allocator]` definitions. Emitting the attributes on the definitions ensures that they cannot be lost of the allocator shim participates in LTO. See https://github.com/rust-lang/rust/issues/145995 for context, though that one was about `#[global_allocator]`. I'm not sure whether this can occur with the allocator shim as well or not, but better safe than sorry. I'm not sure whether there is any good way to test this, as the allocator shim is not part of `--emit=llvm-ir`. I've verified this locally by inspecting the bitcode produced by `-C save-temps`. r? ``@bjorn3``
2025-09-29Rollup merge of #147133 - GuillaumeGomez:rm-loop-extract_cfg_from_attrs, ↵Matthias Krüger-11/+5
r=lolbinarycat Remove one loop in `extract_cfg_from_attrs` Follow-up of https://github.com/rust-lang/rust/pull/138907. r? lolbinarycat
2025-09-29Rollup merge of #147131 - cjgillot:patch-branches, r=davidtwcoMatthias Krüger-12/+37
Use MirPatch in simplify_branches. This allows to avoid clearing the CFG cache if we don't perform any change. r? ``@ghost`` for perf
2025-09-29Rollup merge of #147040 - joshtriplett:mbe-fix-comments, r=petrochenkovMatthias Krüger-7/+4
mbe: macro_check: Fix function comments referencing non-existent parameters Several functions had comments referencing a non-existent `valid` parameter. Remove those. The `guar` parameter that handles errors is already documented. In the process, remove another duplicate reference to an already-documented parameter (`binders`).
2025-09-29Rollup merge of #146937 - joboet:gethostname, r=Mark-SimulacrumMatthias Krüger-78/+224
std: implement `hostname` Resolves https://github.com/rust-lang/libs-team/issues/330 Tracking issue: https://github.com/rust-lang/rust/issues/135142 This is based on rust-lang/rust#135141, but I've reimplemented the UNIX version, which now: * uses `sysconf(_SC_HOST_NAME_MAX)` as an initial buffer length * returns `OutOfMemory` if the `Vec` allocation fails * retries the operation if it detects that the name returned by `gethostname` was truncated Additionally, as part of the rebase, I had to move some WinSock abstractions (initialisation and error access) to `sys::pal` so that they can be accessed from `sys::net::hostname`. CC ``@orowith2os`` (and thank you for your work!)
2025-09-29Add regression test for doc cfg applied on public items inside private itemsGuillaume Gomez-0/+16
2025-09-29Move doc cfg propagation pass before items stripping passesGuillaume Gomez-4/+4
2025-09-29flatten conditional blockMarijn Schouten-4/+1
2025-09-29move test per review feedbackOblarg-97/+42
2025-09-29Auto merge of #146376 - durin42:dwo-specify-path, r=davidtwcobors-13/+167
debuginfo: add an unstable flag to write split DWARF to an explicit directory Bazel requires knowledge of outputs from actions at analysis time, including file or directory name. In order to work around the lack of predictable output name for dwo files, we group the dwo files in a subdirectory of --out-dir as a post-processing step before returning control to bazel. Unfortunately some debugging workflows rely on directly opening the dwo file rather than loading the merged dwp file, and our trick of moving the files breaks those users. We can't just hardlink the file or copy it, because with remote build execution we wouldn't end up with the un-moved file copied back to the developer's workstation. As a fix, we add this unstable flag that causes dwo files to be written to a build-system-controllable location, which then lets bazel hoover up the dwo files, but the objects also have the correct path for the dwo files. r? `@davidtwco`
2025-09-29more renameBoxy Uwu-28/+36
2025-09-29Add a dummy codegen backendbjorn3-4/+70
This allows building a rustc capable of running the frontend without any backend present. While this may not seem all that useful, it allows running the frontend of rustc to report errors or running miri to interpret a program without any backend present. This is useful when you are trying to say run miri in the browser as upstream LLVM can't be compiled for wasm yet. Or to run rustc itself in miri like I did a while ago and caught some UB.
2025-09-29Add `overlapping_assoc_constraints` param to `lower_bounds`Jules Bertholet-6/+37
2025-09-29cleanup `try_evaluate_added_goals`lcnr-14/+5
2025-09-29add testslcnr-0/+39
2025-09-29Fn-trait goals, eagerly instantiate binderlcnr-117/+90
to avoid overflow from proving `for<'a> opaque<'a>: Sized`
2025-09-29Make macOS dist build configuration match where reasonableJake Goulding-5/+9
2025-09-29Auto merge of #147151 - Zalathar:rollup-w81rn0j, r=Zalatharbors-53/+71
Rollup of 5 pull requests Successful merges: - rust-lang/rust#146653 (improve diagnostics for empty attributes) - rust-lang/rust#146987 (impl Ord for params and use unstable sort) - rust-lang/rust#147101 (Use `Iterator::eq` and (dogfood) `eq_by` in compiler and library ) - rust-lang/rust#147123 (Fix removed version numbers of `doc_auto_cfg` and `doc_cfg_hide`) - rust-lang/rust#147149 (add joboet to library review rotation) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-29Improve code commentsGuillaume Gomez-5/+3
2025-09-29Rollup merge of #147149 - joboet:rerotating-joboet, r=joboetStuart Cook-0/+1
add joboet to library review rotation Reviewing feels like fun again...
2025-09-29Rollup merge of #147123 - DJMcNab:doc_cfg_merge_version, r=fmeaseStuart Cook-2/+2
Fix removed version numbers of `doc_auto_cfg` and `doc_cfg_hide` Tracking issue: https://github.com/rust-lang/rust/issues/43781 The `doc_auto_cfg` and `doc_cfg_hide` features were removed in a recent nightly (by https://github.com/rust-lang/rust/pull/138907). I believe that the rustc version numbers at which the features were declared to be removed were incorrect, however, and should both be "1.92" (±1). As evidence in favour of this, the error we get from using this was: ```text error[E0557]: feature has been removed --> src/lib.rs:22:29 | 22 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] | ^^^^^^^^^^^^ feature has been removed | = note: removed in 1.58.0; see <https://github.com/rust-lang/rust/pull/138907> for more information = note: merged into `doc_cfg` ``` Note especially the "removed in 1.58" claim. Further evidence is found in the comment further up this file: https://github.com/rust-lang/rust/blob/4ffeda10e10d4fa0c8edbd0dd9642d8ae7d3e66e/compiler/rustc_feature/src/removed.rs#L49-L53 I've chosen 1.92 as that was the milestone which https://github.com/rust-lang/rust/pull/138907 was added to. cc `@GuillaumeGomez`
2025-09-29Rollup merge of #147101 - yotamofek:pr/iter-eq-and-eq-by, r=jdonszelmannStuart Cook-33/+20
Use `Iterator::eq` and (dogfood) `eq_by` in compiler and library Now that rust-lang/rust#137122 has landed, we can replace stuff that looks like: ```rust let a: &[T]; let b: &[T]; let eq = a.len() == b.len() && a.iter().zip(b).all(|(a,b)| a == b) ``` with the much simpler `a.iter().eq(b)`, without losing the perf benefit of the different-length-fast-path. Also dogfooded `Iterator::eq_by` (cc rust-lang/rust#64295 ) while I'm at it. First commit (4d1b6fad230f8a5ccceccc7562eadc4ea50059da) should be very straightforward to review, second one (049a4606cb3906787aedf508ee8eea09c2bb3b9a) is slightly more creative, but IMHO a nice cleanup.
2025-09-29Rollup merge of #146987 - hkBst:sort-params-1, r=nnethercoteStuart Cook-2/+2
impl Ord for params and use unstable sort AFAICT we are only sorting to find duplicates, so unstable sort should work fine, and maybe is a tiny bit faster?
2025-09-29Rollup merge of #146653 - jdonszelmann:empty-attr-diags, r=nnethercoteStuart Cook-16/+46
improve diagnostics for empty attributes Adds a note about them not having any effect. This was previously done for `feature` attributes but no other attributes. In [converting the `feature` parser](https://github.com/rust-lang/rust/pull/146652) I removed that note. This PR adds it back in and makes it so all attributes benefit from it. Not blocked on rust-lang/rust#146652, either can merge first
2025-09-29Emit allocator attributes for allocator shimNikita Popov-4/+26
This emits the same attributes we place on allocator declarations (and allocator definitions using `#[global_allocator]`) on the definitions in the allocator shim as well, making sure that the attributes are not lost if the allocator shim participates in LTO.
2025-09-29add joboet to library review rotationjoboet-0/+1
2025-09-29Fix removed version of `doc_auto_cfg`, `doc_cfg_hide`Daniel McNab-2/+2
2025-09-29Auto merge of #147145 - Zalathar:rollup-s7kcs3w, r=Zalatharbors-193/+184
Rollup of 3 pull requests Successful merges: - rust-lang/rust#147100 (tests: Remove ignore-android directive for fixed issue) - rust-lang/rust#147116 (compiler: remove AbiAlign inside TargetDataLayout) - rust-lang/rust#147134 (remove explicit deref of AbiAlign for most methods) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-29Merge pull request #20760 from A4-Tacks/all-any-not-attr-compShoyu Vanilla (Flint)-6/+56
Add `all` `any` and `not` attribute completions
2025-09-29std: implement `hostname`joboet-1/+140
2025-09-29Rollup merge of #147134 - workingjubilee:remove-explicit-abialign-deref, ↵Stuart Cook-68/+66
r=Zalathar remove explicit deref of AbiAlign for most methods Much of the compiler calls functions on Align projected from AbiAlign. AbiAlign impls Deref to its inner Align, so we can simplify these away. Also, it will minimize disruption when AbiAlign is removed. For now, preserve usages that might resolve to PartialOrd or PartialEq, as those have odd inference.
2025-09-29Rollup merge of #147116 - workingjubilee:remove-tdl-abialign, r=ZalatharStuart Cook-120/+115
compiler: remove AbiAlign inside TargetDataLayout AbiAlign is a thin wrapper around Align, extant mostly because we used to track a separate quasi-notion of alignment that was never a real notion of alignment and removing all of it at once was too churny. This PR maintains AbiAlign usage in public API and most of the compiler, but direct access of these fields for TargetDataLayout is now in terms of Align only.
2025-09-29Rollup merge of #147100 - Enselic:ignore-less, r=jieyouxuStuart Cook-5/+3
tests: Remove ignore-android directive for fixed issue rust-lang/rust#120567 is marked as fixed, so let's see if we can remove the ignore directives tied to that issue. <!-- Note to self: wait for https://github.com/rust-lang/team/pull/2002 --> try-job: arm-android
2025-09-29Auto merge of #147140 - Zalathar:rollup-rtnqek7, r=Zalatharbors-311/+359
Rollup of 7 pull requests Successful merges: - rust-lang/rust#133477 (Detect tuple structs that are unconstructable due to re-export) - rust-lang/rust#146929 (compiletest: Remove old-output-capture and become a stage0 bootstrap tool) - rust-lang/rust#146979 (constify Default on Nanoseconds) - rust-lang/rust#147092 (Do not compute optimized MIR if code does not type-check.) - rust-lang/rust#147112 (all 48 keywords in just 300 characters) - rust-lang/rust#147122 (Fix some crash-test directives) - rust-lang/rust#147127 (Add a leading dash to linker plugin arguments in the gcc codegen) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-29Use `Iterator::eq` and (dogfood) `eq_by` in compiler and libraryYotam Ofek-33/+20
2025-09-29Merge pull request #20761 from rust-lang/rustc-pullLaurențiu Nicola-4306/+9693
Rustc pull update
2025-09-29Merge ref 'f957826bff7a' from rust-lang/rustThe rustc-josh-sync Cronjob Bot-4305/+9692
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: f957826bff7a68b267ce75b1ea56352aed0cca0a Filtered ref: 7291893f9d875b6e8775a7a0e661abdaec15d3c1 Upstream diff: https://github.com/rust-lang/rust/compare/caccb4d0368bd918ef6668af8e13834d07040417...f957826bff7a68b267ce75b1ea56352aed0cca0a This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-29Prepare for merging from rust-lang/rustThe rustc-josh-sync Cronjob Bot-1/+1
This updates the rust-version file to f957826bff7a68b267ce75b1ea56352aed0cca0a.
2025-09-29Make replacement suggestion `_` in type verboseEsteban Küber-150/+258
``` error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/in-signature.rs:6:21 | LL | fn arr_fn() -> [u8; _] { | ^ not allowed in type signatures | help: replace with the correct return type | LL - fn arr_fn() -> [u8; _] { LL + fn arr_fn() -> [u8; 3] { | ```
2025-09-29Rollup merge of #147127 - antoyo:fix/gcc-linker-plugin, r=bjorn3Stuart Cook-4/+51
Add a leading dash to linker plugin arguments in the gcc codegen Fix rust-lang/rust#130583 r? ``@bjorn3``
2025-09-29Rollup merge of #147122 - Zalathar:crash-directives, r=cjgillotStuart Cook-3/+3
Fix some crash-test directives - 120175 fails to crash for non-ELF targets; presumably this wasn't noticed because the CI jobs don't enable rustc assertions for non-ELF hosts. - 34127, 125722, and 131292 have `only-x86_64`, which is overly specific. - Unnecessary x86 directives cause friction for contributors using aarch64, especially now that many PR CI jobs also use aarch64. r? ghost
2025-09-29Rollup merge of #147112 - nik-contrib:keyword-soup, r=jieyouxuStuart Cook-0/+30
all 48 keywords in just 300 characters new test case in, all 48 keywords in just 300 characters https://doc.rust-lang.org/reference/keywords.html
2025-09-29Rollup merge of #147092 - cjgillot:late-validate-mir, r=compiler-errorsStuart Cook-116/+14
Do not compute optimized MIR if code does not type-check. Since https://github.com/rust-lang/rust/pull/128612, we compute optimized MIR when `-Zvalidate-mir` is present. This is done as part of required analyses, even if type-checking fails. This causes ICEs, as most of the mir-opt pipeline expects well-formed code. Fixes rust-lang/rust#129095 Fixes rust-lang/rust#134174 Fixes rust-lang/rust#134654 Fixes rust-lang/rust#135570 Fixes rust-lang/rust#136381 Fixes rust-lang/rust#137468 Fixes rust-lang/rust#144491 Fixes rust-lang/rust#147011 This does not fix issue rust-lang/rust#137190, as it ICEs without `-Zvalidate-mir`. r? ``@compiler-errors``
2025-09-29Rollup merge of #146979 - npmccallum:nanosecs, r=Mark-SimulacrumStuart Cook-1/+2
constify Default on Nanoseconds
2025-09-29Rollup merge of #146929 - Zalathar:capture, r=Kobzol,jieyouxuStuart Cook-154/+78
compiletest: Remove old-output-capture and become a stage0 bootstrap tool The new compiletest output-capture system became the default in rust-lang/rust#146574, and no problems have been reported since. This PR therefore removes the old output-capture implementation from compiletest, and adjusts bootstrap to always build and test compiletest as a stage0 bootstrap tool. In other words, compiletest no longer relies on any unstable features (such as `libtest` or `internal_output_capture`), and is now written entirely in stable Rust! The compiletest self-tests still need access to an in-tree rustc, in order to obtain information via `rustc --print`, so we interpret `--stage` as indicating the stage of that secondary compiler, but always use the stage0 compiler to build compiletest itself. r? Kobzol
2025-09-29Rollup merge of #133477 - estebank:issue-133343, r=davidtwcoStuart Cook-33/+181
Detect tuple structs that are unconstructable due to re-export When a tuple-struct is re-exported that has inaccessible fields at the `use` scope, the type's constructor cannot be accessed through that re-export. We now account for this case and extend the resulting resolution error. We also check if the constructor would be accessible directly, not through the re-export, and if so, we suggest using the full path instead. ``` error[E0423]: cannot initialize a tuple struct which contains private fields --> $DIR/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:12:33 | LL | let crate::Foo(x) = crate::Foo(42); | ^^^^^^^^^^ | note: the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields --> $DIR/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:3:9 | LL | pub use my_mod::Foo; | ^^^^^^^^^^^ help: the type can be constructed directly, because its fields are available from the current scope | LL | let crate::Foo(x) = crate::my_mod::Foo(42); | ~~~~~~~~~~~~~~~~~~ ``` Fix #133343.