forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#116446 - compiler-errors:yeet-mir-from_anon…
…_const, r=b-naber Yeet `mir::Const::from_anon_const` Only had one callsite which was easily simplified. Uplifted a comment that I think is much more useful living in `ty::Const` world.
- Loading branch information
Showing
5 changed files
with
54 additions
and
103 deletions.
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
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,15 @@ | ||
// only-x86_64 | ||
// needs-asm-support | ||
|
||
#![feature(asm_const)] | ||
|
||
// Test to make sure that we emit const errors eagerly for inline asm | ||
|
||
use std::arch::asm; | ||
|
||
fn test<T>() { | ||
unsafe { asm!("/* {} */", const 1 / 0); } | ||
//~^ ERROR evaluation of | ||
} | ||
|
||
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[E0080]: evaluation of `test::<T>::{constant#0}` failed | ||
--> $DIR/const-error.rs:11:37 | ||
| | ||
LL | unsafe { asm!("/* {} */", const 1 / 0); } | ||
| ^^^^^ attempt to divide `1_i32` by zero | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0080`. |