]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/issue-13624.rs
Imported Upstream version 1.5.0+dfsg1
[rustc.git] / src / test / compile-fail / issue-13624.rs
CommitLineData
1a4d82fc
JJ
1// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
11mod a {
12 pub enum Enum {
13 EnumStructVariant { x: u8, y: u8, z: u8 }
14 }
15
16 pub fn get_enum_struct_variant() -> () {
17 Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
85aaf69f
SL
18 //~^ ERROR mismatched types
19 //~| expected `()`
20 //~| found `a::Enum`
21 //~| expected ()
22 //~| found enum `a::Enum`
1a4d82fc
JJ
23 }
24}
25
26mod b {
27 mod test {
28 use a;
29
30 fn test_enum_struct_variant() {
31 let enum_struct_variant = ::a::get_enum_struct_variant();
32 match enum_struct_variant {
33 a::Enum::EnumStructVariant { x, y, z } => {
85aaf69f
SL
34 //~^ ERROR mismatched types
35 //~| expected `()`
36 //~| found `a::Enum`
37 //~| expected ()
38 // found enum `a::Enum`
1a4d82fc
JJ
39 }
40 }
41 }
42 }
43}
44
45fn main() {}