mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
18 lines
351 B
Rust
18 lines
351 B
Rust
#![feature(core_intrinsics)]
|
|
|
|
extern crate core;
|
|
use core::intrinsics::mir::*; //~ custom_mir
|
|
|
|
#[custom_mir(dialect = "built")] //~ ERROR the `#[custom_mir]` attribute is just used for the Rust test suite
|
|
pub fn foo(_x: i32) -> i32 {
|
|
mir! {
|
|
{
|
|
Return() //~ custom_mir
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
assert_eq!(2, foo(2));
|
|
}
|