We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff9c5db commit 2a700d4Copy full SHA for 2a700d4
tests/ui/lang-items/bad-add-impl.rs
@@ -0,0 +1,18 @@
1
+#![feature(no_core)]
2
+#![feature(lang_items)]
3
+#![no_core]
4
+
5
+#[lang = "sized"]
6
+trait Sized {}
7
8
+#[lang = "add"]
9
+trait Add<T> {
10
+ const add: u32 = 1u32;
11
+}
12
13
+impl Add<u32> for u32 {}
14
15
+fn main() {
16
+ 1u32 + 1u32;
17
+ //~^ ERROR cannot add `u32` to `u32`
18
tests/ui/lang-items/bad-add-impl.stderr
@@ -0,0 +1,11 @@
+error[E0369]: cannot add `u32` to `u32`
+ --> $DIR/bad-add-impl.rs:16:10
+ |
+LL | 1u32 + 1u32;
+ | ---- ^ ---- u32
+ | |
+ | u32
+error: aborting due to previous error
+For more information about this error, try `rustc --explain E0369`.
0 commit comments