about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-08-31some refactoring and cleanupRalf Jung-145/+128
2025-08-31Merge pull request #4551 from nia-e/fixup-jump-instrRalf Jung-26/+26
native-lib: more resilient grabbing of instruction bytes
2025-08-31native-lib: pass structs to native codeNia Espera-129/+467
2025-08-31native-lib: more resilient grabbing of instruction bytesNia Espera-26/+26
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-08-31allow taking address to union fieldKivooeo-12/+132
2025-08-31Supress `excessive_precision` when constants are overly precise (#15193)Samuel Tardieu-24/+330
Suppress the `excessive_precision` lint when the literal is the initializer of a `const` item and overly precise (over 40 digits). If an overly precise literal is used in a let initialization it produces a note suggesting the change. changelog: [`excessive_precision`]: suppress the lint when `const` items are overly precise, configurable through the new `const_literal_digits_threshold` option Fixes rust-lang/rust-clippy#13855
2025-08-31dedup to_radians float testKarol Zwolak-68/+26
2025-08-31Auto merge of #146053 - joboet:split-paths-regression, r=Mark-Simulacrumbors-5/+26
std: fix `SplitPaths` regression Fixes rust-lang/rust#146045 by defining the TAIT more precisely, ensuring that `'a` does not need to be live on drop.
2025-08-31dedup to_degrees float testKarol Zwolak-59/+29
2025-08-31fixup nix dev shell againWaffle Lapkin-0/+3
2025-08-31dedup powi float testKarol Zwolak-66/+28
2025-08-31fix: `needless_for_each` suggests wrongly with explicit closure input types ↵dswij-17/+76
(#15595) Fixes https://github.com/rust-lang/rust-clippy/issues/9912 changelog: [`needless_for_each`]: fix wrong suggestion with explicit closure input types
2025-08-31Supress excessive_precision when constants are overly preciseTeodoro Freund-24/+330
Added const associated items matching and static Added configurable threshold Addressed comments Renamed lint config field
2025-08-31Get the block content from the proper context (#15014)Timo-16/+133
The first statement of the block might have been in a different context from the expression. Walk up to the right context to get bounds properly. Also, switch to `snippet_with_applicability()` since we know that we are in the right context already. changelog: [`if_then_some_else_none`]: emit well-formed suggestion, and do not lint inside macros Fixes rust-lang/rust-clippy#15005
2025-08-31explicitly end `va_list` lifetimeFolkert de Vries-0/+3
2025-08-31round pointer to alignment without going via intFolkert de Vries-3/+6
2025-08-31Commas to semicolons in clippy.toml reasons (#15592)Alejandra González-5/+5
The things being separated are sentences. So I think semicolons are the right separators to use. changelog: none
2025-08-31Auto merge of #146052 - matthiaskrgr:rollup-cfxx9m6, r=matthiaskrgrbors-55/+123
Rollup of 4 pull requests Successful merges: - rust-lang/rust#144443 (Make target pointer width in target json an integer) - rust-lang/rust#145174 (Ensure consistent drop for panicking drop in hint::select_unpredictable) - rust-lang/rust#145592 (Fix format string grammar in docs and improve alignment error message for rust-lang/rust#144023) - rust-lang/rust#145931 (Clarify that align_offset overaligns) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-31add `#[must_use]` to `array::repeat`joboet-0/+1
2025-08-31std: fix `SplitPaths` regressionjoboet-5/+26
2025-08-31Rollup merge of #145931 - gonzalobg:patch-1, r=nagisaMatthias Krüger-3/+2
Clarify that align_offset overaligns The current documentation is not clear whether adding `a` to a pointer overaligns (align up) or underaligns (align down). It should say this explicitly. cc `@nagisa`
2025-08-31Rollup merge of #145592 - nilotpal-n7:fix-format-alignment, r=lcnrMatthias Krüger-9/+19
Fix format string grammar in docs and improve alignment error message for #144023 This PR improves error messages and documentation for format strings involving alignment and formatting traits. Highlights: - Clearer error messages for invalid alignment specifiers (e.g., `{0:#X>18}`), showing the expected `<`, `^`, or `>` and a working example: println!("{0:>#18X}", value); - Updated UI test `format-alignment-hash.rs` to reflect the improved error output. - Documentation clarification: ensures examples correctly show how width, alignment, and traits like `x`, `X`, `#` combine. Motivation: Previously, using `#` with alignment and width produced confusing errors. This PR guides users on the correct syntax and provides actionable examples. Testing: - Built the compiler (`./x build`) - Blessed and ran UI tests (`./x. test src/test/ui/fmt/format-alignment-hash.rs --bless`) - Verified full test suite passes (`./x test`) Issue: rust-lang/rust#144023
2025-08-31Rollup merge of #145174 - 197g:issue-145148-select-unpredictable-drop, r=joboetMatthias Krüger-2/+71
Ensure consistent drop for panicking drop in hint::select_unpredictable There are a few alternatives to the implementation. The principal problem is that the selected value must be owned (in the sense of having a drop flag of sorts) when the unselected value is dropped, such that panic unwind goes through the drop of both. This ownership must then be passed on in return when the drop went smoothly. The basic way of achieving this is by extracting the selected value first, at the cost of relying on the optimizer a little more for detecting the copy as constructing the return value despite having a place in the body. Unfortunately, that causes LLVM to discard the !unpredictable annotation (for some reason that is beyond my comprehension of LLVM). <details> <summary>Extract from the build log showing an unannotated select being used</summary> ``` 2025-08-09T16:51:06.8790764Z 39: define noundef i64 `@test_int2(i1` noundef zeroext %p, i64 noundef %a, i64 noundef %b) unnamed_addr #0 personality ptr `@rust_eh_personality` { 2025-08-09T16:51:06.8791368Z check:47'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found 2025-08-09T16:51:06.8791700Z 40: start: 2025-08-09T16:51:06.8791858Z check:47'0 ~~~~~~~ 2025-08-09T16:51:06.8792043Z 41: %ret.i = select i1 %p, i64 %a, i64 %b 2025-08-09T16:51:06.8792293Z check:47'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2025-08-09T16:51:06.8792686Z check:47'1 ? possible intended match 2025-08-09T16:51:06.8792946Z 42: ret i64 %ret.i 2025-08-09T16:51:06.8793127Z check:47'0 ~~~~~~~~~~~~~~~~ ``` </details> So instead, this PR includes a guard to drop the selected `MaybeUnit<T>` which is active only for the section where the unselected value is dropped. That leaves the code for selecting the result intact leading to the expected ir. That complicates the 'unselection' process a little bit since we require _both_ values as a result of that intrinsic call. Since the arguments alias, this portion as well as the drop guard uses raw pointers. Closes: rust-lang/rust#145148 Prior: rust-lang/rust#139977
2025-08-31Rollup merge of #144443 - WaffleLapkin:integer-target-pointer-width, r=NoratriebMatthias Krüger-41/+31
Make target pointer width in target json an integer r? Noratrieb cc `@RalfJung` (https://github.com/rust-lang/rust/pull/142352/files#r2230380120) try-job: x86_64-rust-for-linux
2025-08-31Auto merge of #146039 - Mark-Simulacrum:fix-bolt-path, r=Kobzolbors-5/+15
Use absolute path to llvm-bolt, merge-fdata rather than PATH This unconditionally uses the provided LLVM toolchain's BOLT. I'm not sure that makes sense, but since we don't build BOLT as part of Rust's build of LLVM today, it's probably the right option for now. This avoids breaking the build on not being able to find the llvm-bolt executable.
2025-08-31fixLorrensP-2158466-2/+2
2025-08-30rustdoc-search: improve concurrency at type searchMichael Howell-9/+15
2025-08-31Auto merge of #145582 - estebank:issue-107806, r=chenyukangbors-0/+160
Detect missing `if let` or `let-else` During `let` binding parse error and encountering a block, detect if there is a likely missing `if` or `else`: ``` error: expected one of `.`, `;`, `?`, `else`, or an operator, found `{` --> $DIR/missing-if-let-or-let-else.rs:14:25 | LL | let Some(x) = foo() { | ^ expected one of `.`, `;`, `?`, `else`, or an operator | help: you might have meant to use `if let` | LL | if let Some(x) = foo() { | ++ help: alternatively, you might have meant to use `let else` | LL | let Some(x) = foo() else { | ++++ ``` Fix rust-lang/rust#107806.
2025-08-31suggest method name with maybe ty mismatchyukang-1/+39
2025-08-31More targeted parentheses suggestion for match statement intended as expressionEsteban Küber-26/+116
``` error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:69:5 | LL | match () { () => 1 } + match () { () => 1 } | ^^^^^^^^^^^^^^^^^^^^ expected `()`, found integer | help: parentheses are required to parse this as an expression | LL | (match () { () => 1 }) + match () { () => 1 } | + + ```
2025-08-31Provide suggestion when encountering `match () { () => 1 } + match () { () ↵Esteban Küber-6/+35
=> 1 }` ``` error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:69:5 | LL | match () { () => 1 } + match () { () => 1 } | ^^^^^^^^^^^^^^^^^^^^ expected `()`, found integer | help: consider using a semicolon here | LL | match () { () => 1 }; + match () { () => 1 } | + help: alternatively, parentheses are required to parse this as an expression | LL | (match () { () => 1 }) + match () { () => 1 } | + + ``` Parentheses are needed for the `match` to be unambiguously parsed as an expression and not a statement when chaining with binops that are also unops.
2025-08-30Auto merge of #146043 - tgross35:rollup-hdumq5v, r=tgross35bors-32/+117
Rollup of 4 pull requests Successful merges: - rust-lang/rust#144964 (std: clarify `OpenOptions` error for create without write access) - rust-lang/rust#146030 (Fix `sys::process::windows::tests::test_thread_handle` spurious failure) - rust-lang/rust#146035 (Update `browser-ui-test` version to `0.21.3`) - rust-lang/rust#146036 (Use move_file for rename in tracing) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-30Rollup merge of #146036 - Mark-Simulacrum:rust-1, r=KobzolTrevor Gross-1/+5
Use move_file for rename in tracing This avoids panicking when the source and destination are on different filesystems.
2025-08-30Rollup merge of #146035 - GuillaumeGomez:update-browser-ui-test, ↵Trevor Gross-3/+3
r=GuillaumeGomez Update `browser-ui-test` version to `0.21.3` I cannot test it locally because of this bug: ``` error: couldn't generate documentation: failed to read column from disk: data consumer error: missing field `unknown number` at line 1 column 8 | = note: failed to create or modify "build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/search.index/entry/": failed to read column from disk: data consumer error: missing field `unknown number` at line 1 column 8 ``` So I'll iterate through CI checks I guess. r? ghost
2025-08-30Rollup merge of #146030 - ChrisDenton:wait-timeout, r=tgross35Trevor Gross-6/+18
Fix `sys::process::windows::tests::test_thread_handle` spurious failure Instead of sleeping, wait for the process to finish so that we can be sure it's done. We use a timeout because otherwise this test can be stuck indefinitely if it fails (unfortunately std doesn't currently have a way to wait with a timeout so a manual OS API call is necessary). I also changed the test to run `whoami` and pipe the output to null so that it doesn't clutter up the test output. Fixes rust-lang/rust#146024
2025-08-30Rollup merge of #144964 - 0xdeafbeef:fix-open-options, r=ibraheemdevTrevor Gross-22/+91
std: clarify `OpenOptions` error for create without write access Fixes rust-lang/rust#140621
2025-08-30Merge pull request #20579 from Elliot-Roberts/fix-double-target-optionChayim Refael Friedman-5/+2
fix: Avoid `--target` option being given twice to `rustc` when invoked through `cargo rustc` while fetching target data layout
2025-08-30Detect negative literal inferred to unsigned integerEsteban Küber-1/+78
``` error[E0277]: the trait bound `usize: Neg` is not satisfied --> $DIR/negative-literal-infered-to-unsigned.rs:2:14 | LL | for x in -5..5 { | ^^ the trait `Neg` is not implemented for `usize` | help: consider specifying an integer type that can be negative | LL | for x in -5isize..5 { | +++++ ```
2025-08-30More docsAlona Enraght-Moony-7/+43
2025-08-30Use absolute path to llvm-bolt, merge-fdata rather than PATHMark Rousskov-5/+15
This unconditionally uses the provided LLVM toolchain's BOLT. I'm not sure that makes sense, but since we don't build BOLT as part of Rust's build of LLVM today, it's probably the right option for now. This avoids breaking the build on not being able to find the llvm-bolt executable.
2025-08-30Start documenting tests/rustdoc-jsonAlona Enraght-Moony-2/+48
2025-08-30tidy: --bless now makes escheck run with --fixbinarycat-10/+22
2025-08-30Pass `--target` before `--` for `cargo rustc`Elliot Roberts-5/+2
2025-08-30rustdoc-search: split function inverted index by input/outputMichael Howell-67/+256
With a patch applied to count the number of unifications, and running the query `Option<T>, (T -> U) -> Option<U>` before: performed unifyFunctionType on 17484 functions after: performed unifyFunctionType on 3055 functions
2025-08-30review comment: move `Visitor`Esteban Küber-27/+29
2025-08-30Fix spurious test timeoutChris Denton-6/+18
2025-08-30Auto merge of #146029 - JonathanBrouwer:incorrect-fixme, r=jdonszelmannbors-1/+1
Remove incorrect fixme on deprecation target This does actually working suprisingly enough, applying deprecation to all methods in the impl block r? `@jdonszelmann`
2025-08-30fix: `needless_for_each` suggests wrongly with explicit closure input typesAda Alakbarova-17/+76
2025-08-30Avoid unnecessary suggestion in or-patternEsteban Küber-73/+36
2025-08-30Use move_file for rename in tracingMark Rousskov-1/+5
This avoids panicking when the source and destinations are on different filesystems.