summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs')
-rw-r--r--src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs b/src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs
new file mode 100644
index 000000000..707bcac78
--- /dev/null
+++ b/src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs
@@ -0,0 +1,25 @@
+// Test that we do not ICE when the self type is `ty::err`, but rather
+// just propagate the error.
+
+#![crate_type = "lib"]
+#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
+#[lang="sized"]
+pub trait Sized {
+ // Empty.
+}
+
+#[lang = "add"]
+trait Add<RHS=Self> {
+ type Output;
+
+ fn add(self, _: RHS) -> Self::Output;
+}
+
+fn ice<A>(a: A) {
+ let r = loop {};
+ r = r + a;
+ //~^ ERROR the trait bound `(): Add<A>` is not satisfied
+}