about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-07-08Auto merge of #134628 - estebank:const-default, r=oli-obkbors-2/+4
Make `Default` const and add some `const Default` impls Full list of `impl const Default` types: - () - bool - char - std::ascii::Char - usize - u8 - u16 - u32 - u64 - u128 - i8 - i16 - i32 - i64 - i128 - f16 - f32 - f64 - f128 - std::marker::PhantomData<T> - Option<T> - std::iter::Empty<T> - std::ptr::Alignment - &[T] - &mut [T] - &str - &mut str - String - Vec<T>
2025-07-07Account for const stability in clippy when checking constnessEsteban Küber-6/+14
2025-07-07Make `Default` const and add some `const Default` implsEsteban Küber-10/+4
Full list of `impl const Default` types: - () - bool - char - Cell - std::ascii::Char - usize - u8 - u16 - u32 - u64 - u128 - i8 - i16 - i32 - i64 - i128 - f16 - f32 - f64 - f128 - std::marker::PhantomData<T> - Option<T> - std::iter::Empty<T> - std::ptr::Alignment - &[T] - &mut [T] - &str - &mut str - String - Vec<T>
2025-07-07Auto merge of #143601 - matthiaskrgr:rollup-9iw2sqk, r=matthiaskrgrbors-25/+25
Rollup of 9 pull requests Successful merges: - rust-lang/rust#132469 (Do not suggest borrow that is already there in fully-qualified call) - rust-lang/rust#143340 (awhile -> a while where appropriate) - rust-lang/rust#143438 (Fix the link in `rustdoc.md`) - rust-lang/rust#143539 (Regression tests for repr ICEs) - rust-lang/rust#143566 (Fix `x86_64-unknown-netbsd` platform support page) - rust-lang/rust#143572 (Remove unused allow attrs) - rust-lang/rust#143583 (`loop_match`: fix 'no terminator on block') - rust-lang/rust#143584 (make `Machine::load_mir` infallible) - rust-lang/rust#143591 (Fix missing words in future tracking issue) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-07Rollup merge of #143340 - nabijaczleweli:awhile, r=mati865Matthias Krüger-25/+25
awhile -> a while where appropriate
2025-07-07Auto merge of #143182 - xdoardo:more-addrspace, r=workingjubileebors-10/+11
Allow custom default address spaces and parse `p-` specifications in the datalayout string Some targets, such as CHERI, use as default an address space different from the "normal" default address space `0` (in the case of CHERI, [200 is used](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-877.pdf)). Currently, `rustc` does not allow to specify custom address spaces and does not take into consideration [`p-` specifications in the datalayout string](https://llvm.org/docs/LangRef.html#langref-datalayout). This patch tries to mitigate these problems by allowing targets to define a custom default address space (while keeping the default value to address space `0`) and adding the code to parse the `p-` specifications in `rustc_abi`. The main changes are that `TargetDataLayout` now uses functions to refer to pointer-related informations, instead of having specific fields for the size and alignment of pointers in the default address space; furthermore, the two `pointer_size` and `pointer_align` fields in `TargetDataLayout` are replaced with an `FxHashMap` that holds info for all the possible address spaces, as parsed by the `p-` specifications. The potential performance drawbacks of not having ad-hoc fields for the default address space will be tested in this PR's CI run. r? workingjubilee
2025-07-07Rollup merge of #143528 - RalfJung:stack-pop-cleanup, r=oli-obk许杰友 Jieyou Xu (Joe)-16/+16
interpret: rename StackPopCleanup The name `StackPopCleanup` stopped making sense a long time ago IMO -- in the common case, it has nothing to do with "cleanup", and everything with where the program should jump next. If we didn't have unwinding this would be just the return block, but given that we do have unwinding I figured maybe "continuation" would be a good name. This comes up in [continuation-passing style](https://en.wikipedia.org/wiki/Continuation-passing_style) and refers to where the program will *continue* when a function is done. So from a PL perspective it is the most fitting term I think -- but it may be too jargony. r? `@oli-obk` what do you think?
2025-07-07Auto merge of #143565 - lnicola:sync-from-ra, r=lnicolabors-668/+1281
Subtree update of `rust-analyzer` r? `@ghost`
2025-07-07compiler: Parse `p-` specs in datalayout string, allow definition of custom ↵Edoardo Marangoni-10/+11
default data address space
2025-07-07Auto merge of #143556 - jhpratt:rollup-nid39y2, r=jhprattbors-26/+26
Rollup of 9 pull requests Successful merges: - rust-lang/rust#143206 (Align attr fixes) - rust-lang/rust#143236 (Stabilize `mixed_integer_ops_unsigned_sub`) - rust-lang/rust#143344 (Port `#[path]` to the new attribute parsing infrastructure ) - rust-lang/rust#143359 (Link to 2024 edition page for `!` fallback changes) - rust-lang/rust#143456 (mbe: Change `unused_macro_rules` to a `DenseBitSet`) - rust-lang/rust#143529 (Renamed retain_mut to retain on LinkedList as mentioned in the ACP) - rust-lang/rust#143535 (Remove duplicate word) - rust-lang/rust#143544 (compiler: rename BareFn to FnPtr) - rust-lang/rust#143552 (lib: more eagerly return `self.len()` from `ceil_char_boundary`) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-07Rollup merge of #143544 - workingjubilee:rename-bare-fn, r=fmeaseJacob Pratt-26/+26
compiler: rename BareFn to FnPtr At some point "BareFn" was the chosen name for a "bare" function, without the niceties of `~fn`, `&fn`, or a few other ways of writing a function type. However, at some point the syntax for a "bare function" and any other function diverged even more. We started calling them what they are: function pointers, denoted by their own syntax. However, we never changed the *internal* name for these, as this divergence was very gradual. Personally, I have repeatedly searched for "FnPtr" and gotten confused until I find the name is BareFn, only to forget this until the next time, since I don't routinely interact with the higher-level AST and HIR. But even tools that interact with these internal types only touch on them in a few places, making a migration easy enough. Let's use a more intuitive and obvious name, as this 12+ year old name has little to do with current Rust.
2025-07-06Auto merge of #141829 - dvdsk:sleep_until_linux, r=cuviper,RalfJungbors-0/+192
Specialize sleep_until implementation for unix (except mac) related tracking issue: https://github.com/rust-lang/rust/issues/113752 Supersedes https://github.com/rust-lang/rust/pull/118480 for the reasons see: https://github.com/rust-lang/rust/issues/113752#issuecomment-2902594469 Replaces the generic catch all implementation with target_os specific ones for: linux/netbsd/freebsd/android/solaris/illumos etc. Other platforms like wasi, macos/ios/tvos/watchos and windows will follow in later separate PR's (once this is merged).
2025-07-06rustfmt: migrate BareFn -> FnPtrJubilee Young-9/+9
2025-07-06clippy: migrate BareFn -> FnPtrJubilee Young-17/+17
2025-07-06Auto merge of #143526 - matthiaskrgr:rollup-pm69g5v, r=matthiaskrgrbors-4/+4
Rollup of 4 pull requests Successful merges: - rust-lang/rust#143252 (Rewrite empty attribute lint for new attribute parser) - rust-lang/rust#143492 (Use `object` crate from crates.io to fix windows build error) - rust-lang/rust#143514 (Organize macro tests a bit more) - rust-lang/rust#143518 (rustc_builtin_macros: Make sure registered attributes stay sorted) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-06sleep_until: add clock_nanosleep support to Miridvdsk-0/+192
The clock_nanosleep support is there to allow code using `sleep_until` to run under Miri. Therefore the implementation is minimal. - Only the clocks REALTIME and MONOTONIC are supported. The first is supported simply because it was trivial to add not because it was needed for sleep_until. - The only supported flag combinations are no flags or TIMER_ABSTIME only. If an unsupported flag combination or clock is passed in this throws unsupported.
2025-07-06interpret: rename StackPopCleanupRalf Jung-16/+16
2025-07-06Rollup merge of #143252 - JonathanBrouwer:rewrite_empty_attribute, ↵Matthias Krüger-4/+4
r=jdonszelmann Rewrite empty attribute lint for new attribute parser cc `@jdonszelmann`
2025-07-06Auto merge of #143515 - rust-lang:cargo_update, r=clubby789bors-2/+2
Weekly `cargo update` Automation to keep dependencies in `Cargo.lock` current. r? dep-bumps The following is the output from `cargo update`: ```txt compiler & tools dependencies: Locking 6 packages to latest compatible versions Adding io-uring v0.7.8 Updating jsonpath-rust v1.0.2 -> v1.0.3 Updating libffi v4.1.0 -> v4.1.1 Updating libffi-sys v3.3.1 -> v3.3.2 Updating tokio v1.45.1 -> v1.46.1 Updating wasm-component-ld v0.5.14 -> v0.5.15 note: pass `--verbose` to see 41 unchanged dependencies behind latest library dependencies: Locking 0 packages to latest compatible versions note: pass `--verbose` to see 4 unchanged dependencies behind latest rustbook dependencies: Locking 1 package to latest compatible version Updating cc v1.2.27 -> v1.2.29 ```
2025-07-06Merge pull request #20184 from Veykril/push-ywpynxnltpokLukas Wirth-32/+44
chore: Remove dead field from `InferenceContext`
2025-07-06chore: Remove dead field from `InferenceContext`Lukas Wirth-32/+44
2025-07-06Rollup merge of #143504 - RalfJung:compiletest-err, r=jieyouxuMatthias Krüger-1/+2
compiletest: print slightly more information on fs::write failure See [#t-infra > compiletest: panic in dump_output_file: No such file or dire @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/compiletest.3A.20panic.20in.20dump_output_file.3A.20No.20such.20file.20or.20dire/near/527294714)
2025-07-06Rollup merge of #143493 - lolbinarycat:tidy-spellcheck-bless, r=KobzolMatthias Krüger-6/+12
tidy: use --bless for tidy spellcheck instead of spellcheck:fix previous behavior was inconsistent with existing extra checks. unsure if this needs a change tracker entry or a warning for people who try to use the old behavior. unsure if we should call this `spellcheck:lint` for consistency. making this consistent is a prerequisite for https://github.com/rust-lang/rust/pull/143398 cc `@nnethercote` r? `@Kobzol`
2025-07-06Merge pull request #20132 from A4-Tacks/asmut-borrow-minicoreLukas Wirth-0/+34
Add AsMut, Borrow and BorrowMut to minicore and famous_defs
2025-07-06Merge pull request #20126 from Wilfred/no_unwrap_in_discover_projectsLukas Wirth-3/+8
fix: Avoid .unwrap() when running the discover command
2025-07-06Rewrite empty attribute lintJonathan Brouwer-4/+4
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-06Merge pull request #20179 from ChayimFriedman2/destructuring-assignment-neverLukas Wirth-2/+61
fix: Fix diverging destructuring assignments
2025-07-06Merge pull request #20175 from dianne/match-check-box-cleanupChayim Refael Friedman-60/+20
`hir_ty::match_check` cleanup: remove special handling for box patterns
2025-07-06cargo updategithub-actions-2/+2
compiler & tools dependencies: Locking 6 packages to latest compatible versions Adding io-uring v0.7.8 Updating jsonpath-rust v1.0.2 -> v1.0.3 Updating libffi v4.1.0 -> v4.1.1 Updating libffi-sys v3.3.1 -> v3.3.2 Updating tokio v1.45.1 -> v1.46.1 Updating wasm-component-ld v0.5.14 -> v0.5.15 note: pass `--verbose` to see 41 unchanged dependencies behind latest library dependencies: Locking 0 packages to latest compatible versions note: pass `--verbose` to see 4 unchanged dependencies behind latest rustbook dependencies: Locking 1 package to latest compatible version Updating cc v1.2.27 -> v1.2.29
2025-07-05Rollup merge of #143478 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-475/+1468
Miri subtree update r? `@ghost`
2025-07-05compiletest: print slightly more information on fs::write failureRalf Jung-1/+2
2025-07-05Fix diverging destructuring assignmentsChayim Refael Friedman-2/+61
They need to return `!`, unlike diverging ordinary assignments. See the comment in the code.
2025-07-05Rollup merge of #143447 - jieyouxu:compiletest-maintenance-4, r=KobzolBen Kimock-93/+353
[COMPILETEST-UNTANGLE 4/N] Improve compiletest config documentation This is part of a patch series to untangle `compiletest` to hopefully nudge it towards being more maintainable. This PR should contain **no functional changes**. This is pulled out to its own PR to make follow-up changes easier to review. There are *intentionally* a *lot* of FIXME comments, intended to be gradually addressed in follow-ups. r? `@Kobzol`
2025-07-05tidy: add specific error message for trying to use `spellcheck:fix`.binarycat-0/+7
2025-07-05tidy: use --bless for tidy spellcheck instead of spellcheck:fixbinarycat-6/+5
previous behavior was inconsistent with existing extra checks.
2025-07-05Fix Borrow and BorrowMut define from beta stdA4-Tacks-2/+2
2025-07-05Improve compiletest config documentationJieyou Xu-93/+353
Including a bunch of FIXMEs.
2025-07-05fmtRalf Jung-1/+3
2025-07-05Merge from rustcRalf Jung-29/+30
2025-07-05Preparing for merge from rustcRalf Jung-1/+1
2025-07-04`hir_ty::match_check`: remove special handling for box patternsdianne-60/+20
2025-07-04Rollup merge of #142440 - Kivooeo:tf14, r=tgross35Jubilee-4/+0
`tests/ui`: A New Order [14/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@jieyouxu`
2025-07-05Rollup merge of #143372 - cjgillot:bare-glob-map, r=petrochenkovMatthias Krüger-1/+1
Remove names_imported_by_glob_use query. Based on https://github.com/rust-lang/rust/pull/143247 r? ``@ghost`` for perf
2025-07-04Port `#[non_exhaustive]` to the new attribute parsing infrastructureJonathan Brouwer-12/+16
2025-07-04remove syntaxTree from docsvinícius x-18/+0
2025-07-04fix: Avoid .unwrap() when running the discover commandWilfred Hughes-3/+8
Previously, the following configuration in settings.json: "rust-analyzer.workspace.discoverConfig": { "command": [ "oops", "develop-json", "{arg}" ], "progressLabel": "rust-analyzer", "filesToWatch": [ "BUCK", "TARGETS" ] }, Would previously cause a crash in rust-analyzer: thread 'LspServer' panicked at crates/rust-analyzer/src/main_loop.rs:776:84: called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" } Instead, use more specific panic messages.
2025-07-04Rollup merge of #143387 - dpaoliello:shouldpanicfn, r=bjorn3Matthias Krüger-13/+8
Make __rust_alloc_error_handler_should_panic a function Fixes rust-lang/rust#143253 `__rust_alloc_error_handler_should_panic` is a static but was being exported as a function. For most targets this doesn't matter, but Arm64EC Windows uses different decorations for exported variables vs functions, hence it fails to link when `-Z oom=abort` is enabled. We've had issues in the past with statics like this (see rust-lang/rust#141061) but the tldr; is that Arm64EC needs symbols correctly exported as either a function or data, and data MUST and MUST ONLY be marked `dllimport` when the symbol is being imported from another binary, which is non-trivial to calculate for these compiler-generated statics. So, instead, the easiest thing to do is to make `__rust_alloc_error_handler_should_panic` a function instead. Since `__rust_alloc_error_handler_should_panic` isn't involved in any linking shenanigans, I've marked it as `AlwaysInline` with the hopes that the various backends will see that it is just returning a constant and perform the same optimizations as the previous implementation. r? `@bjorn3`
2025-07-04Rollup merge of #143286 - Muscraft:track-diagnostics-note, r=WaffleLapkinMatthias Krüger-3/+5
Make -Ztrack-diagnostics emit like a note [#t-compiler/diagnostics > Rendering -Ztrack-diagnostics like a note](https://rust-lang.zulipchat.com/#narrow/channel/147480-t-compiler.2Fdiagnostics/topic/Rendering.20-Ztrack-diagnostics.20like.20a.20note/with/526608647) As discussed on the Zulip thread above, I want to make `-Ztrack-diagnostics` emit like a `note`. This is because I find its current output jarring, and the fact that it gets rendered completely left-aligned, [even in the middle of a snippet](https://github.com/rust-lang/rust/blob/86e05cd300fac9e83e812c4d46582b48db780d8f/tests/ui/track-diagnostics/track6.stderr), seems like something that should be changed. Turning it into a `note` seems like the best choice, as it would align it with the rest of the output, and `note` is already used for somewhat similar things, like seeing why a lint was fired. --- Note: turning `-Ztrack-diagnostics` into a `note` will also make `annotate-snippets` API a bit cleaner
2025-07-04Remove names_imported_by_glob_use query.Camille GILLOT-1/+1
2025-07-04Merge pull request #20170 from Veykril/push-vtsmzopsunswLaurențiu Nicola-3/+12
Improve flycheck and build script progress reporting