about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-12-09 11:08:39 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-12-15 06:02:49 +0000
commitcfabce22304d5e9008b36a1895cf3206e7eb5d19 (patch)
treecfcd05536435a5de13cb036776b33dfd14ad941c /src/test/compile-fail
parent7b06438d8349c1a6bbeb29c2a1bd874553a8625c (diff)
downloadrust-cfabce22304d5e9008b36a1895cf3206e7eb5d19.tar.gz
rust-cfabce22304d5e9008b36a1895cf3206e7eb5d19.zip
Demote most backwards incompatible ambiguity errors from RFC 1560 to warnings.
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/imports/rfc-1560-warning-cycle.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/compile-fail/imports/rfc-1560-warning-cycle.rs b/src/test/compile-fail/imports/rfc-1560-warning-cycle.rs
new file mode 100644
index 00000000000..bed10c87ae1
--- /dev/null
+++ b/src/test/compile-fail/imports/rfc-1560-warning-cycle.rs
@@ -0,0 +1,30 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(rustc_attrs)]
+#![allow(unused)]
+
+pub struct Foo;
+
+mod bar {
+    struct Foo;
+
+    mod baz {
+        use *; //~ NOTE `Foo` could resolve to the name imported here
+        use bar::*; //~ NOTE `Foo` could also resolve to the name imported here
+        fn f(_: Foo) {}
+        //~^ WARN `Foo` is ambiguous
+        //~| WARN hard error in a future release
+        //~| NOTE see issue #38260
+    }
+}
+
+#[rustc_error]
+fn main() {} //~ ERROR compilation successful