Add test
Add test for incompleately implemented add trait, see issue #31076
This commit is contained in:
parent
56ac2c4fc3
commit
2a1dc1eff6
2 changed files with 26 additions and 0 deletions
15
src/test/ui/issues/issue-31076.rs
Normal file
15
src/test/ui/issues/issue-31076.rs
Normal 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}`
|
||||
}
|
||||
11
src/test/ui/issues/issue-31076.stderr
Normal file
11
src/test/ui/issues/issue-31076.stderr
Normal 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`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue