-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fix ICE in pretty-printing global_asm!
#138280
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
Conversation
r? @nnethercote rustbot has assigned @nnethercote. Use |
r? compiler-errors |
This has nothing to do with (edit: fixed typo below)
Please adjust the title and description not to mention @rustbot author |
global_asm!
const
operandsglobal_asm!
65d9a66
to
4613650
Compare
tests/ui/unpretty/mir/global-asm.rs
Outdated
@@ -0,0 +1,7 @@ | |||
//@ compile-flags: -Zdump-mir=all --crate-type=lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mentioned -dump=mir
in one of your comments. That doesn't exist, and --emit=mir
seemed to work. So I don't know what you meant exactly, but is this the right dump command? will it not create a bunch of useless files when someone runs the tests suite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-Zdump-mir=all
. And yes, I think unfortunately your test will end up dumping a bunch of files when the test suite is executed I think 🤔 .
You should probably move this to a tests/mir-opt
test, and add an annotation for // EMIT_MIR ...
for just the global asm block, or however you spell that.
It was a typo lol |
@rustbot ready |
4613650
to
b394c8e
Compare
allright, I moved the test file. The testing machinery there is much nicer. |
LGTM. @bors r+ rollup |
b394c8e
to
73b7a5e
Compare
right, of course... It looks like @rustbot ready |
tests/mir-opt/global_asm.rs
Outdated
@@ -0,0 +1,18 @@ | |||
// skip-filecheck | |||
#![feature(no_core, lang_items, rustc_attrs, decl_macro)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need no-core, i'm pretty sure there's a directive for limiting this test just to platforms with asm support:
//@ needs-asm-support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I guess that's fine here, because the printing logic does not change between platforms so testing only on some is probably fine. I've made the change.
73b7a5e
to
9213cb8
Compare
I'll approve when CI turns green |
@bors try |
☀️ Try build successful - checks-actions |
@rustbot ready |
@bors r+ rollup |
Is it possible this rollup failure is caused by this PR? |
Likely not @Manishearth |
(Unrelated, rollup failure is spurious MSVC filesystem problems) |
fixes #138260
since #137180,
global_asm!
gets a fake body, that the pretty printing logic did not know what to do with.based on #t-compiler/help > tests for MIR pretty printing I created
tests/ui/unpretty/mir
which seemed as good a place as any for a test. If there is a better place, let me know.try-job: test-various
try-job: x86_64-apple-2