summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-17546.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-17546.rs')
-rw-r--r--tests/ui/issues/issue-17546.rs42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-17546.rs b/tests/ui/issues/issue-17546.rs
new file mode 100644
index 000000000..6c62010f1
--- /dev/null
+++ b/tests/ui/issues/issue-17546.rs
@@ -0,0 +1,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();
+}