Repository navigation
Rollup of 6 pull requests - #164630
Closed
JonathanBrouwer wants to merge 20 commits into
Closed
Rollup of 6 pull requests#164630JonathanBrouwer wants to merge 20 commits into
JonathanBrouwer wants to merge 20 commits into
Conversation
If we try to eagerly process our skip count, we might see the end of the inner iterator. `Iterator::advance_by` is supposed to return a non-zero `Err` count when exhausted, but there's no room for `Skip` to report anything in this case. So, it's better that we don't even try.
Rust currently ignores LLVM diagnostic kinds that it does not know about. This means that we sometimes ignore error diagnostics, which can then result in silent miscompiles. This exposes `LLVMGetDiagInfoSeverity` returning `DiagnosticSeverity`, renamed from `DiagnosticLevel` to match LLVM terminology. Custom code to fetch the diagnostic severity for inline asm diagnostics can then be dropped. For unknown diagnostics, we emit a warning/error depending on severity. Notes and remarks continue to be ignored. One oddity I ran into along the way is that the linker diagnostic has severity error, but we only report a warning. I've kept this for now as we still error down the line and this ends up providing a bit more information (which file the duplicate symbol originates from).
Merge the PGO, Unsupported into UnknownDiagnostic and rename it to Other. We don't do anything special for them, so there is no need to represent them differently.
[debuginfo] Emit `usize` and `isize` as typedefs See: llvm/llvm-project#196812 TL;DR sidesteps a name collision issue that affects generics, e.g. `S<u64>` and `S<usize>` resolving as the same type. This is accomplished by wrapping an existing primitive node in a `usize`/`isize` typedef instead. I'd love to output typedefs for all the primitive types too, so LLDB displays the type names rust-style, but I've got a couple worries with that. Firstly, GDB doesn't seem to like it w.r.t. enums? IIRC it's because of a small difference in how GDB treats typedefs compared to LLDB. I'm like 80% sure it's hard-coded in GDB itself, so it's not something I want to touch atm. ``` Breakpoint 1, borrowed_enum::main () at tests/debuginfo/borrowed-enum.rs:67 67 zzz(); // #break $1 = <error reading variable: Could not find active enum variant> $2 = borrowed_enum::ABC::TheB(0, 286331153, 286331153) $3 = borrowed_enum::Univariant::TheOnlyCase(4820353753753434) ``` Secondly, I'm not entirely sure it's a good idea to have both a type and a typedef with the exact same name in the first place. I could easily imagine that causing some similar issues to the one we're trying to solve. This also includes a small extention to the `Rc` test to ensure we can read both `Rc<u64>` and `Rc<usize>`. Without this change, the second `v` command would fail to materialize any value: ``` ... (lldb) v rc_u64 (alloc::rc::Rc<unsigned long, alloc::alloc::Global>) rc_u64 = strong=1, weak=0 { value = 10 } (lldb) v rc_usize error: Invalid type: Cannot determine size (lldb) quit ```
Don't try to skip anything in `Skip::advance_by(0)` If we try to eagerly process our skip count, we might see the end of the inner iterator. `Iterator::advance_by` is supposed to return a non-zero `Err` count when exhausted, but there's no room for `Skip` to report anything in this case. So, it's better that we don't even try. Fixes rust-lang#164480
Don't ignore unknown LLVM diagnostics Rust currently ignores LLVM diagnostic kinds that it does not know about. This means that we sometimes ignore error diagnostics, which can then result in silent miscompiles. This exposes `LLVMGetDiagInfoSeverity` returning `DiagnosticSeverity`, renamed from `DiagnosticLevel` to match LLVM terminology. Custom code to fetch the diagnostic severity for inline asm diagnostics can then be dropped. For unknown diagnostics, we emit a warning/error depending on severity. Notes and remarks continue to be ignored. One oddity I ran into along the way is that the linker diagnostic has severity error, but we only report a warning. I've kept this for now as we still error down the line and this ends up providing a bit more information (which file the duplicate symbol originates from). Fixes rust-lang#146393.
Improve bit permutation codegen This PR allows AArch64 use `usra` to improves bit permutation codegen for `extract_bits`. For `extract_bits`, `(x ^ q) ^ (q >> n)` is equivalent to `(x & !masks[stage]) + (q >> n)`, since `q >> n` and `x ^ q` have no overlapping set bits. - `extract_bits` benchmarks Type | Mask | AArch64 XOR | AArch64 Add | Change -- | -- | -- | -- | -- u8 | constant | 102.64 | 49.74 | -51.54% u8 | invariant | 108.00 | 82.32 | -23.78% u8 | variable | 408.10 | 378.12 | -7.35% u16 | constant | 150.31 | 90.10 | -40.06% u16 | invariant | 176.41 | 126.84 | -28.10% u16 | variable | 692.12 | 619.49 | -10.49% u32 | constant | 201.93 | 131.06 | -35.10% u32 | invariant | 228.70 | 167.32 | -26.84% u32 | variable | 1022.22 | 1001.70 | -2.01% u64 | constant | 259.48 | 187.71 | -27.66% u64 | invariant | 288.77 | 211.51 | -26.75% u64 | variable | 1463.05 | 1413.12 | -3.41% u128 | constant | 331.50 | 331.50 | 0.00% u128 | invariant | 411.30 | 411.29 | -0.00% u128 | variable | 1489.14 | 1489.19 | +0.00%
…Titor document that `!` does bitwise and logical negation The documentation summary for `core::ops::Not` says that it performs logical negation. That's misleading because it also performs bitwise negation on integers. Since C has separate operators for logical and bitwise negation, this could lead a C programmer to look elsewhere for Rust's equivalent of `~`. I also updated the documentation for `Not::not()` to clarify the meaning of logical not vs bitwise not.
…=jieyouxu lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons Fixes rust-lang#164143 ### about this bug `invalid_nan_comparisons` turned `b != &f64::NAN` into `b.is_nan()`. That is fine for something like `3.3f32` or `let x: f64 = 3.3`, but not for type unannotated `let b = &3.3`; the comparison is what makes `{float}` into `f64`, and after the edit `.is_nan()` does not resolve. Same for `let mut`. ### lint behaviors after this fix - If the operand is a float, the suggestion is `<Type>::is_nan(...)`, using the NAN constant's type and adding dereferences and parentheses as needed; - Preserve the original type path or alias. For macro-generated f32/f64 constants, use an absolute primitive path through `std` or `core`; - If it is not a float, or a safe replacement cannot be constructed, only keep the help text. I decide to use the type-qualified form even for suffixed or explicitly typed operands. `.is_nan()` can work in those cases, but the resolved type alone does not tell us whether removing the comparison preserves inference. Using one form avoids incomplete initializer heuristics. `<Type>::` also ensures the reused path is interpreted as a type, avoiding ambiguity with modules. ### llm disclosure The LLM (specifically, Grok 4.7 and GPT 6.1 Sol) was used for: - help me find out what HIR or AST feature can be used to distinguish unsuffixed float - draft the initial naive fix reference before I hand written & review the code - help me improve the ui test case edge case coverage
Member
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 20, 2026
Rollup of 6 pull requests try-job: dist-various-1 try-job: test-various try-job: test-x86_64-gnu-aux try-job: test-x86_64-msvc-1 try-job: test-aarch64-apple-1 try-job: test-aarch64-apple-2 try-job: test-x86_64-mingw-1 try-job: test-i686-msvc try-job: test-armhf-gnu try-job: test-x86_64-gnu-llvm-22-3
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 20, 2026
…uwer Rollup of 6 pull requests Successful merges: - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - #164488 (Don't try to skip anything in `Skip::advance_by(0)`) - #164578 (Don't ignore unknown LLVM diagnostics) - #164611 (Improve bit permutation codegen) - #162668 (document that `!` does bitwise and logical negation) - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 47c5889 failed: CI. Failed job:
|
Contributor
|
This pull request was unapproved due to being closed. |
Member
Author
|
@bors treeclosed=5 spurious failures |
Contributor
|
Tree closed for PRs with priority less than 5. |
This was referenced Oct 20, 2026
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
usizeandisizeas typedefs #163104 ([debuginfo] Emitusizeandisizeas typedefs)Skip::advance_by(0)#164488 (Don't try to skip anything inSkip::advance_by(0))!does bitwise and logical negation #162668 (document that!does bitwise and logical negation)fXX::is_nanfor unsuffixed NaN comparisons #164264 (lint: suggestfXX::is_nanfor unsuffixed NaN comparisons)r? @ghost
Create a similar rollup