about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-07-26Rollup merge of #144364 - alexcrichton:update-dlmalloc, r=Mark-SimulacrumTrevor Gross-3/+3
Update `dlmalloc` dependency of libstd This primarily pulls in alexcrichton/dlmalloc-rs#55 and alexcrichton/dlmalloc-rs#54 to address rust-lang/rust#144199. Notably the highest byte in the wasm address space is no longer allocatable and additionally the allocator internally uses `wrapping_add` instead of `add` on pointers since on 32-bit platforms offsets might be larger than half the address space. Closes rust-lang/rust#144199
2025-07-26Rollup merge of #144356 - GuillaumeGomez:gcc-ignore-tests, r=jieyouxuTrevor Gross-34/+128
Add `ignore-backends` annotations in failing GCC backend ui tests Follow-up of https://github.com/rust-lang/rust/pull/144125. In the GCC backend, we don't support all ui tests yet and we have a list of tests we currently ignore available [here](https://github.com/rust-lang/rustc_codegen_gcc/blob/master/tests/failing-ui-tests.txt). This PR adds the `ignore-backends` annotations to the corresponding ui tests. The second commit is a fix to compiletest, complaining about `ignore-backends`. r? ```@jieyouxu```
2025-07-26Rollup merge of #144352 - heiher:llvm-22, r=dianqkTrevor Gross-1/+1
RustWrapper: Suppress getNextNonDebugInfoInstruction Link: https://github.com/llvm/llvm-project/pull/144383
2025-07-26Rollup merge of #144341 - CaiWeiran:const-vector_test, r=wesleywiserTrevor Gross-0/+2
Enable const-vector.rs test on RISC-V (riscv64) This PR replaces [#144283](https://github.com/rust-lang/rust/pull/144283) to resolve merge conflicts. This PR adds support for running the `tests/codegen/const-vector.rs` test on the RISC-V (riscv64) architecture. Previously, this test would fail on RISC-V targets due to architecture-specific code generation issues. This patch modifies the test to ensure compatibility while preserving its intent. The change has been tested locally using `./x test` on a riscv64 target, and the test now passes as expected. ### Notes: - This change is scoped specifically to improve RISC-V compatibility. - It does not affect behavior or test results on other architectures.
2025-07-26Rollup merge of #144339 - CaiWeiran:dwarf-mixed-versions-lto_test, r=wesleywiserTrevor Gross-3/+4
Enable dwarf-mixed-versions-lto.rs test on RISC-V (riscv64) This PR replaces [#144284](https://github.com/rust-lang/rust/pull/144284) to resolve merge conflicts. This PR adds support for running the `tests/assembly/dwarf-mixed-versions-lto.rs` test on the RISC-V (riscv64) architecture. Previously, this test would fail on RISC-V targets due to architecture-specific code generation issues. This patch modifies the test to ensure compatibility while preserving its intent. The change has been tested locally using `./x test` on a riscv64 target, and the test now passes as expected. ### Notes: - This change is scoped specifically to improve RISC-V compatibility. - It does not affect behavior or test results on other architectures.
2025-07-26Rollup merge of #144316 - Gelbpunkt:musl-libdir-bootstrap, r=KobzolTrevor Gross-14/+18
bootstrap: Move musl-root fallback out of sanity check Previously, the musl root would only be set to the fallback `/usr` by the sanity check, which isn't ran for the bootstrap tests. r? ``````@Kobzol``````
2025-07-26Rollup merge of #144201 - estebank:suggest-clone, r=SparrowLiiTrevor Gross-0/+364
Mention type that could be `Clone` but isn't in more cases When encountering a moved value of a type that isn't `Clone` because of unmet obligations, but where all the unmet predicates reference crate-local types, mention them and suggest cloning, as we do in other cases already: ``` error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure --> f111.rs:14:25 | 13 | fn do_stuff(foo: Option<Foo>) { | --- captured outer variable 14 | require_fn_trait(|| async { | -- ^^^^^ `foo` is moved here | | | captured by this `Fn` closure 15 | if foo.map_or(false, |f| f.foo()) { | --- | | | variable moved due to use in coroutine | move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait | note: if `Foo` implemented `Clone`, you could clone the value --> f111.rs:4:1 | 4 | struct Foo; | ^^^^^^^^^^ consider implementing `Clone` for this type ... 15 | if foo.map_or(false, |f| f.foo()) { | --- you could clone this value ``` CC rust-lang/rust#68119.
2025-07-26Rollup merge of #144171 - Nadrieril:exhaustive-witnesses, r=davidtwcoTrevor Gross-21/+161
pattern_analysis: add option to get a full set of witnesses This adds an option to the rustc_pattern_analysis machinery to have it report a complete set of patterns when a match is non-exhaustive (by default we only guarantee to report _some_ missing patterns). This is for use in rust-analyzer. Leaving as draft until I'm sure this is what r-a needs. r? ghost
2025-07-26Rollup merge of #144089 - Oneirical:uncountable-integer-1, r=jieyouxuTrevor Gross-49/+107
Rehome 35 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` rust-lang/rust#143902 divided into smaller, easier to review chunks. Part of rust-lang/rust#133895 Methodology: 1. Refer to the previously written `tests/ui/SUMMARY.md` 2. Find an appropriate category for the test, using the original issue thread and the test contents. 3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers) 4. Rename the tests to make their purpose clearer The URL addition at the end, as well as moving around the auxiliary files and editing the `stderr` files with the new filename, were done using a Python script. Inspired by the methodology that `@Kivooeo` was using. r? `@jieyouxu`
2025-07-26Auto merge of #139597 - Kobzol:lint-skip, r=BoxyUwUbors-4/+13
Do not run per-module late lints if they can be all skipped We run ~70 late lints for all dependencies even if they use `--cap-lints=allow`, which seems wasteful. It looks like these lints are super fast (unlike early lints), but still. r? `@ghost`
2025-07-25Auto merge of #144338 - weihanglo:update-cargo, r=weihanglobors-0/+1
Update cargo 8 commits in 6833aa715d724437dc1247d0166afe314ab6854e..9b296973b425ffb159e12cf3cd56580fd5c85382 2025-07-13 02:25:52 +0000 to 2025-07-25 17:10:08 +0000 - Allow using Cargo-as-a-library with gix's reqwest backend (rust-lang/cargo#15653) - Make timings graphs scalable to user's window (rust-lang/cargo#15766) - refactor: rename arg `mode` to `intent` (rust-lang/cargo#15774) - fix: `no-proc-macro` is overridden by subsequent edges (rust-lang/cargo#15764) - Use `gix` for `cargo package` (rust-lang/cargo#15534) - cargo-credential-libsecret: give FFI correctly-sized object (rust-lang/cargo#15767) - Remove unnecessary target-c-int-width from target specs (rust-lang/cargo#15759) - Expose artifact dependency getters in cargo-as-a-library (rust-lang/cargo#15753)
2025-07-25Update cargoWeihang Lo-0/+1
ring is brought into Cargo transitively because Cargo now provides optional (unstable) reqwest HTTP backend.
2025-07-25Auto merge of #144449 - flip1995:clippy-subtree-update, r=Manishearthbors-1125/+3791
Clippy subtree update r? `@Manishearth`
2025-07-25Mention type that could be `Clone` but isn't in more casesEsteban Küber-0/+364
When encountering a moved value of a type that isn't `Clone` because of unmet obligations, but where all the unmet predicates reference crate-local types, mention them and suggest cloning, as we do in other cases already: ``` error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure --> f111.rs:14:25 | 13 | fn do_stuff(foo: Option<Foo>) { | --- captured outer variable 14 | require_fn_trait(|| async { | -- ^^^^^ `foo` is moved here | | | captured by this `Fn` closure 15 | if foo.map_or(false, |f| f.foo()) { | --- | | | variable moved due to use in coroutine | move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait | note: if `Foo` implemented `Clone`, you could clone the value --> f111.rs:4:1 | 4 | struct Foo; | ^^^^^^^^^^ consider implementing `Clone` for this type ... 15 | if foo.map_or(false, |f| f.foo()) { | --- you could clone this value ```
2025-07-25Allow approx-constant in `x clippy library`Philipp Krones-0/+1
2025-07-25Merge commit '1db89a1b1ca87f24bf22d0bad21d14b2d81b3e99' into ↵Philipp Krones-1125/+3790
clippy-subtree-update
2025-07-25Rustup (#15341)Philipp Krones-457/+972
r? @ghost changelog: none
2025-07-25Fix if_same_then_else with if let conditionsPhilipp Krones-13/+3
Apparently they are no longer split 1 LHS + rest RHS
2025-07-25Bump nightly version -> 2025-07-25Philipp Krones-2/+2
2025-07-25Update .gitignorePhilipp Krones-0/+2
Add !clippy_test_deps/Cargo.lock and clippy_lints_internal/target
2025-07-25Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-1130/+3805
2025-07-25Auto merge of #144440 - matthiaskrgr:rollup-peb88gb, r=matthiaskrgrbors-261/+511
Rollup of 12 pull requests Successful merges: - rust-lang/rust#142569 (Suggest clone in user-write-code instead of inside macro) - rust-lang/rust#143401 (tests: Don't check for self-printed output in std-backtrace.rs test) - rust-lang/rust#143424 (clippy fix: rely on autoderef) - rust-lang/rust#143970 (Update core::mem::copy documentation) - rust-lang/rust#143979 (Test fixes for Arm64EC Windows) - rust-lang/rust#144200 (Tweak output for non-`Clone` values moved into closures) - rust-lang/rust#144209 (Don't emit two `assume`s in transmutes when one is a subset of the other) - rust-lang/rust#144314 (Hint that choose_pivot returns index in bounds) - rust-lang/rust#144340 (UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern`) - rust-lang/rust#144368 (resolve: Remove `Scope::CrateRoot`) - rust-lang/rust#144390 (Remove dead code and extend test coverage and diagnostics around it) - rust-lang/rust#144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-25Rollup merge of #144392 - makai410:rm-mov, r=scottmcmMatthias Krüger-14/+8
rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine` Part of rust-lang/rust#119174 . I think we should be good now to sync this change in rustc_public.
2025-07-25Rollup merge of #144390 - oli-obk:arbitrary-enum-discrs, r=SparrowLiiMatthias Krüger-48/+65
Remove dead code and extend test coverage and diagnostics around it I was staring a bit at the `dont_niche_optimize_enum` variable and figured out that part of it is dead code (at least today it is). I changed the diagnostic and test around the code that makes that part dead code, so everything that makes removing that code sound is visible in this PR
2025-07-25Rollup merge of #144368 - petrochenkov:rmrootscope, r=b-naberMatthias Krüger-57/+39
resolve: Remove `Scope::CrateRoot` Use `Scope::Module` with the crate root module inside instead, which should be identical. This is a simplification by itself, but it will be even larger simplification if something like https://github.com/rust-lang/rust/pull/144131 is implemented, because `Scope::CrateRoot` is also a module with two actual scopes in it (for globs and non-globs). I also did some renamings for consistency: - `ScopeSet::AbsolutePath` -> `ScopeSet::ModuleAndExternPrelude` - `ModuleOrUniformRoot::CrateRootAndExternPrelude` -> `ModuleOrUniformRoot::ModuleAndExternPrelude` - `is_absolute_path` -> `module_and_extern_prelude`
2025-07-25Rollup merge of #144340 - Oneirical:uncertain-illusion, r=jieyouxuMatthias Krüger-4/+4
UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern` To match convention, rename `tests/ui/SUMMARY.md` to `tests/ui/README.md`. Also, remove misleading lines in the rustc development guide about `error-pattern` being "not recommended", when it really is just a last resort which *should* be used in the niche situations where it is useful. r? ````@jieyouxu````
2025-07-25Rollup merge of #144314 - kornelski:pivot-safely, r=jhprattMatthias Krüger-10/+10
Hint that choose_pivot returns index in bounds Instead of using `unsafe` in multiple places, one `hint::assert_unchecked` allows use of safe code instead. Part of #rust-lang/rust#144326
2025-07-25Rollup merge of #144209 - scottmcm:assume_less, r=lcnr,dianqkMatthias Krüger-12/+150
Don't emit two `assume`s in transmutes when one is a subset of the other For example, transmuting between `bool` and `Ordering` doesn't need two `assume`s because one range is a superset of the other. Multiple are still used for things like `char` <-> `NonZero<u32>`, which overlap but where neither fully contains the other.
2025-07-25Rollup merge of #144200 - estebank:dont-point-at-closure, r=lcnrMatthias Krüger-99/+148
Tweak output for non-`Clone` values moved into closures When we encounter a non-`Clone` value being moved into a closure, try to find the corresponding type of the binding being moved, if it is a `let`-binding or a function parameter. If any of those cases, we point at them with the note explaining that the type is not `Copy`, instead of giving that label to the place where it is captured. When it is a `let`-binding with no explicit type, we point at the initializer (if it fits in a single line). ``` error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure --> f111.rs:14:25 | 13 | fn do_stuff(foo: Option<Foo>) { | --- ----------- move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait | | | captured outer variable 14 | require_fn_trait(|| async { | -- ^^^^^ `foo` is moved here | | | captured by this `Fn` closure 15 | if foo.map_or(false, |f| f.foo()) { | --- variable moved due to use in coroutine ``` instead of ``` error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure --> f111.rs:14:25 | 13 | fn do_stuff(foo: Option<Foo>) { | --- captured outer variable 14 | require_fn_trait(|| async { | -- ^^^^^ `foo` is moved here | | | captured by this `Fn` closure 15 | if foo.map_or(false, |f| f.foo()) { | --- | | | variable moved due to use in coroutine | move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait ```
2025-07-25Rollup merge of #143979 - dpaoliello:arm64ectest, r=petrochenkovMatthias Krüger-2/+6
Test fixes for Arm64EC Windows * `tests/ui/cfg/conditional-compile-arch.rs` needs an Arm64EC case. * `tests/ui/runtime/backtrace-debuginfo.rs` should skip Arm64EC as it suffers from the same truncated backtraces as Arm64 Windows. * `tests/ui/linkage-attr/incompatible-flavor.rs` is a general issue: it assumes that the Rust compiler is always built with the x86 target enabled in the backend, but I only enabled AArch64 when building locally to speed up the LLVM compilation.
2025-07-25Rollup merge of #143970 - SunkenPotato:update_mem_copy_docs, r=scottmcmMatthias Krüger-1/+1
Update core::mem::copy documentation Update the documentation of `core::mem::copy` to include a `const` on the definition of the function.
2025-07-25Rollup merge of #143424 - hkBst:auto-deref, r=jhprattMatthias Krüger-7/+7
clippy fix: rely on autoderef Changes instances of `&**self` to `self`.
2025-07-25Rollup merge of #143401 - Enselic:no-stack-backtrace-print-in-display, ↵Matthias Krüger-6/+2
r=davidtwco tests: Don't check for self-printed output in std-backtrace.rs test The `Display` implementation for `Backtrace` used to print stack backtrace: but that print was since removed. See https://github.com/rust-lang/backtrace-rs/pull/286 and https://github.com/rust-lang/rust/pull/69042. To make the existing test pass, the print was added to the test instead. But it doesn't make sense to check for something that the test itself does since that will not detect any regressions in the implementation of `Backtrace`. What the test _should_ check is that "stack backtrace:" is _not_ printed in `Display` of `Backtrace`. So do that instead. This is one small steps towards resolving https://github.com/rust-lang/rust/issues/71706. The next steps after this step involves extending and hardening that test further.
2025-07-25Rollup merge of #142569 - xizheyin:139253, r=davidtwcoMatthias Krüger-1/+71
Suggest clone in user-write-code instead of inside macro Fixes rust-lang/rust#139253 Inspired by rust-lang/rust#142543 r? ````@fmease````
2025-07-25Remove "Known problems" section for `clippy::redundant_closure` (#15331)dswij-6/+0
Remove "Known problems" section for `clippy::redundant_closure` since it was fixed by [this PR](https://github.com/rust-lang/rust-clippy/pull/4008) We can see this by running examples from [the issue](https://github.com/rust-lang/rust-clippy/issues/1439), for ex. [this one](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=6562527b4c3f6dcebb3c43718341af98) changelog: none
2025-07-24Fix `if_then_some_else_none` FP when require type coercion (#15267)Alejandra González-3/+251
Closes rust-lang/rust-clippy#15257 changelog: [`if_then_some_else_none`] fix FP when require type coercion
2025-07-24Rename tests/ui/SUMMARY.md and update rustc dev guide on error-patternOneirical-4/+4
2025-07-24Rehome tests/ui/issues/ tests [1/?]Oneirical-49/+107
2025-07-24Auto merge of #144389 - scottmcm:no-more-mir-cast-assume, r=davidtwcobors-151/+38
MIR-build: No longer emit assumes in enum-as casting This just uses the `valid_range` from the backend, so it's duplicating the range metadata that now we include on parameters and loads, and thus no longer seems to be useful -- notably there's no codegen test failures from removing it. (Because it's using data from the same source as the backend annotations, it doesn't do anything to mitigate things like rust-lang/rust#144388 where the range in the layout is more permissive than the actual possible discriminants. A variant of this that actually checked the discriminants more specifically might be useful, so could potentially be added in future, but I don't think the *current* checks are actually providing value.) r? mir Randomly turns out that this Fixes https://github.com/rust-lang/rust/issues/121097
2025-07-24MIR-build: No longer emit assumes in enum-as castingScott McMurray-151/+38
This just uses the `valid_range` from the backend, so it's duplicating the range metadata that now we include on parameters and loads.
2025-07-24Auto merge of #144398 - fmease:rollup-z6vq7mi, r=fmeasebors-1578/+1839
Rollup of 15 pull requests Successful merges: - rust-lang/rust#143374 (Unquerify extern_mod_stmt_cnum.) - rust-lang/rust#143838 (std: net: uefi: Add support to query connection data) - rust-lang/rust#144014 (don't link to the nightly version of the Edition Guide in stable lints) - rust-lang/rust#144094 (Ensure we codegen the main fn) - rust-lang/rust#144218 (Use serde for target spec json deserialize) - rust-lang/rust#144221 (generate elf symbol version in raw-dylib) - rust-lang/rust#144240 (Add more test case to check if the false note related to sealed trait suppressed) - rust-lang/rust#144247 (coretests/num: use ldexp instead of hard-coding a power of 2) - rust-lang/rust#144276 (Use less HIR in check_private_in_public.) - rust-lang/rust#144278 (add Rev::into_inner) - rust-lang/rust#144317 (pass build.npm from bootstrap to tidy and use it for npm install) - rust-lang/rust#144320 (rustdoc: avoid allocating a temp String for aliases in search index) - rust-lang/rust#144334 (rustc_resolve: get rid of unused rustdoc::span_of_fragments_with_expansion) - rust-lang/rust#144335 (Don't suggest assoc ty bound on non-angle-bracketed problematic assoc ty binding) - rust-lang/rust#144358 (Stop using the old `validate_attr` logic for stability attributes) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-24Rollup merge of #144358 - JonathanBrouwer:fix-stability-malformed, r=oli-obkLeón Orell Valerian Liehr-14/+47
Stop using the old `validate_attr` logic for stability attributes I think this was accidentally missed when implementing the stability attributes? r? `````@oli-obk````` cc `````@jdonszelmann`````
2025-07-24Rollup merge of #144335 - fmease:no-angle-no-colon, r=SparrowLiiLeón Orell Valerian Liehr-5/+36
Don't suggest assoc ty bound on non-angle-bracketed problematic assoc ty binding Fixes https://github.com/rust-lang/rust/issues/140543.
2025-07-24Rollup merge of #144334 - lolbinarycat:rustdoc-span_of_fragments-revert, ↵León Orell Valerian Liehr-13/+4
r=GuillaumeGomez rustc_resolve: get rid of unused rustdoc::span_of_fragments_with_expansion This function can cause false negatives if used incorrectly (usually "do any of the doc fragments come from a macro" is the wrong question to ask), and thus it is unused. r? `````@GuillaumeGomez`````
2025-07-24Rollup merge of #144320 - lolbinarycat:rustdoc-search_index-BTreeMap-str, ↵León Orell Valerian Liehr-3/+16
r=GuillaumeGomez rustdoc: avoid allocating a temp String for aliases in search index Here's the optimization I talked about in https://github.com/rust-lang/rust/pull/143988#discussion_r2208524163 I got around the Serialize issue using the newtype pattern. The wrapper type could be factored out into a helper that would work with anything that impls `AsRef<&str>`, but I'm not sure if that would be helpful anywhere else. r? ``````@GuillaumeGomez``````
2025-07-24Rollup merge of #144317 - lolbinarycat:tidy-obey-build.npm, r=KobzolLeón Orell Valerian Liehr-4/+14
pass build.npm from bootstrap to tidy and use it for npm install followup to rust-lang/rust#142924 r? ```@Kobzol```
2025-07-24Rollup merge of #144278 - Qelxiros:rev-into-inner, r=tgross35León Orell Valerian Liehr-0/+19
add Rev::into_inner Tracking issue: rust-lang/rust#144277
2025-07-24Rollup merge of #144276 - cjgillot:no-hir-privacy, r=petrochenkovLeón Orell Valerian Liehr-124/+92
Use less HIR in check_private_in_public. r? ````````@petrochenkov````````
2025-07-24Rollup merge of #144247 - RalfJung:ldexp, r=tgross35León Orell Valerian Liehr-32/+38
coretests/num: use ldexp instead of hard-coding a power of 2 r? `````@tgross35`````
2025-07-24Rollup merge of #144240 - ↵León Orell Valerian Liehr-5/+32
yuk1ty:false-sealed-traits-note-reported-in-another-issue, r=fee1-dead Add more test case to check if the false note related to sealed trait suppressed Closes rust-lang/rust#143121 I started to fix the issue but I found that this one has already been addressed in this PR (https://github.com/rust-lang/rust/pull/143431). I added an additional test to prove the reported thing has been resolved just in case. I think we can discard this pull request if there's no need to add such kind of tests👍🏻