Skip to content

Regression in doctest compile_fail detection with global_asm! #140412

Closed
@ehuss

Description

@ehuss
```rust,compile_fail
fn main() {}
core::arch::global_asm!("", in(reg) 5);
```

I expected to see this happen: This should pass rustdoc --test because the example generates an error the `in` operand cannot be used with `global_asm!`

Instead, this happened: This fails with rustdoc --test because the example is erroneously being treated as compiling successfully.

This appears to be a regression due to #140220
cc @GuillaumeGomez

Meta

rustc --version --verbose:

rustc 1.88.0-nightly (25cdf1f67 2025-04-28)
binary: rustc
commit-hash: 25cdf1f67463c9365d8d83778c933ec7480e940b
commit-date: 2025-04-28
host: x86_64-apple-darwin
release: 1.88.0-nightly
LLVM version: 20.1.2

Metadata

Metadata

Assignees

Labels

A-doctestsArea: Documentation tests, run by rustdocC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions