mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-06 12:54:51 +00:00
Auto merge of #21574 - japaric:walk-projections, r=nikomatsakis
closes #21363 r? @nikomatsakis
This commit is contained in:
commit
47621db62c
@ -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) |
|
||||
|
21
src/test/run-pass/issue-21363.rs
Normal file
21
src/test/run-pass/issue-21363.rs
Normal file
@ -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() {}
|
Loading…
Reference in New Issue
Block a user