-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Don't include global asm in mir_keys
, fix error body synthesis
#137502
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//@ 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 | ||
// FIXME(#122848) Remove only-linux once OSX CFI binaries work | ||
//@[cfi] only-linux | ||
|
||
//@ build-pass | ||
//@ needs-asm-support | ||
|
||
use std::arch::global_asm; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this isn't stable for all architectures 🙃 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm, is there a needs-global-asm 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or maybe needs-asm There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I... thiiink so? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. needs-asm-support |
||
|
||
fn foo() {} | ||
|
||
global_asm!("/* {} */", sym foo); | ||
|
||
fn main() {} |
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() {} |
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`. |
Uh oh!
There was an error while loading. Please reload this page.