mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
29 lines
403 B
Rust
29 lines
403 B
Rust
// run-pass
|
|
#![allow(unused_variables)]
|
|
#![allow(unused_assignments)]
|
|
#[derive(Debug)]
|
|
#[allow(dead_code)]
|
|
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
|
|
}
|