]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-27889.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / issues / issue-27889.rs
CommitLineData
60c5eb7d 1// check-pass
0bf4aa26
XL
2#![allow(unused_assignments)]
3#![allow(unused_variables)]
9cc50fc6
SL
4// Test that a field can have the same name in different variants
5// of an enum
85aaf69f 6
9cc50fc6
SL
7pub enum Foo {
8 X { foo: u32 },
9 Y { foo: u32 }
62682a34
SL
10}
11
9cc50fc6
SL
12pub fn foo(mut x: Foo) {
13 let mut y = None;
14 let mut z = None;
15 if let Foo::X { ref foo } = x {
16 z = Some(foo);
17 }
18 if let Foo::Y { ref mut foo } = x {
19 y = Some(foo);
20 }
62682a34 21}
223e47cc
LB
22
23fn main() {}