mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 10:05:06 +03:00
Add test
Add test for incompleately implemented add trait, see issue #31076
This commit is contained in:
@@ -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}`
|
||||
}
|
||||
@@ -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`.
|
||||
Reference in New Issue
Block a user