about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-09-30test bevy compute_implied_bounds hack with new trait solverJana Dönszelmann-2/+4
2025-09-30Rollup merge of #147167 - jyn514:rustdoc-tests, r=KobzolStuart Cook-9/+3
Don't condition RUSTDOC_LIBDIR on `--no-doc` In d94e7ff065cd393a645eb3e9c96ce0418856e95d, `rustdoc_path` was changed to ignore `want_rustdoc` (which is just whether `--no-doc` was passed). But RUSTDOC_LIBDIR wasn't kept in sync. Rather than trying to keep `rustdoc_path` in sync with `RUSTDOC_LIBDIR`, just pass LIBDIR to the rustc shim unconditionally. This fix allows calling `ensure(doc::Step)` from a non-doc top-level Step, even if `--no-doc` was present in the command line.
2025-09-30Rollup merge of #147109 - BoxyUwU:rename_concrete_opaques, r=lcnrStuart Cook-109/+83
Rename various "concrete opaque type" things to say "hidden type" r? lcnr I've found "concrete opaque type" terminology to be somewhat confusing as in conversation and when explaining opaque type stuff to people I always just talk about things in terms of hidden types. Also the hidden types of opaques are very much not *concrete* in the same sense that a type without any generic parameters is concrete which is an unfortunate overlap in terminology. I've tried to update comments to also stop referring to things as concrete opaque types but this is mostly best effort as it difficult to find all such cases amongst the massive amounts of uses of "concrete" or "hidden" across the whole compiler.
2025-09-30Rollup merge of #146649 - folkertdev:cmse-call-erase-regions, r=lcnrStuart Cook-0/+40
cmse: fix 'region variables should not be hashed' tracking issue: https://github.com/rust-lang/rust/issues/81391 fixes https://github.com/rust-lang/rust/issues/131639 Some background: the `cmse-nonsecure-call` calling convention is used for a call from "secure" to "non-secure" code. To make sure that "non-secure" cannot read any secrets, restrictions are put on the signatures of functions with this calling convention: they can only use 4 arguments for passing arguments, and one register for passing a result. No arguments are passed via the stack, and all other registers are cleared before the call. We check during `hir_ty_lowering` that the signature follows these rules. We do that by determining and then inspecting the layout of the type. That works well overall, but can run into asserts when the type itself is ill-formed. This PR fixes one such case. I believe that the fix here, just erasing the regions, is the right shape, but there may be some nuance that I'm missing. r? types
2025-09-30Rollup merge of #146011 - estebank:lifetime-obligation-span, r=lcnrStuart Cook-32/+258
Point at fn bound that introduced lifetime obligation The last note is new ``` error[E0597]: `c` does not live long enough --> $DIR/without-precise-captures-we-are-powerless.rs:19:20 | LL | fn simple<'a>(x: &'a i32) { | -- lifetime `'a` defined here ... LL | let c = async move || { println!("{}", *x); }; | - binding `c` declared here LL | outlives::<'a>(c()); | ---------------^--- | | | | | borrowed value does not live long enough | argument requires that `c` is borrowed for `'a` LL | outlives::<'a>(call_once(c)); LL | } | - `c` dropped here while still borrowed | note: requirement that `c` is borrowed for `'a` introduced here --> $DIR/without-precise-captures-we-are-powerless.rs:7:33 | LL | fn outlives<'a>(_: impl Sized + 'a) {} | ^^ ``` When encountering a `ConstraintCategory::Predicate` in a funtion call, point at the `Span` for that `Predicate` to explain where the lifetime obligation originates from. CC rust-lang/rust#55307.
2025-09-30Rollup merge of #140916 - moatom:140578, r=chenyukangStuart Cook-11/+115
Fix unuseful span in type error in some format_args!() invocations Fixed https://github.com/rust-lang/rust/issues/140578. r? ``@m-ou-se``
2025-09-30Replace `MetadataType` with the `MetadataKindId` constantsZalathar-49/+17
2025-09-30Declare all "fixed" metadata kinds as `MetadataKindId`Zalathar-0/+116
2025-09-30Move `MetadataKindId` into its own submoduleZalathar-10/+16
2025-09-30add testslcnr-1/+90
2025-09-30Fix unuseful span in type error in some format_args!() invocationsTomoaki Kobayashi-36/+60
2025-09-30fix tuple child creationWalnut-2/+3
2025-09-30Add test for unuseful span in type error in some format_args!() invocationsTomoaki Kobayashi-0/+80
2025-09-30Auto merge of #147143 - estebank:verbose-ret-type, r=fee1-deadbors-150/+258
Make replacement suggestion `_` in type verbose ``` 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-30Merge pull request #20745 from ↵Shoyu Vanilla (Flint)-1/+55
Oblarg/fix-negative-int-literals-in-macro-by-example Fix negative integer literals in const generics in declarative macro context
2025-09-30Pass around `DirectiveLine` instead of bare stringsZalathar-145/+107
2025-09-30Remove `parse_negative_name_directive`Zalathar-16/+2
This isn't actually used for anything, and its presence complicates the migration to `DirectiveLine`.
2025-09-30Split off a separate name/value parser for debuginfo test commandsZalathar-16/+19
2025-09-30Auto merge of #147169 - jhpratt:rollup-65ooei8, r=jhprattbors-167/+249
Rollup of 4 pull requests Successful merges: - rust-lang/rust#145883 (Make macOS dist build configuration match where reasonable) - rust-lang/rust#146457 (Skip cleanups on unsupported targets) - rust-lang/rust#147152 (builtin `Fn`-trait impls: instantiate binder before the return type `Sized` check) - rust-lang/rust#147153 ([rustdoc] Move doc cfg propagation pass before items stripping passes) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-29Rollup merge of #147153 - ↵Jacob Pratt-4/+20
GuillaumeGomez:doc-propagation-before-stripping-items, r=lolbinarycat [rustdoc] Move doc cfg propagation pass before items stripping passes Follow-up of https://github.com/rust-lang/rust/pull/138907. r? lolbinarycat
2025-09-29Rollup merge of #147152 - lcnr:instantiate-pre-sized-check, r=BoxyUwUJacob Pratt-131/+134
builtin `Fn`-trait impls: instantiate binder before the return type `Sized` check fixes - https://github.com/rust-lang/trait-system-refactor-initiative/issues/220 - https://github.com/rust-lang/trait-system-refactor-initiative/issues/204 r? `@BoxyUwU`
2025-09-29Rollup merge of #146457 - alexcrichton:wasm-no-exn-instructions, r=bjorn3Jacob Pratt-27/+86
Skip cleanups on unsupported targets This commit is an update to the `AbortUnwindingCalls` MIR pass in the compiler. Specifically a new boolean is added for "can this target possibly unwind" and if that's `false` then terminators are all adjusted to be unreachable/not present. The end result is that this fixes rust-lang/rust#140293 for wasm targets. The motivation for this PR is that currently on WebAssembly targets the usage of the `C-unwind` ABI can lead LLVM to either (a) emit exception-handling instructions or (b) hit a LLVM-ICE-style codegen error. WebAssembly as a base instruction set does not support unwinding at all, and a later proposal to WebAssembly, the exception-handling proposal, was what enabled this. This means that the current intent of WebAssembly targets is that they maintain the baseline of "don't emit exception-handling instructions unless enabled". The commit here is intended to restore this behavior by skipping these instructions even when `C-unwind` is present. Exception-handling is a relatively tricky and also murky topic in WebAssembly, however. There are two sets of instructions LLVM can emit for WebAssembly exceptions, Rust's Emscripten target supports exceptions, WASI targets do not, the LLVM flags to enable this are not always obvious, and additionally this all touches on "changing exception-handling behavior should be a target-level concern, not a feature". Effectively WebAssembly's exception-handling integration into Rust is not finalized at this time. The best idea at this time is that a parallel set of targets will eventually be added which support exceptions, but it's not clear if/when to do this. In the meantime the goal is to keep existing targets working while still enabling experimentation with exception-handling with `-Zbuild-std` and various permutations of LLVM flags. To that extent this commit does not blanket disable these landing pads and cleanup routines for WebAssembly but instead checks to see if panic=unwind is enabled or if `+exception-handling` is enabled. Tests are updated here as well to account for this where, by default, using a `C-unwind` ABI won't affect Rust codegen at all. If `+exception-handling` is enabled, however, then Rust codegen will look like native platforms where exceptions are caught and the program aborts. More-or-less I've done my best to keep exceptions working on wasm where it's possible to have them work, but turned them off where they're not supposed to be emitted. Closes rust-lang/rust#140293
2025-09-29Rollup merge of #145883 - shepmaster:unify-macos-ci, r=madsmtmJacob Pratt-5/+9
Make macOS dist build configuration match where reasonable r? `@madsmtm`
2025-09-29Don't condition RUSTDOC_LIBDIR on `--no-doc`Jynn Nelson-9/+3
In d94e7ff065cd393a645eb3e9c96ce0418856e95d, `rustdoc_path` was changed to ignore `want_rustdoc` (which is just whether `--no-doc` was passed). But RUSTDOC_LIBDIR wasn't kept in sync. Rather than trying to keep `rustdoc_path` in sync with `RUSTDOC_LIBDIR`, just pass LIBDIR to the rustc shim unconditionally. This fix allows calling `ensure(doc::Step)` from a non-doc top-level Step, even if `--no-doc` was present in the command line.
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.