]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lang-items/wrong-number-generic-args-index.rs
Auto merge of #84589 - In-line:zircon-thread-name, r=JohnTitor
[rust.git] / src / test / ui / lang-items / wrong-number-generic-args-index.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 = "index"]
12 trait MyIndex<'a, T> {}
13 //~^^ ERROR: `index` language item must be applied to a trait with 1 generic argument [E0718]
14
15 fn ice() {
16     let arr = [0; 5];
17     let _ = arr[2];
18     //~^ ERROR: cannot index into a value of type `[{integer}; 5]` [E0608]
19 }