// option. This file may not be copied, modified, or distributed
// except according to those terms.
-extern crate debug;
+#![feature(unsafe_destructor)]
trait X {
- fn call<T>(&self, x: &T);
- fn default_method<T>(&self, x: &T) {
- println!("X::default_method {:?} {:?}", self, x);
+ fn call<T: std::fmt::Debug>(&self, x: &T);
+ fn default_method<T: std::fmt::Debug>(&self, x: &T) {
+ println!("X::default_method {:?}", x);
}
}
+#[derive(Debug)]
struct Y(int);
+#[derive(Debug)]
struct Z<T> {
x: T
}
impl X for Y {
- fn call<T>(&self, x: &T) {
+ fn call<T: std::fmt::Debug>(&self, x: &T) {
println!("X::call {:?} {:?}", self, x);
}
}
#[unsafe_destructor]
-impl<T: X> Drop for Z<T> {
+impl<T: X + std::fmt::Debug> Drop for Z<T> {
fn drop(&mut self) {
// These statements used to cause an ICE.
self.x.call(self);