rust/src/test/ui/issues/issue-17546.rs

41 lines
780 B
Rust
Raw Normal View History

use foo::MyEnum::Result;
use foo::NoResult; // Through a re-export
mod foo {
pub use self::MyEnum::NoResult;
2015-11-24 00:36:12 +00:00
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();
}