summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-consts/associated-const-impl-wrong-type.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/associated-consts/associated-const-impl-wrong-type.rs')
-rw-r--r--src/test/ui/associated-consts/associated-const-impl-wrong-type.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/associated-consts/associated-const-impl-wrong-type.rs b/src/test/ui/associated-consts/associated-const-impl-wrong-type.rs
new file mode 100644
index 000000000..1aad749c1
--- /dev/null
+++ b/src/test/ui/associated-consts/associated-const-impl-wrong-type.rs
@@ -0,0 +1,12 @@
+trait Foo {
+ const BAR: u32;
+}
+
+struct SignedBar;
+
+impl Foo for SignedBar {
+ const BAR: i32 = -1;
+ //~^ ERROR implemented const `BAR` has an incompatible type for trait [E0326]
+}
+
+fn main() {}