test: Add a test that POD types can be implicitly copied.

This commit is contained in:
Patrick Walton 2013-12-11 17:39:43 -08:00
parent e7fbc1f553
commit 36990dfa3f
2 changed files with 24 additions and 1 deletions

View file

@ -10,6 +10,10 @@
// Test which of the builtin types are considered POD.
#[feature(managed_boxes)];
use std::rc::Rc;
fn assert_pod<T:Pod>() { }
trait Dummy { }
@ -71,8 +75,12 @@ fn test<'a,T,U:Pod>(_: &'a int) {
// structs containing non-POD are not ok
assert_pod::<MyNonpodStruct>(); //~ ERROR does not fulfill `Pod`
// managed or ref counted types are not ok
assert_pod::<@int>(); //~ ERROR does not fulfill `Pod`
assert_pod::<Rc<int>>(); //~ ERROR does not fulfill `Pod`
}
fn main() {
pub fn main() {
}