forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#55694 - jsirs:issue-31076, r=oli-obk
Fixes rust-lang#31076
- Loading branch information
Showing
3 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#![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}` | ||
let y = 5i32 + 6i32; | ||
//~^ ERROR binary operation `+` cannot be applied to type `i32` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error[E0369]: binary operation `+` cannot be applied to type `{integer}` | ||
--> $DIR/issue-31076.rs:13:13 | ||
| | ||
LL | let x = 5 + 6; | ||
| ^^^^^ | ||
| | ||
= note: an implementation of `std::ops::Add` might be missing for `{integer}` | ||
|
||
error[E0369]: binary operation `+` cannot be applied to type `i32` | ||
--> $DIR/issue-31076.rs:15:13 | ||
| | ||
LL | let y = 5i32 + 6i32; | ||
| ^^^^^^^^^^^ | ||
| | ||
= note: an implementation of `std::ops::Add` might be missing for `i32` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0369`. |