rust/tests/ui/feature-gates/feature-gate-custom_mir.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
351 B
Rust
Raw Normal View History

2022-08-03 11:30:13 +00:00
#![feature(core_intrinsics)]
extern crate core;
use core::intrinsics::mir::*; //~ custom_mir
2022-08-03 11:30:13 +00:00
#[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
}
}
2022-08-03 11:30:13 +00:00
}
fn main() {
assert_eq!(2, foo(2));
}