]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17546.rs
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-17546.rs
1 // Copyright 2015 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 use foo::MyEnum::Result;
12 use foo::NoResult; // Through a re-export
13
14 mod foo {
15     pub use self::MyEnum::NoResult;
16
17     pub enum MyEnum {
18         Result,
19         NoResult
20     }
21
22     fn new() -> NoResult<MyEnum, String> {
23         //~^ ERROR expected type, found variant `NoResult`
24         unimplemented!()
25     }
26 }
27
28 mod bar {
29     use foo::MyEnum::Result;
30     use foo;
31
32     fn new() -> Result<foo::MyEnum, String> {
33         //~^ ERROR expected type, found variant `Result`
34         unimplemented!()
35     }
36 }
37
38 fn new() -> Result<foo::MyEnum, String> {
39     //~^ ERROR expected type, found variant `Result`
40     unimplemented!()
41 }
42
43 fn newer() -> NoResult<foo::MyEnum, String> {
44     //~^ ERROR expected type, found variant `NoResult`
45     unimplemented!()
46 }
47
48 fn main() {
49     let _ = new();
50 }