summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-consts/associated-const-ambiguity-report.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/associated-consts/associated-const-ambiguity-report.rs')
-rw-r--r--tests/ui/associated-consts/associated-const-ambiguity-report.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/associated-consts/associated-const-ambiguity-report.rs b/tests/ui/associated-consts/associated-const-ambiguity-report.rs
new file mode 100644
index 000000000..927d2c69e
--- /dev/null
+++ b/tests/ui/associated-consts/associated-const-ambiguity-report.rs
@@ -0,0 +1,21 @@
+trait Foo {
+ const ID: i32;
+}
+
+trait Bar {
+ const ID: i32;
+}
+
+impl Foo for i32 {
+ const ID: i32 = 1;
+}
+
+impl Bar for i32 {
+ const ID: i32 = 3;
+}
+
+const X: i32 = <i32>::ID; //~ ERROR E0034
+
+fn main() {
+ assert_eq!(1, X);
+}