]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/invalid_operator_trait.rs
Merge commit '598f0909568a51de8a2d1148f55a644fd8dffad0' into sync_cg_clif-2023-01-24
[rust.git] / tests / ui / traits / invalid_operator_trait.rs
1 #![crate_type = "lib"]
2 #![feature(lang_items)]
3 #![feature(no_core)]
4 #![no_core]
5
6 #[lang="sized"]
7 pub trait Sized {
8     // Empty.
9 }
10
11 #[lang = "add"]
12 trait Add<RHS=Self> {
13     type Output;
14
15     fn add<Y>(self, _: RHS) -> Self::Output;
16     //~^ ERROR `add` must not have any generic parameters
17 }
18
19 #[allow(unreachable_code)]
20 fn ice(a: usize) {
21     let r = loop {};
22     r = r + a;
23 }