2015-01-15 00:54:51 -06:00
|
|
|
// 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.
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2015-03-05 20:33:58 -06:00
|
|
|
#![feature(core)]
|
2015-01-15 00:54:51 -06:00
|
|
|
|
|
|
|
struct NT(str);
|
|
|
|
struct DST { a: u32, b: str }
|
|
|
|
|
|
|
|
fn main() {
|
2015-03-14 21:01:57 -05:00
|
|
|
// type_name should support unsized types
|
2015-02-17 06:48:32 -06:00
|
|
|
assert_eq!(unsafe {(
|
2015-01-15 00:54:51 -06:00
|
|
|
// Slice
|
2015-03-14 21:01:57 -05:00
|
|
|
std::intrinsics::type_name::<[u8]>(),
|
2015-01-15 00:54:51 -06:00
|
|
|
// str
|
2015-03-14 21:01:57 -05:00
|
|
|
std::intrinsics::type_name::<str>(),
|
2015-01-15 00:54:51 -06:00
|
|
|
// Trait
|
2015-03-14 21:01:57 -05:00
|
|
|
std::intrinsics::type_name::<Copy>(),
|
2015-01-15 00:54:51 -06:00
|
|
|
// Newtype
|
2015-03-14 21:01:57 -05:00
|
|
|
std::intrinsics::type_name::<NT>(),
|
2015-01-15 00:54:51 -06:00
|
|
|
// DST
|
2015-03-14 21:01:57 -05:00
|
|
|
std::intrinsics::type_name::<DST>()
|
2015-02-17 06:48:32 -06:00
|
|
|
)}, ("[u8]", "str", "core::marker::Copy", "NT", "DST"));
|
2015-01-15 00:54:51 -06:00
|
|
|
}
|