os-rust/tests/ui/type-param-constraints.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
542 B
Rust
Raw Normal View History

//@ run-pass
#![allow(non_camel_case_types)]
#![allow(dead_code)]
//@ pretty-expanded FIXME #23616
2013-08-17 08:37:42 -07:00
fn p_foo<T>(_pinned: T) { }
fn s_foo<T>(_shared: T) { }
fn u_foo<T:Send>(_unique: T) { }
2012-08-15 18:46:55 -07:00
struct r {
i: isize,
}
impl Drop for r {
2013-09-16 21:18:07 -04:00
fn drop(&mut self) {}
}
fn r(i:isize) -> r {
2012-09-05 15:58:43 -07:00
r {
i: i
}
}
pub fn main() {
p_foo(r(10));
p_foo::<Box<_>>(Box::new(r(10)));
p_foo::<Box<_>>(Box::new(10));
2015-01-25 22:05:03 +01:00
p_foo(10);
s_foo::<Box<_>>(Box::new(10));
2015-01-25 22:05:03 +01:00
s_foo(10);
u_foo::<Box<_>>(Box::new(10));
2015-01-25 22:05:03 +01:00
u_foo(10);
}