Add test.

This commit is contained in:
Mara Bos 2024-02-20 15:19:16 +01:00
parent 476faa2196
commit bec765e507

View file

@ -0,0 +1,29 @@
//@ check-pass
fn temp() -> (String, i32) {
(String::from("Hello"), 1)
}
fn main() {
let a = &temp();
let b = [(&temp(),)];
let c = &temp().0;
let d = &temp().0[..];
let e = {
let _ = 123;
&(*temp().0)[..]
};
let f = if true {
&temp()
} else {
&temp()
};
let g = match true {
true => &temp(),
false => {
let _ = 123;
&temp()
}
};
println!("{a:?} {b:?} {c:?} {d:?} {e:?} {f:?} {g:?}");
}