fix ICE in pretty-printing global_asm!#138280
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.
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.
-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 |
…ompiler-errors fix ICE in pretty-printing `global_asm!` fixes rust-lang#138260 since rust-lang#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](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/tests.20for.20MIR.20pretty.20printing) 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.
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#137279 (Make some invalid codegen attr errors structured/translatable) - rust-lang#137793 (Stablize anonymous pipe) - rust-lang#138238 (Fix dyn -> param suggestion in struct ICEs) - rust-lang#138270 (chore: Fix some comments) - rust-lang#138280 (fix ICE in pretty-printing `global_asm!`) - rust-lang#138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
…ompiler-errors fix ICE in pretty-printing `global_asm!` fixes rust-lang#138260 since rust-lang#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](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/tests.20for.20MIR.20pretty.20printing) 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.
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.
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.
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 |
fix ICE in pretty-printing `global_asm!` fixes rust-lang#138260 since rust-lang#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](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/tests.20for.20MIR.20pretty.20printing) 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
|
☀️ Try build successful - checks-actions |
|
@rustbot ready |
|
@bors r+ rollup |
…earth Rollup of 12 pull requests Successful merges: - rust-lang#134076 (Stabilize `std::io::ErrorKind::InvalidFilename`) - rust-lang#137504 (Move methods from Map to TyCtxt, part 4.) - rust-lang#138175 (Support rmeta inputs for --crate-type=bin --emit=obj) - rust-lang#138259 (Disentangle `ForwardGenericParamBan` and `ConstParamTy` ribs) - rust-lang#138280 (fix ICE in pretty-printing `global_asm!`) - rust-lang#138318 (Rustdoc: remove a bunch of `@ts-expect-error` from main.js) - rust-lang#138331 (Use `RUSTC_LINT_FLAGS` more) - rust-lang#138357 (merge `TypeChecker` and `TypeVerifier`) - rust-lang#138394 (remove unnecessary variant) - rust-lang#138403 (Delegation: one more ICE fix for `MethodCall` generation) - rust-lang#138407 (Delegation: reject C-variadics) - rust-lang#138409 (Use sa_sigaction instead of sa_union.__su_sigaction for AIX) r? `@ghost` `@rustbot` modify labels: rollup
|
Is it possible this rollup failure is caused by this PR? |
|
Likely not @Manishearth |
|
(Unrelated, rollup failure is spurious MSVC filesystem problems) |
…earth Rollup of 12 pull requests Successful merges: - rust-lang#134076 (Stabilize `std::io::ErrorKind::InvalidFilename`) - rust-lang#137504 (Move methods from Map to TyCtxt, part 4.) - rust-lang#138175 (Support rmeta inputs for --crate-type=bin --emit=obj) - rust-lang#138259 (Disentangle `ForwardGenericParamBan` and `ConstParamTy` ribs) - rust-lang#138280 (fix ICE in pretty-printing `global_asm!`) - rust-lang#138318 (Rustdoc: remove a bunch of `@ts-expect-error` from main.js) - rust-lang#138331 (Use `RUSTC_LINT_FLAGS` more) - rust-lang#138357 (merge `TypeChecker` and `TypeVerifier`) - rust-lang#138394 (remove unnecessary variant) - rust-lang#138403 (Delegation: one more ICE fix for `MethodCall` generation) - rust-lang#138407 (Delegation: reject C-variadics) - rust-lang#138409 (Use sa_sigaction instead of sa_union.__su_sigaction for AIX) r? `@ghost` `@rustbot` modify labels: rollup
…earth Rollup of 12 pull requests Successful merges: - rust-lang#134076 (Stabilize `std::io::ErrorKind::InvalidFilename`) - rust-lang#137504 (Move methods from Map to TyCtxt, part 4.) - rust-lang#138175 (Support rmeta inputs for --crate-type=bin --emit=obj) - rust-lang#138259 (Disentangle `ForwardGenericParamBan` and `ConstParamTy` ribs) - rust-lang#138280 (fix ICE in pretty-printing `global_asm!`) - rust-lang#138318 (Rustdoc: remove a bunch of `@ts-expect-error` from main.js) - rust-lang#138331 (Use `RUSTC_LINT_FLAGS` more) - rust-lang#138357 (merge `TypeChecker` and `TypeVerifier`) - rust-lang#138394 (remove unnecessary variant) - rust-lang#138403 (Delegation: one more ICE fix for `MethodCall` generation) - rust-lang#138407 (Delegation: reject C-variadics) - rust-lang#138409 (Use sa_sigaction instead of sa_union.__su_sigaction for AIX) r? `@ghost` `@rustbot` modify labels: rollup
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/mirwhich 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