-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ICE test for bad Add::add impl item type
- Loading branch information
1 parent
ff9c5db
commit 2a700d4
Showing
2 changed files
with
29 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#![feature(no_core)] | ||
#![feature(lang_items)] | ||
#![no_core] | ||
|
||
#[lang = "sized"] | ||
trait Sized {} | ||
|
||
#[lang = "add"] | ||
trait Add<T> { | ||
const add: u32 = 1u32; | ||
} | ||
|
||
impl Add<u32> for u32 {} | ||
|
||
fn main() { | ||
1u32 + 1u32; | ||
//~^ ERROR cannot add `u32` to `u32` | ||
} |
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,11 @@ | ||
error[E0369]: cannot add `u32` to `u32` | ||
--> $DIR/bad-add-impl.rs:16:10 | ||
| | ||
LL | 1u32 + 1u32; | ||
| ---- ^ ---- u32 | ||
| | | ||
| u32 | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0369`. |