]> 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 151d00eb2d02b0619e5ff24f87bf608ecc5785d5..9d5f8576c633ee83a31c6bf78f33778135c4cf83 100644 (file)
@@ -8,29 +8,31 @@
 // 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);