]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs
feat(rustdoc): open sidebar menu when links inside it are focused
[rust.git] / src / test / ui / associated-types / associated-types-ICE-when-projecting-out-of-err.rs
1 // Test that we do not ICE when the self type is `ty::err`, but rather
2 // just propagate the error.
3
4 #![crate_type = "lib"]
5 #![feature(lang_items)]
6 #![feature(no_core)]
7 #![no_core]
8
9 #[lang="sized"]
10 pub trait Sized {
11     // Empty.
12 }
13
14 #[lang = "add"]
15 trait Add<RHS=Self> {
16     type Output;
17
18     fn add(self, _: RHS) -> Self::Output;
19 }
20
21 fn ice<A>(a: A) {
22     let r = loop {};
23     r = r + a;
24     //~^ ERROR the trait bound `(): Add<A>` is not satisfied
25 }