Skip to content

Commit

Permalink
Add ICE test for bad Add::add impl item type
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Feb 16, 2023
1 parent ff9c5db commit 2a700d4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/ui/lang-items/bad-add-impl.rs
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`
}
11 changes: 11 additions & 0 deletions tests/ui/lang-items/bad-add-impl.stderr
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`.

0 comments on commit 2a700d4

Please sign in to comment.