rust/tests/ui/lang-items/issue-31076.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
281 B
Rust
Raw Normal View History

#![feature(no_core, lang_items)]
#![no_core]
#[lang="sized"]
trait Sized {}
#[lang="add"]
trait Add<T> {}
impl Add<i32> for i32 {}
fn main() {
let x = 5 + 6;
//~^ ERROR cannot add `i32` to `{integer}`
let y = 5i32 + 6i32;
2019-12-11 22:11:32 +00:00
//~^ ERROR cannot add `i32` to `i32`
}