mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
12 lines
303 B
Rust
12 lines
303 B
Rust
//@ run-pass
|
|
|
|
|
|
fn one() -> i32 { 1 }
|
|
|
|
// Make sure the vec![...] macro doesn't introduce hidden rvalue
|
|
// scopes (such as blocks) around the element expressions.
|
|
pub fn main() {
|
|
assert_eq!(vec![&one(), &one(), &2], vec![&1, &1, &(one()+one())]);
|
|
assert_eq!(vec![&one(); 2], vec![&1, &one()]);
|
|
}
|