Rollup merge of #33970 - arielb1:normal-type-check, r=eddyb

normalize types in MIR typeck after erasing regions

this fixes the MIR bug @frankmcsherry encountered.

r? @eddyb
This commit is contained in:
Manish Goregaokar 2016-06-01 12:57:42 +05:30
commit e214c3e2da
2 changed files with 53 additions and 25 deletions

View file

@ -0,0 +1,29 @@
// Copyright 2016 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.
#![feature(rustc_attrs)]
trait Trait {
type Type;
}
impl<'a> Trait for &'a () {
type Type = u32;
}
#[rustc_mir]
fn foo<'a>(t: <&'a () as Trait>::Type) -> <&'a () as Trait>::Type {
t
}
#[rustc_mir]
fn main() {
assert_eq!(foo(4), 4);
}