Skip to content

Commit bec765e

Browse files
committed
Add test.
1 parent 476faa2 commit bec765e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//@ check-pass
2+
3+
fn temp() -> (String, i32) {
4+
(String::from("Hello"), 1)
5+
}
6+
7+
fn main() {
8+
let a = &temp();
9+
let b = [(&temp(),)];
10+
let c = &temp().0;
11+
let d = &temp().0[..];
12+
let e = {
13+
let _ = 123;
14+
&(*temp().0)[..]
15+
};
16+
let f = if true {
17+
&temp()
18+
} else {
19+
&temp()
20+
};
21+
let g = match true {
22+
true => &temp(),
23+
false => {
24+
let _ = 123;
25+
&temp()
26+
}
27+
};
28+
println!("{a:?} {b:?} {c:?} {d:?} {e:?} {f:?} {g:?}");
29+
}

0 commit comments

Comments
 (0)