]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/issue-4252.rs
std: Rename Show/String to Debug/Display
[rust.git] / src / test / run-pass / issue-4252.rs
index 186dd0363eeb65d0bbc090c382a0a7a3b1017609..9d5f8576c633ee83a31c6bf78f33778135c4cf83 100644 (file)
 
 #![feature(unsafe_destructor)]
 
-extern crate debug;
-
 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);