Commit Graph

195 Commits

Author SHA1 Message Date
Adwin White
10e95f40c5 disable some tests for ohos target 2026-08-11 14:13:19 +08:00
Jonathan Brouwer
103f5d6831 Rollup merge of #159834 - Walnut356:ptr_str, r=Mark-Simulacrum
Apply str debugger visualizer to `*const str`, `*mut str` and `Box<str>`

Fairly straightforward. Note that the MSVC changes very likely aren't exercised by CI. My GSoC project is actively working on fixing that, but in the meantime i can personally verify that it works (note that the `ref$<str$> *` type name confirms this is MSVC):

<img width="318" height="138" alt="image" src="https://github.com/user-attachments/assets/fd868f16-d9a5-438a-a155-a429771bf525" />
2026-08-08 22:16:45 +02:00
Walnut
64f6b622ac add lldb-repr check logic 2026-07-25 05:26:07 -05:00
Walnut
69edf45897 apply str visualizer to *const, *mut and Box<str> 2026-07-24 07:11:05 -05:00
Jonathan Brouwer
f2d833478f Rollup merge of #159215 - Walnut356:lldb_vers, r=Kobzol,jieyouxu
[compiletest] Differentiate between LLVM LLDB and Apple LLDB

This patch causes `compiletest` to treat LLVM and Apple LLDB versions uniquely, including modified `min-version` directives. We'll need this level of granularity going forward:

* rust-lang/rust#158298 requires LLVM LLDB `22.1.x`. Currently, `compiletest` only cares about major versions.
* @jieyouxu's efforts to [pin debugger versions](https://github.com/rust-lang/compiler-team/issues/1012)

Any tests that specified `min-lldb-version` have been updated to equivalent `min-apple-lldb-version` and `min-llvm-lldb-version` directives to preserve existing test filters.

r? @Kobzol, @jieyouxu
2026-07-19 17:04:33 +02:00
Walnut
785c42b4a8 differentiate between LLVM LLDB and Apple LLDB 2026-07-16 21:10:15 -05:00
Jieyou Xu
810a7aa41f tests: gate tests/deubinfo/function-call.rs on min GDB 15.1
See RUST-159073, this test has been flaky with

```
/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/function-call.gdb/function-call.debugger.script:11: Error in sourced command file:
Couldn't write extended state status: Bad address.
```

on linux CI jobs under various environments and hosts/targets. I tried
running this under GDB 15.1 locally (WSL, `x86_64-unknown-linux-gnu`)
but could not reproduce. CI typically uses GDB 12.1 with Ubuntu 22.04.
So gate this test with min GDB 15.1 which prevents it from running in CI
to workaround the flakiness but still allow running it locally under
GDB >= 15.1.

It's *possible* there's a genuine problem here.
2026-07-17 00:17:09 +08:00
Jieyou Xu
85f2c700f9 tests: only run lexical-scope-in-match.rs for LLDB >= 21 2026-06-30 09:19:47 +08:00
Jonathan Brouwer
3a29576be2 Rollup merge of #153238 - shua:lldb-rcstr, r=davidtwco
debuginfo: slices are DW_TAG_array_type's

