//@ run-pass use std::fmt::Debug; fn sendable() { fn f(i: T, j: T) { assert_eq!(i, j); } fn g(i: T, j: T) { assert!(i != j); } let i: Box<_> = Box::new(100); let j: Box<_> = Box::new(100); f(i, j); let i: Box<_> = Box::new(100); let j: Box<_> = Box::new(101); g(i, j); } fn copyable() { fn f(i: T, j: T) { assert_eq!(i, j); } fn g(i: T, j: T) { assert!(i != j); } let i: Box<_> = Box::new(100); let j: Box<_> = Box::new(100); f(i, j); let i: Box<_> = Box::new(100); let j: Box<_> = Box::new(101); g(i, j); } fn noncopyable() { fn f(i: T, j: T) { assert_eq!(i, j); } fn g(i: T, j: T) { assert!(i != j); } let i: Box<_> = Box::new(100); let j: Box<_> = Box::new(100); f(i, j); let i: Box<_> = Box::new(100); let j: Box<_> = Box::new(101); g(i, j); } pub fn main() { sendable(); copyable(); noncopyable(); }