summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-17546.rs
blob: 6c62010f1762b431ce21cfff9714051e2022f552 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// ignore-sgx std::os::fortanix_sgx::usercalls::raw::Result changes compiler suggestions

use foo::MyEnum::Result;
use foo::NoResult; // Through a re-export

mod foo {
    pub use self::MyEnum::NoResult;

    pub enum MyEnum {
        Result,
        NoResult
    }

    fn new() -> NoResult<MyEnum, String> {
        //~^ ERROR expected type, found variant `NoResult`
        unimplemented!()
    }
}

mod bar {
    use foo::MyEnum::Result;
    use foo;

    fn new() -> Result<foo::MyEnum, String> {
        //~^ ERROR expected type, found variant `Result`
        unimplemented!()
    }
}

fn new() -> Result<foo::MyEnum, String> {
    //~^ ERROR expected type, found variant `Result`
    unimplemented!()
}

fn newer() -> NoResult<foo::MyEnum, String> {
    //~^ ERROR expected type, found variant `NoResult`
    unimplemented!()
}

fn main() {
    let _ = new();
}