2015-01-02 09:20:34 +00:00
|
|
|
// Test that we do not ICE when the self type is `ty::err`, but rather
|
|
|
|
// just propagate the error.
|
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
2015-01-05 06:36:00 +00:00
|
|
|
#![feature(lang_items)]
|
2015-07-30 00:01:14 +00:00
|
|
|
#![feature(no_core)]
|
|
|
|
#![no_core]
|
2015-01-02 09:20:34 +00:00
|
|
|
|
|
|
|
#[lang="sized"]
|
2015-03-31 23:58:01 +00:00
|
|
|
pub trait Sized {
|
2015-01-02 09:20:34 +00:00
|
|
|
// Empty.
|
|
|
|
}
|
|
|
|
|
|
|
|
#[lang = "add"]
|
|
|
|
trait Add<RHS=Self> {
|
|
|
|
type Output;
|
|
|
|
|
2017-06-25 02:29:10 +00:00
|
|
|
fn add(self, _: RHS) -> Self::Output;
|
2015-01-02 09:20:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn ice<A>(a: A) {
|
|
|
|
let r = loop {};
|
2015-01-31 18:57:26 +00:00
|
|
|
r = r + a;
|
2018-04-20 15:11:28 +00:00
|
|
|
//~^ ERROR the trait bound `(): Add<A>` is not satisfied
|
2015-01-02 09:20:34 +00:00
|
|
|
}
|