]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lang-items/wrong-number-generic-args-add.rs
Auto merge of #84589 - In-line:zircon-thread-name, r=JohnTitor
[rust.git] / src / test / ui / lang-items / wrong-number-generic-args-add.rs
1 // Checks whether declaring a lang item with the wrong number
2 // of generic arguments crashes the compiler (issue #83893).
3
4 #![feature(lang_items,no_core)]
5 #![no_core]
6 #![crate_type="lib"]
7
8 #[lang = "sized"]
9 trait MySized {}
10
11 #[lang = "add"]
12 trait MyAdd<'a, T> {}
13 //~^^ ERROR: `add` language item must be applied to a trait with 1 generic argument [E0718]
14
15 fn ice() {
16     let r = 5;
17     let a = 6;
18     r + a
19     //~^ ERROR: cannot add `{integer}` to `{integer}` [E0369]
20 }