2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2018-05-10 12:06:51 +03:00
|
|
|
|
|
|
|
const ALL_THE_NUMS: [u32; 1] = [
|
|
|
|
1
|
|
|
|
];
|
|
|
|
|
|
|
|
#[inline(never)]
|
|
|
|
fn array(i: usize) -> &'static u32 {
|
|
|
|
return &ALL_THE_NUMS[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline(never)]
|
|
|
|
fn tuple_field() -> &'static u32 {
|
|
|
|
&(42,).0
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!(tuple_field().to_string(), "42");
|
2018-05-10 13:11:36 +03:00
|
|
|
assert_eq!(array(0).to_string(), "1");
|
2018-05-10 12:06:51 +03:00
|
|
|
}
|