Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (20 sloc) 466 Bytes
// build-pass (FIXME(62277): could be check-pass?)
#![allow(unused_assignments)]
#![allow(unused_variables)]
// Test that a field can have the same name in different variants
// of an enum
pub enum Foo {
X { foo: u32 },
Y { foo: u32 }
}
pub fn foo(mut x: Foo) {
let mut y = None;
let mut z = None;
if let Foo::X { ref foo } = x {
z = Some(foo);
}
if let Foo::Y { ref mut foo } = x {
y = Some(foo);
}
}
fn main() {}
You can’t perform that action at this time.