-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #137502 - compiler-errors:global-asm-aint-mir-body, r=<…
…try> Don't include global asm in `mir_keys`, fix error body synthesis r? oli-obk Fixes #137470 Fixes #137471 Fixes #137472 Fixes #137473 try-job: test-various try-job: x86_64-apple-2
- Loading branch information
Showing
5 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//@ revisions: emit_mir instrument cfi | ||
|
||
// Make sure we don't try to emit MIR for it. | ||
//@[emit_mir] compile-flags: --emit=mir | ||
|
||
// Make sure we don't try to instrument it. | ||
//@[instrument] compile-flags: -Cinstrument-coverage -Zno-profiler-runtime | ||
//@[instrument] only-linux | ||
|
||
// Make sure we don't try to CFI encode it. | ||
//@[cfi] compile-flags: -Zsanitizer=cfi -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Clink-dead-code=true | ||
//@[cfi] needs-sanitizer-cfi | ||
//@[cfi] no-prefer-dynamic | ||
|
||
//@ build-pass | ||
//@ needs-asm-support | ||
|
||
use std::arch::global_asm; | ||
|
||
fn foo() {} | ||
|
||
global_asm!("/* {} */", sym foo); | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Ensure that we don't ICE when constructing the fake MIR body for a global | ||
// asm when the body has errors. See #137470. | ||
|
||
//@ needs-asm-support | ||
|
||
use std::arch::global_asm; | ||
|
||
global_asm!("/* {} */", sym a); | ||
//~^ ERROR cannot find value `a` in this scope | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0425]: cannot find value `a` in this scope | ||
--> $DIR/global-asm-with-error.rs:8:29 | ||
| | ||
LL | global_asm!("/* {} */", sym a); | ||
| ^ not found in this scope | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0425`. |