re-introduce a cache for ast-ty-to-ty

It turns out that `ast_ty_to_ty` is supposed to be updating the `def`
after it finishes, but at some point in the past it stopped doing
so. This was never noticed because of the `ast_ty_to_ty_cache`, but that
cache was recently removed. This PR fixes the code to update the def
properly, but apparently that is not quite enough to make the operation
idempotent, so for now we reintroduce the cache too.

Fixes #33425.
This commit is contained in:
Niko Matsakis 2016-05-12 14:19:26 -04:00
parent e88defe718
commit aa00e3a552
6 changed files with 98 additions and 27 deletions

View file

@ -0,0 +1,26 @@
// Copyright 2012 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.
// Test the case where we resolve `C::Result` and the trait bound
// itself includes a `Self::Item` shorthand.
//
// Regression test for issue #33425.
trait ParallelIterator {
type Item;
fn drive_unindexed<C>(self, consumer: C) -> C::Result
where C: Consumer<Self::Item>;
}
pub trait Consumer<ITEM> {
type Result;
}
fn main() { }