]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/invalid_operator_trait.rs
Rollup merge of #106835 - compiler-errors:new-solver-gat-rebase-oops, r=lcnr
[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 }