DMD allows using @safe in inline ASM, it should be allowed to mark asm only as @system and @trusted because allowing @safe causes user confusion.
Example code:
void main() @safe {
asm @safe {
nop;
}
}
This shouldn't compile, only @trusted and @system should be allowed because there is no way to check the safety of asm inline code
Comment #1 by dlang-bot — 2023-05-06T17:04:31Z
@ntrel created dlang/dmd pull request #15192 "Fix Issue 23900 - @safe is allowed in inline asm" fixing this issue:
- Fix Issue 23900 - @safe is allowed in inline asm
https://github.com/dlang/dmd/pull/15192
Comment #2 by dlang-bot — 2023-05-11T00:47:34Z
dlang/dmd pull request #15192 "Fix Issue 23900 - @safe is allowed in inline asm" was merged into master:
- d5fccc13cf5e4e29afc470b110aeb0d0e17b5da4 by Nick Treleaven:
Fix Issue 23900 - @safe is allowed in inline asm
https://github.com/dlang/dmd/pull/15192