]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17546.rs
Rollup merge of #60492 - acrrd:issues/54054_chain, r=SimonSapin
[rust.git] / src / test / ui / issues / issue-17546.rs
1 use foo::MyEnum::Result;
2 use foo::NoResult; // Through a re-export
3
4 mod foo {
5     pub use self::MyEnum::NoResult;
6
7     pub enum MyEnum {
8         Result,
9         NoResult
10     }
11
12     fn new() -> NoResult<MyEnum, String> {
13         //~^ ERROR expected type, found variant `NoResult`
14         unimplemented!()
15     }
16 }
17
18 mod bar {
19     use foo::MyEnum::Result;
20     use foo;
21
22     fn new() -> Result<foo::MyEnum, String> {
23         //~^ ERROR expected type, found variant `Result`
24         unimplemented!()
25     }
26 }
27
28 fn new() -> Result<foo::MyEnum, String> {
29     //~^ ERROR expected type, found variant `Result`
30     unimplemented!()
31 }
32
33 fn newer() -> NoResult<foo::MyEnum, String> {
34     //~^ ERROR expected type, found variant `NoResult`
35     unimplemented!()
36 }
37
38 fn main() {
39     let _ = new();
40 }