]> git.lizzy.rs Git - rust.git/blob - src/test/ui/block-result/issue-13624.rs
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / block-result / issue-13624.rs
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
11 mod 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 }
18     //~^ ERROR mismatched types
19     //~| expected type `()`
20     //~| found type `a::Enum`
21     //~| expected (), found enum `a::Enum`
22   }
23 }
24
25 mod b {
26   mod test {
27     use a;
28
29     fn test_enum_struct_variant() {
30       let enum_struct_variant = ::a::get_enum_struct_variant();
31       match enum_struct_variant {
32         a::Enum::EnumStructVariant { x, y, z } => {
33         //~^ ERROR mismatched types
34         //~| expected type `()`
35         //~| found type `a::Enum`
36         //~| expected (), found enum `a::Enum`
37         }
38       }
39     }
40   }
41 }
42
43 fn main() {}