Skip to content

[debuginfo] Emit usize and isize as typedefs - #163104

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Walnut356:i_usize_typedef
Oct 21, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Walnut356:i_usize_typedef

Conversation

@Walnut356

@Walnut356 Walnut356 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

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

@rustbot rustbot added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Sep 21, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 21, 2026
@rustbot

rustbot commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 18 candidates

@chenyukang

Copy link
Copy Markdown
Member

@rustbot reroll

@rustbot rustbot assigned mati865 and unassigned chenyukang Sep 25, 2026
@Walnut356

Copy link
Copy Markdown
Contributor Author

(#163098 means i need to modify the tests again before this gets merged)

@mati865 mati865 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply and thanks for the fix. r=me once rebased

View changes since this review

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@mati865

mati865 commented Oct 20, 2026

Copy link
Copy Markdown
Member

Sorry, I missed the rebase.

@bors r+

@rust-bors

rust-bors Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 0370417 has been tentatively approved by mati865

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 20, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 20, 2026
[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
```
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)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 20, 2026
[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
```
rust-bors Bot pushed a commit that referenced this pull request Oct 20, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #163575 (core: Add examples and assembly tests for `abort_immediate`)
 - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - #163338 (MIR move elimination [4/6]: MoveElimination)
 - #163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - #164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - #164578 (Don't ignore unknown LLVM diagnostics)
 - #164611 (Improve bit permutation codegen)
 - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - #162668 (document that `!` does bitwise and logical negation)
 - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - #164509 (layout invariant: turn delayed bug back into proper assertion)
 - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 20, 2026
[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
```
rust-bors Bot pushed a commit that referenced this pull request Oct 20, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - #163338 (MIR move elimination [4/6]: MoveElimination)
 - #163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - #164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - #164578 (Don't ignore unknown LLVM diagnostics)
 - #164611 (Improve bit permutation codegen)
 - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - #162668 (document that `!` does bitwise and logical negation)
 - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - #164509 (layout invariant: turn delayed bug back into proper assertion)
 - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
rust-bors Bot pushed a commit that referenced this pull request Oct 20, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - #163338 (MIR move elimination [4/6]: MoveElimination)
 - #163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - #164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - #164578 (Don't ignore unknown LLVM diagnostics)
 - #164611 (Improve bit permutation codegen)
 - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - #162668 (document that `!` does bitwise and logical negation)
 - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - #164509 (layout invariant: turn delayed bug back into proper assertion)
 - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 20, 2026
[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
```
rust-bors Bot pushed a commit that referenced this pull request Oct 20, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - #163338 (MIR move elimination [4/6]: MoveElimination)
 - #163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - #164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - #164611 (Improve bit permutation codegen)
 - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - #148842 (Avoid incorrect lifetime suggestion involving `sym::anon`)
 - #162668 (document that `!` does bitwise and logical negation)
 - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - #164509 (layout invariant: turn delayed bug back into proper assertion)
 - #164540 (Minor optimizations around macro parsing)
 - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - #164595 (Allow attributes in function trait parameters)
 - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 20, 2026
[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
```
rust-bors Bot pushed a commit that referenced this pull request Oct 20, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - #163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - #164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - #164611 (Improve bit permutation codegen)
 - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - #148842 (Avoid incorrect lifetime suggestion involving `sym::anon`)
 - #162668 (document that `!` does bitwise and logical negation)
 - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - #164509 (layout invariant: turn delayed bug back into proper assertion)
 - #164540 (Minor optimizations around macro parsing)
 - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - #164595 (Allow attributes in function trait parameters)
 - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
rust-bors Bot pushed a commit that referenced this pull request Oct 20, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - #163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - #164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - #164611 (Improve bit permutation codegen)
 - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - #148842 (Avoid incorrect lifetime suggestion involving `sym::anon`)
 - #162668 (document that `!` does bitwise and logical negation)
 - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - #164509 (layout invariant: turn delayed bug back into proper assertion)
 - #164540 (Minor optimizations around macro parsing)
 - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - #164595 (Allow attributes in function trait parameters)
 - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 20, 2026
[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
```
rust-bors Bot pushed a commit that referenced this pull request Oct 20, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - #163668 (Remap syntax contexts and expansion ids for det. metadata encoding)
 - #160404 (fd-views: AsRef<File>&Co. for BorrowedFd)
 - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - #163317 (Stop useless caching of post-LTO artifact caching for fat LTO)
 - #163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - #164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - #164507 (Encode HashMap and HashSet in deterministic order when an encoder requires determinism)
 - #164611 (Improve bit permutation codegen)
 - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - #148842 (Avoid incorrect lifetime suggestion involving `sym::anon`)
 - #162668 (document that `!` does bitwise and logical negation)
 - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - #164509 (layout invariant: turn delayed bug back into proper assertion)
 - #164540 (Minor optimizations around macro parsing)
 - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - #164595 (Allow attributes in function trait parameters)
 - #164641 (Stabilize `slice_split_once`)
 - #164646 (Adjust rustfmt subtree sync docs to not use `--allow-noop` for now)
rust-bors Bot pushed a commit that referenced this pull request Oct 21, 2026
Rollup of 20 pull requests

Successful merges:

 - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - #163668 (Remap syntax contexts and expansion ids for det. metadata encoding)
 - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - #163317 (Stop useless caching of post-LTO artifact caching for fat LTO)
 - #163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - #164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - #164507 (Encode HashMap and HashSet in deterministic order when an encoder requires determinism)
 - #164611 (Improve bit permutation codegen)
 - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - #148842 (Avoid incorrect lifetime suggestion involving `sym::anon`)
 - #162668 (document that `!` does bitwise and logical negation)
 - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - #164509 (layout invariant: turn delayed bug back into proper assertion)
 - #164540 (Minor optimizations around macro parsing)
 - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - #164595 (Allow attributes in function trait parameters)
 - #164616 (Add test for VecDeque with a custom allocator)
 - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
 - #164641 (Stabilize `slice_split_once`)
 - #164646 (Adjust rustfmt subtree sync docs to not use `--allow-noop` for now)
@rust-bors
rust-bors Bot merged commit 0baf5fb into rust-lang:main Oct 21, 2026
14 checks passed
rust-bors Bot pushed a commit that referenced this pull request Oct 21, 2026
Rollup merge of #163104 - Walnut356:i_usize_typedef, r=mati865

[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
```
@rustbot rustbot added this to the 1.101.0 milestone Oct 21, 2026
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Oct 22, 2026
Rollup of 20 pull requests

Successful merges:

 - rust-lang/rust#163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - rust-lang/rust#163668 (Remap syntax contexts and expansion ids for det. metadata encoding)
 - rust-lang/rust#163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - rust-lang/rust#163317 (Stop useless caching of post-LTO artifact caching for fat LTO)
 - rust-lang/rust#163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - rust-lang/rust#164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - rust-lang/rust#164507 (Encode HashMap and HashSet in deterministic order when an encoder requires determinism)
 - rust-lang/rust#164611 (Improve bit permutation codegen)
 - rust-lang/rust#164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - rust-lang/rust#148842 (Avoid incorrect lifetime suggestion involving `sym::anon`)
 - rust-lang/rust#162668 (document that `!` does bitwise and logical negation)
 - rust-lang/rust#164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - rust-lang/rust#164509 (layout invariant: turn delayed bug back into proper assertion)
 - rust-lang/rust#164540 (Minor optimizations around macro parsing)
 - rust-lang/rust#164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - rust-lang/rust#164595 (Allow attributes in function trait parameters)
 - rust-lang/rust#164616 (Add test for VecDeque with a custom allocator)
 - rust-lang/rust#164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
 - rust-lang/rust#164641 (Stabilize `slice_split_once`)
 - rust-lang/rust#164646 (Adjust rustfmt subtree sync docs to not use `--allow-noop` for now)
jieyouxu pushed a commit to jieyouxu/rustfmt that referenced this pull request Oct 22, 2026
Rollup of 20 pull requests

Successful merges:

 - rust-lang/rust#163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - rust-lang/rust#163668 (Remap syntax contexts and expansion ids for det. metadata encoding)
 - rust-lang/rust#163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - rust-lang/rust#163317 (Stop useless caching of post-LTO artifact caching for fat LTO)
 - rust-lang/rust#163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - rust-lang/rust#164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - rust-lang/rust#164507 (Encode HashMap and HashSet in deterministic order when an encoder requires determinism)
 - rust-lang/rust#164611 (Improve bit permutation codegen)
 - rust-lang/rust#164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - rust-lang/rust#148842 (Avoid incorrect lifetime suggestion involving `sym::anon`)
 - rust-lang/rust#162668 (document that `!` does bitwise and logical negation)
 - rust-lang/rust#164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - rust-lang/rust#164509 (layout invariant: turn delayed bug back into proper assertion)
 - rust-lang/rust#164540 (Minor optimizations around macro parsing)
 - rust-lang/rust#164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - rust-lang/rust#164595 (Allow attributes in function trait parameters)
 - rust-lang/rust#164616 (Add test for VecDeque with a custom allocator)
 - rust-lang/rust#164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
 - rust-lang/rust#164641 (Stabilize `slice_split_once`)
 - rust-lang/rust#164646 (Adjust rustfmt subtree sync docs to not use `--allow-noop` for now)
programskillforverification pushed a commit to programskillforverification/miri that referenced this pull request Oct 22, 2026
Rollup of 20 pull requests

Successful merges:

 - rust-lang/rust#163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests)
 - rust-lang/rust#163668 (Remap syntax contexts and expansion ids for det. metadata encoding)
 - rust-lang/rust#163104 ([debuginfo] Emit `usize` and `isize` as typedefs)
 - rust-lang/rust#163317 (Stop useless caching of post-LTO artifact caching for fat LTO)
 - rust-lang/rust#163701 (add ReadDir::dir to get the directory handle of the underlying directory)
 - rust-lang/rust#164488 (Don't try to skip anything in `Skip::advance_by(0)`)
 - rust-lang/rust#164507 (Encode HashMap and HashSet in deterministic order when an encoder requires determinism)
 - rust-lang/rust#164611 (Improve bit permutation codegen)
 - rust-lang/rust#164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`)
 - rust-lang/rust#148842 (Avoid incorrect lifetime suggestion involving `sym::anon`)
 - rust-lang/rust#162668 (document that `!` does bitwise and logical negation)
 - rust-lang/rust#164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons)
 - rust-lang/rust#164509 (layout invariant: turn delayed bug back into proper assertion)
 - rust-lang/rust#164540 (Minor optimizations around macro parsing)
 - rust-lang/rust#164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules)
 - rust-lang/rust#164595 (Allow attributes in function trait parameters)
 - rust-lang/rust#164616 (Add test for VecDeque with a custom allocator)
 - rust-lang/rust#164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
 - rust-lang/rust#164641 (Stabilize `slice_split_once`)
 - rust-lang/rust#164646 (Adjust rustfmt subtree sync docs to not use `--allow-noop` for now)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants