about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/middle/ty_walk.rs5
-rw-r--r--src/test/run-pass/issue-21363.rs21
2 files changed, 25 insertions, 1 deletions
diff --git a/src/librustc/middle/ty_walk.rs b/src/librustc/middle/ty_walk.rs
index 28975c73416..ff3a308d7d3 100644
--- a/src/librustc/middle/ty_walk.rs
+++ b/src/librustc/middle/ty_walk.rs
@@ -37,8 +37,11 @@ impl<'tcx> TypeWalker<'tcx> {
             ty::ty_projection(ref data) => {
                 self.push_reversed(data.trait_ref.substs.types.as_slice());
             }
-            ty::ty_trait(box ty::TyTrait { ref principal, .. }) => {
+            ty::ty_trait(box ty::TyTrait { ref principal, ref bounds }) => {
                 self.push_reversed(principal.substs().types.as_slice());
+                self.push_reversed(bounds.projection_bounds.iter().map(|pred| {
+                    pred.0.ty
+                }).collect::<Vec<_>>().as_slice());
             }
             ty::ty_enum(_, ref substs) |
             ty::ty_struct(_, ref substs) |
diff --git a/src/test/run-pass/issue-21363.rs b/src/test/run-pass/issue-21363.rs
new file mode 100644
index 00000000000..2fc1d9fd643
--- /dev/null
+++ b/src/test/run-pass/issue-21363.rs
@@ -0,0 +1,21 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![no_implicit_prelude]
+
+trait Iterator {
+    type Item;
+}
+
+impl<'a, T> Iterator for &'a mut (Iterator<Item=T> + 'a) {
+    type Item = T;
+}
+
+fn main() {}