Skip to content

Regression in doctest compile_fail detection with global_asm! #140412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ehuss opened this issue Apr 28, 2025 · 0 comments · Fixed by #140420
Closed

Regression in doctest compile_fail detection with global_asm! #140412

ehuss opened this issue Apr 28, 2025 · 0 comments · Fixed by #140420
Assignees
Labels
A-doctests Area: Documentation tests, run by rustdoc C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ehuss
Copy link
Contributor

ehuss commented Apr 28, 2025

```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
@ehuss ehuss added C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 28, 2025
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 28, 2025
@fmease fmease self-assigned this Apr 28, 2025
@fmease fmease added A-doctests Area: Documentation tests, run by rustdoc and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 28, 2025
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Apr 29, 2025
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue May 1, 2025
…=GuillaumeGomez

rustdoc: Fix doctest heuristic for main fn wrapping

Fixes rust-lang#140412 which regressed in rust-lang#140220 that I reviewed. As mentioned in rust-lang#140220 (comment), at the time I didn't have the time to re-review its latest changes and should've therefore invalided my previous "r=me" and blocked the PR on another review given the fragile nature of the doctest impl. This didn't happen which is my fault.

Contains some other small changes. Diff best reviewed modulo whitespace.
r? `@GuillaumeGomez`
VlaDexa added a commit to VlaDexa/rust that referenced this issue May 2, 2025
…=GuillaumeGomez

rustdoc: Fix doctest heuristic for main fn wrapping

Fixes rust-lang#140412 which regressed in rust-lang#140220 that I reviewed. As mentioned in rust-lang#140220 (comment), at the time I didn't have the time to re-review its latest changes and should've therefore invalided my previous "r=me" and blocked the PR on another review given the fragile nature of the doctest impl. This didn't happen which is my fault.

Contains some other small changes. Diff best reviewed modulo whitespace.
r? `@GuillaumeGomez`
@bors bors closed this as completed in 96faee4 May 2, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue May 2, 2025
Rollup merge of rust-lang#140420 - fmease:rustdoc-fix-doctest-heur, r=GuillaumeGomez

rustdoc: Fix doctest heuristic for main fn wrapping

Fixes rust-lang#140412 which regressed in rust-lang#140220 that I reviewed. As mentioned in rust-lang#140220 (comment), at the time I didn't have the time to re-review its latest changes and should've therefore invalided my previous "r=me" and blocked the PR on another review given the fragile nature of the doctest impl. This didn't happen which is my fault.

Contains some other small changes. Diff best reviewed modulo whitespace.
r? ``@GuillaumeGomez``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-doctests Area: Documentation tests, run by rustdoc C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
Development

Successfully merging a pull request may close this issue.

4 participants