Add test for incompleately implemented add trait, see issue #31076
This commit is contained in:
jsirs 2018-11-05 14:33:43 +02:00 committed by GitHub
parent 56ac2c4fc3
commit 2a1dc1eff6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#![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 binary operation `+` cannot be applied to type `{integer}`
}

View file

@ -0,0 +1,11 @@
error[E0369]: binary operation `+` cannot be applied to type `{integer}`
--> $DIR/typeck-issue-31076-correct-trait-impl.rs:13:13
|
LL | let x = 5 + 6;
| ^^^^^
|
= note: an implementation of `std::ops::Add` might be missing for `{integer}`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0369`.