rust/tests/ui/inline-const/const-expr-basic.rs

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

15 lines
157 B
Rust
Raw Normal View History

2020-10-06 15:53:12 -05:00
// run-pass
2020-09-21 15:55:58 -05:00
#![feature(inline_const)]
2020-09-21 15:55:58 -05:00
fn foo() -> i32 {
const {
let x = 5 + 10;
x / 3
}
}
2020-10-06 15:53:12 -05:00
fn main() {
assert_eq!(5, foo());
}