opt-level removes diagnostic output
Open
@LauraCastrillonMp is already working on this.
Since Feb 11, 2026.
A-diagnostics
A-global-asm
C-bug
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
use std::arch::global_asm;
macro_rules! wrap {
() => {
macro_rules! _a {
() => {
":"
};
}
};
}
wrap!();
use _a as a;
global_asm!(a!());
fn main() {}
rustc a.rs --edition=2021 -Copt-level=0
error: unexpected token at start of statement
|
note: instantiated into assembly here
--> <inline asm>:2:1
|
2 | :
| ^
error: aborting due to 1 previous error
rustc a.rs --edition=2021 -Copt-level=1
error: <inline asm>:2:1: unexpected token at start of statement
:
^
I would think the diagnostics would be the same regardless of codegen backend optimization level 🤔
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.