mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
10 lines
212 B
Rust
10 lines
212 B
Rust
// run-pass
|
|
|
|
// Tests for if as expressions returning boxed types
|
|
fn test_box() {
|
|
let rs: Box<_> = if true { Box::new(100) } else { Box::new(101) };
|
|
assert_eq!(*rs, 100);
|
|
}
|
|
|
|
pub fn main() { test_box(); }
|