diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-06-01 12:57:42 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-06-01 12:57:42 +0530 |
| commit | e214c3e2da41a2f561bdff13c01a21278a65403b (patch) | |
| tree | 3a4bdcc001afc95d73642f375366a7a49f959638 /src/test | |
| parent | eba82bb569903ce4f96af8e90e2a55feca816634 (diff) | |
| parent | e3cff797a7dcc2358b37c170dc9d83d34d118725 (diff) | |
| download | rust-e214c3e2da41a2f561bdff13c01a21278a65403b.tar.gz rust-e214c3e2da41a2f561bdff13c01a21278a65403b.zip | |
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
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/mir_call_with_associated_type.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/run-pass/mir_call_with_associated_type.rs b/src/test/run-pass/mir_call_with_associated_type.rs new file mode 100644 index 00000000000..08401c275a5 --- /dev/null +++ b/src/test/run-pass/mir_call_with_associated_type.rs @@ -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); +} |
