Add ICE test for bad Add::add impl item type
This commit is contained in:
parent
ff9c5db03c
commit
2a700d47f5
18
tests/ui/lang-items/bad-add-impl.rs
Normal file
18
tests/ui/lang-items/bad-add-impl.rs
Normal file
@ -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`
|
||||
}
|
11
tests/ui/lang-items/bad-add-impl.stderr
Normal file
11
tests/ui/lang-items/bad-add-impl.stderr
Normal file
@ -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`.
|
Loading…
Reference in New Issue
Block a user