]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/lang-items/lang-item-generic-requirements.rs
1 // Checks that declaring a lang item with the wrong number
2 // of generic arguments errors rather than crashing (issue #83893, #87573, part of #9307, #79559).
4 #![feature(lang_items, no_core)]
12 //~^^ ERROR: `add` language item must be applied to a trait with 1 generic argument [E0718]
14 #[lang = "drop_in_place"]
15 //~^ ERROR `drop_in_place` language item must be applied to a function with at least 1 generic
19 trait MyIndex
<'a
, T
> {}
20 //~^^ ERROR: `index` language item must be applied to a trait with 1 generic argument [E0718]
22 #[lang = "phantom_data"]
23 //~^ ERROR `phantom_data` language item must be applied to a struct with 1 generic argument
24 struct MyPhantomData
<T
, U
>;
25 //~^ ERROR parameter `T` is never used
26 //~| ERROR parameter `U` is never used
28 // When the `start` lang item is missing generics very odd things can happen, especially when
29 // it comes to cross-crate monomorphization
31 //~^ ERROR `start` language item must be applied to a function with 1 generic argument [E0718]
32 fn start(_
: *const u8, _
: isize, _
: *const *const u8) -> isize {
50 let _
= MyPhantomData
::<(), i32>;