2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(unused_variables)]
|
|
|
|
#![allow(unused_assignments)]
|
2015-04-11 02:13:24 -05:00
|
|
|
#[derive(Debug)]
|
2022-07-25 15:36:03 -05:00
|
|
|
#[allow(unused_tuple_struct_fields)]
|
2015-04-11 02:13:24 -05:00
|
|
|
enum Foo {
|
|
|
|
Bar(u32, u32),
|
|
|
|
Baz(&'static u32, &'static u32)
|
|
|
|
}
|
|
|
|
|
|
|
|
static NUM: u32 = 100;
|
|
|
|
|
|
|
|
fn main () {
|
|
|
|
let mut b = Foo::Baz(&NUM, &NUM);
|
|
|
|
b = Foo::Bar(f(&b), g(&b));
|
|
|
|
}
|
|
|
|
|
|
|
|
static FNUM: u32 = 1;
|
|
|
|
|
|
|
|
fn f (b: &Foo) -> u32 {
|
|
|
|
FNUM
|
|
|
|
}
|
|
|
|
|
|
|
|
static GNUM: u32 = 2;
|
|
|
|
|
|
|
|
fn g (b: &Foo) -> u32 {
|
|
|
|
GNUM
|
|
|
|
}
|