2012-12-10 19:32:48 -06:00
|
|
|
// 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.
|
|
|
|
|
2011-09-02 12:39:05 -05:00
|
|
|
// Tests that shapes respect linearize_ty_params().
|
|
|
|
|
2012-01-19 18:10:31 -06:00
|
|
|
enum option<T> {
|
2012-01-19 20:31:08 -06:00
|
|
|
none,
|
|
|
|
some(T),
|
2011-09-02 12:39:05 -05:00
|
|
|
}
|
|
|
|
|
2013-02-22 18:08:16 -06:00
|
|
|
struct Smallintmap<T> {v: ~[option<T>]}
|
2011-09-02 12:39:05 -05:00
|
|
|
|
2013-01-29 21:19:41 -06:00
|
|
|
struct V<T> { v: ~[option<T>] }
|
2013-01-26 00:46:32 -06:00
|
|
|
|
2013-02-22 18:08:16 -06:00
|
|
|
fn mk<T>() -> @mut Smallintmap<T> {
|
2013-01-29 20:13:14 -06:00
|
|
|
let mut v: ~[option<T>] = ~[];
|
2013-02-22 18:08:16 -06:00
|
|
|
return @mut Smallintmap {v: v};
|
2011-09-02 12:39:05 -05:00
|
|
|
}
|
|
|
|
|
2011-10-25 08:56:55 -05:00
|
|
|
fn f<T,U>() {
|
2013-02-22 18:08:16 -06:00
|
|
|
let mut sim = mk::<U>();
|
2013-03-08 14:39:42 -06:00
|
|
|
error!(sim);
|
2011-09-02 12:39:05 -05:00
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2011-09-02 12:39:05 -05:00
|
|
|
f::<int,int>();
|
|
|
|
}
|
|
|
|
|