]> git.lizzy.rs Git - rust.git/blob - tests/ui/codegen/issue-16602-3.rs
Merge commit '1480cea393d0cee195e59949eabdfbcf1230f7f9' into clippyup
[rust.git] / tests / ui / codegen / issue-16602-3.rs
1 // run-pass
2 #![allow(unused_variables)]
3 #![allow(unused_assignments)]
4 #[derive(Debug)]
5 #[allow(unused_tuple_struct_fields)]
6 enum Foo {
7     Bar(u32, u32),
8     Baz(&'static u32, &'static u32)
9 }
10
11 static NUM: u32 = 100;
12
13 fn main () {
14     let mut b = Foo::Baz(&NUM, &NUM);
15     b = Foo::Bar(f(&b), g(&b));
16 }
17
18 static FNUM: u32 = 1;
19
20 fn f (b: &Foo) -> u32 {
21     FNUM
22 }
23
24 static GNUM: u32 = 2;
25
26 fn g (b: &Foo) -> u32 {
27     GNUM
28 }