Rust debuginfo for unsized structs with embedded slice types is lacking, and it makes it difficult for debuggers to correctly print types like `Rc<str>` (eg rust-lang/rust#114195). Specifically, these three structs would have essentially the same debug info (modulo some names):
```rust
struct Foo { a: u32, s: str } // unsized
struct Bar { a: u32, s: [u8] } // unsized
struct Baz { a: u32, s: u8 }
```

This changes how the compiler generates debuginfo in this case, and I used existing compilers (gcc, clang) handling of C flexible member arrays as a reference.
2026-06-12 20:40:46 +02:00
Jieyou Xu
d5435fceb2 Disable tests/debuginfo/pretty-std.rs OsString cdb check
Since approx. Windows SDK 20348, the corresponding cdb (and/or its
underlying WinDbg engine) changed or regressed the `OsStr`/`OsString`
visualization, and no longer renders the emoji. Since approx. SDK/cdb
26100, the output formatting of the string containing UTF-8 (i.e. the
multi-byte emoji grapheme) seems to have further regressed (e.g. the end
quotation mark is no longer shown and command output becomes garbled).

Relevant issues:

* RUST-88840
* RUST-148743
* RUST-88796
2026-06-06 03:16:59 +08:00
bors
4f84d9fac4 Auto merge of #157234 - Walnut356:test_package, r=jieyouxu
Convert `lldb_batchmode` to a package

The new testing logic for https://github.com/rust-lang/rust/issues/148483 will end up being a couple of python files, and it doesn't make sense to have them all as freefloating scripts in `src/etc`. 

I also made sure to update occurrences of `lldb_batchmode.py` in the code and documentation to point to the new package instead.
2026-06-02 02:00:45 +00:00
Walnut
c191595d37 convert lldb_batchmode to a package 2026-06-01 01:51:55 -05:00
Walnut
d1d26f096c update tests w/ new struct summary 2026-06-01 00:57:56 -05:00
shua
3914f38be2 adding debuginfo tests for str repr llvm di 2026-05-28 23:29:35 +02:00
Jieyou Xu
a6361c8127 Disable tests/debuginfo/numeric-types.rs v nz_{i,u}size checks
On lldb 22 (locally lldb 22.1.6) I see

```
v nz_isize
error: Invalid type: Cannot determine size
[...]
v nz_usize
error: Invalid type: Cannot determine size
```

AFAICT this might be an upstream issue, as reported in
<https://github.com/llvm/llvm-project/issues/196812>. Let's disable for
now to not have `./x test` fail for contributors using lldb 22.
2026-05-24 20:09:10 +02:00
fallofpheonix
6ed5bf2f52 Remove po checks from debuginfo path test 2026-05-24 00:43:32 +05:30
fallofpheonix
d4e4f9a0ee Use print instead of po in debuginfo path test 2026-05-20 14:20:48 +05:30
shua
31ce9e781d debuginfo: slices are DW_TAG_array_type's 2026-05-16 10:23:01 +02:00
Oli Scherer
8882bf04b7 Remove rustc_layout_scalar_valid_range attr from debuginfo 2026-05-03 10:59:52 +02:00
Nicholas Nethercote
d944ea10e6 Remove WithCachedTypeInfo::stable_hash.
We store a stable hash value in the most common interned values (e.g.
types, predicates, regions). This is 16 bytes of data.

- In non-incremental builds it's a straightforward performance loss: the
  stable hash isn't computed or used, and the 16 bytes of space goes to
  waste (but it still gets hashed when interning).

- In incremental builds it avoids some hashing but doesn't seem to
  actually be a genuine performance win, and the complexity doesn't seem
  worth it.
2026-04-23 12:13:19 +10:00
Martin Nordholts
98242676d9 tests/debuginfo/basic-stepping.rs: Remove FIXME related to ZSTs
We don't consider it a bug that users can't break on initialization of
some non-zero sized types (see comment on `maximally-steppable` at the
top of the file), so it does not make sense to consider it a bug that
users can't break on initialization of some zero-sized types.
2026-04-16 06:05:12 +02:00
Jonathan Brouwer
978fb762ac Rollup merge of #153941 - Enselic:fully-steppable, r=saethlin
tests/debuginfo/basic-stepping.rs: Explain why all lines are not steppable

Some optimization passes [_improve_](https://github.com/rust-lang/compiler-team/issues/319) compile times. So we want to run some passes even with `-Copt-level=0`. That means that some debuggable lines can be optimized away. Document that as expected behavior.

Closes https://github.com/rust-lang/rust/issues/33013.

Replaces https://github.com/rust-lang/rust/pull/151426. See that PR for some discussion.
2026-04-13 20:20:00 +02:00
León Orell Valerian Liehr
357f670fde Rename #[rustc_layout] to #[rustc_dump_layout] 2026-04-10 12:13:48 +02:00
Walnut
3c52bb5527 directly point to tuple summary 2026-04-02 09:44:38 -05:00
Walnut
eca09dedef fix tests 2026-03-31 05:01:25 -05:00
Martin Nordholts
686ddd3e2e tests/debuginfo/basic-stepping.rs: Explain why all lines are not steppable
Some optimization passes _improve_ compile times [1]. So we want to run
some passes even with `-Copt-level=0`. That means that some of the lines
in the test can be optimized away. To make regression testing more
robust, we also want to run the test with such passes disabled. The
solution is to use two revisions. One with default `-Copt-level=0`
passes, and one "even less optimized", with enough optimization passes
disabled to keep the maximum number of lines steppable.

[1]: https://github.com/rust-lang/compiler-team/issues/319
2026-03-16 18:39:40 +01:00
Martin Nordholts
a27fdfbf01 tests/debuginfo/basic-stepping.rs: Remove ignore-aarch64
It works now.
2026-03-14 18:24:49 +01:00
Martin Nordholts
17c079625c tests/debuginfo/basic-stepping.rs: Add cdb test 2026-03-14 06:46:57 +01:00
Martin Nordholts
512d5fd676 tests/debuginfo/basic-stepping.rs: Add lldb test
Also move the FIXME to the source code to avoid duplication, and also
suppress harmless warnings that are annoying when you compile manually.
2026-03-12 20:30:21 +01:00
Jonathan Brouwer
77658bcda3 Rollup merge of #152593 - spirali:valtreekind-list, r=lcnr
Box in `ValTreeKind::Branch(Box<[I::Const]>)` changed to `List`

This is related to trait system refactoring. It fixes the FIXME in `ValTreeKind`

```
   // FIXME(mgca): Use a `List` here instead of a boxed slice
    Branch(Box<[I::Const]>),
```

It introduces `Interner::Consts`, changes `Branch(Box<[I::Const]>)` to `Branch(I::Consts)`, and updates all relevant places.

r? lcnr
2026-03-06 18:49:47 +01:00
joboet
88cec3a1c0 update debuginfo visualizers and tests 2026-03-02 11:57:03 +01:00
Makai
b6083435d8 implement debuginfo for unsafe binders 2026-02-23 23:32:56 +08:00
Ada Bohm
14b3a40c2d Test updated 2026-02-23 15:17:01 +01:00
Keith-Cancel
73a991fb9d Allow provisional mgca syntax of type const <IDENT> = <EXPR> to be reconized.
Revert, but without type const.

Update symbol for feature err, then update suggestion output, and lastly update tests that change because of those.

Update these new tests with the correct syntax, and few existing tests with the new outputs the merge with main added.

Fix for tidyfmt and some errors when manually resolving a merge conflicts.

Update these tests to use update error messages and type const syntax.

Update comments and error message to use new syntax instead of old type_const attribute.

Remove the type_const attribute

update some more tests to use the new syntax.

Update these test cases.

update feature gate test

Change gate logic for `mgca_type_const_syntax` to work also if `min_generic_const_args` is enabled.

Create a new feature gate that checks for the feature before expansion.

Make rustfmt handle the `type const` syntax correctly.

Add a convience method to check if a RhsKind is type const.

Rename `Const` discriminant to `Body` for `ConstItemRhsKind`

Give the `TraitItemKind` flag an enum instead of a simple bool to better describe what the flag is for.

Update formatting for these match statements.

Update clippy test to use type const syntax.

Update test to use type const syntax.

update rustfmt to match ast items.

Update clippy to match ast and hir items.

Few more test cases that used old attribute, instead of 'type const'

Update to match the output from the feature gate checks.

tidyfmt adjustments.

Update the is_type_const, so I can constrain record!(..) in encoder.rs

Update conditional compilation test.

Move the feature gate to after expansion to allow for cfg(...) to work.

Update some more tests to use the new syntax.

Update type const tests in associated-const-bindings to use new syntax.

Don't check based off the attribute, but the item here.

Update some tests outside of the const_generics folder that were using #[type_const]

update the tests in associated consts that use #[type_const] to use type const

Update these mgca tests with the type const syntax.

Add a flag to TraitItemKind for detecting type const for now. Maybe later change ItemConstRhs to have optional consts but that touches a lot more lines of code.

Don't need into for these now that it's a query.

Add is_type_const query to handle foreign def ids.

update this test to use type const syntax.

Fix logic here, we only want to lower if there is expression in this case.

Update built-in macros to use ConstItemRhsKind

Update more instance of the old ConstItemRhs.

Rename ConstItemKind to ConstItemRhsKind, I noticed there is a typed called ConstantItemKind, so add the Rhs to the name to avoid confusion.

Update lower to use ConstItemKind

Add an other helper method to check if the rhs kinda has an expr.

Update item parse to use ConstItemKind enum.

Felt the field name could a be little clear when editing a few other things.

Change the ConstItem struct see know if we have a type const or regular const.

Make sure this syntax is properly feature gated.
2026-02-09 07:59:24 -08:00
Jubilee Young
2b0cce040d Ignore all debuginfo tests for LLDB that we do not run in CI
We only run LLDB 1500 in CI. Any test with a min-lldb-version above that
is currently ignored. It's not clear any of these tests actually work
with that LLDB version, and they definitely don't work on LLDB ~2100.
So, ignore them until we fix debuginfo testing.
2026-02-02 18:13:43 -08:00
bors
b765963267 Auto merge of #150843 - fmease:dyn-ace, r=BoxyUwU
mGCA: Make trait object types with type-level associated consts dyn compatible

Under feature `min_generic_const_args` (mGCA) (rust-lang/rust#132980), render traits with non-parametrized type-level associated constants (i.e., `#[type_const]` ones) dyn compatible but force the user to specify all type-level associated consts in the trait object type via bindings (either directly, via supertrait bounds and/or behind trait aliases) just like associated types, their sibling.

Fixes rust-lang/rust#130300 (feature request).
Fixes rust-lang/rust#136063 (bug).
Fixes rust-lang/rust#137260 (bug).
Fixes rust-lang/rust#137514 (bug).

While I'm accounting for most illegal `Self` references via const projections & params, I'm intentionally ignoring RUST-123140 (and duplicates) in this PR which is to be tackled some other time.

Additional context: Crate `rustc-demangle` had to be updated to fix v0 demangling. I've patched it in PR https://github.com/rust-lang/rustc-demangle/pull/87 which was was released in version 0.1.27 via PR https://github.com/rust-lang/rustc-demangle/pull/88.
2026-01-22 01:56:41 +00:00
León Orell Valerian Liehr
558a59258e Support debuginfo for assoc const bindings 2026-01-21 18:52:08 +01:00
Jonathan Brouwer
74ff006ce6 Rollup merge of #147426 - Enselic:better-stepping, r=saethlin
tests/debuginfo/basic-stepping.rs: Add revisions `default-mir-passes`, `no-SingleUseConsts-mir-pass`

To prevent regressions our test must cover the code both inside and outside of the `SingleUseConsts` MIR pass. Use revisions for that.

We know this use case is sensitive to regressions because it already happened at least once. See https://github.com/rust-lang/rust/issues/33013#issuecomment-3121579216.

CC https://github.com/rust-lang/rust/issues/130896
2026-01-21 16:39:39 +01:00
dianqk
5769006794 Run dummy_span.rs test with SimplifyComparisonIntegral 2026-01-14 18:57:17 +08:00
Martin Nordholts
622572f6df tests/debuginfo/basic-stepping.rs: Add revisions default-mir-passes, no-SingleUseConsts-mir-pass
To prevent regressions our test must cover the code both inside and
outside of the `SingleUseConsts` MIR pass. Use revisions for that.
2026-01-05 08:08:52 +01:00
Martin Nordholts
de505d24db tests/debuginfo/basic-stepping.rs: Don't mix compile-flags with ignore-*
We want directives nice and tidy.
2026-01-05 08:08:03 +01:00
Martin Nordholts
423a8dc409 tests/debuginfo/macro-stepping.rs: Add revisions default-mir-passes, no-SingleUseConsts-mir-pass
To prevent the test from regressing both with and without
`SingleUseConsts` MIR pass.
2025-12-23 15:33:56 +01:00
Martin Nordholts
b7a0f84a5a tests/debuginfo/function-arg-initialization.rs: Stop disabling SingleUseConsts MIR pass 2025-12-20 20:35:30 +01:00
Ralf Jung
18af84b138 debuginfo/macro-stepping test: extend comments 2025-12-01 22:32:36 +01:00
joboet
c22b819952 update type names in debuginfo tests 2025-11-29 15:59:11 +01:00
Orson Peters
492fbc56c1 Update debuginfo test from Global to System 2025-11-28 23:35:38 +01:00
Martin Nordholts
5b57d02e9f compiletest: Use //@ prefixes also for debuginfo test directives
So that when we later add support for revisions we can use the same
syntax for revisions as elsewhere.

This also prevents people from making typos for commands since
`src/tools/compiletest/src/directives/directive_names.rs` will catch such
typos now.

Note that we one FIXME for a non-trivial change for later:
```
// FIXME(148097): Change `// cdb-checksimple_closure` to `//@ cdb-check:simple_closure`
```
2025-11-25 06:13:45 +01:00
Walnut
af1c2b277d update tests 2025-11-24 00:17:53 -06:00
David Wood
ff00110543 sess: default to v0 symbol mangling
Rust's current mangling scheme depends on compiler internals; loses
information about generic parameters (and other things) which makes for
a worse experience when using external tools that need to interact with
Rust symbol names; is inconsistent; and can contain `.` characters
which aren't universally supported. Therefore, Rust has defined its own
symbol mangling scheme which is defined in terms of the Rust language,
not the compiler implementation; encodes information about generic
parameters in a reversible way; has a consistent definition; and
generates symbols that only use the characters `A-Z`, `a-z`, `0-9`, and
`_`.

Support for the new Rust symbol mangling scheme has been added to
upstream tools that will need to interact with Rust symbols (e.g.
debuggers).

This commit changes the default symbol mangling scheme from the legacy
scheme to the new Rust mangling scheme.

Signed-off-by: David Wood <david.wood@huawei.com>
2025-11-19 11:55:09 +00:00
Martin Nordholts
5ad2f434dc rustc_codegen_llvm: Require opt-level >= 1 for index-based loop
To make debugger stepping intuitive with `-Copt-level=0`. See the
adjusted `basic-stepping.rs` test.

This is kind of a revert of bd0aae92dc, except we don't revert it,
we just make it conditional on `opt-level`. That commit regressed
`basic-stepping.rs`, but it was not noticed since that test did not
exist back then. I have retroactively bisected to find that out.

It seems messy to sprinkle if-cases inside of the
`write_operand_repeatedly()` so make the whole function conditional.

The test that bd0aae92dc added in
`tests/codegen/issues/issue-111603.rs` already use `-Copt-level=3`, so
we don't need to adjust the compiler flags for it to keep passing.
2025-11-13 06:29:55 +01:00