]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/dst-index.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / dst-index.rs
index 6f8574ccfa2144e1066752b87baeeb0143ca60d3..0c7ecfcefff34bcdc9bcf3cac4e53fd5eefe9dad 100644 (file)
@@ -12,7 +12,7 @@
 // work and don't ICE.
 
 use std::ops::Index;
-use std::fmt::Show;
+use std::fmt::Debug;
 
 struct S;
 
@@ -27,15 +27,16 @@ fn index<'a>(&'a self, _: &uint) -> &'a str {
 struct T;
 
 impl Index<uint> for T {
-    type Output = Show + 'static;
+    type Output = Debug + 'static;
 
-    fn index<'a>(&'a self, idx: &uint) -> &'a (Show + 'static) {
-        static x: uint = 42;
-        &x
+    fn index<'a>(&'a self, idx: &uint) -> &'a (Debug + 'static) {
+        static X: uint = 42;
+        &X as &(Debug + 'static)
     }
 }
 
 fn main() {
     assert_eq!(&S[0], "hello");
-    assert_eq!(format!("{:?}", &T[0]), "42u");
+    &T[0];
+    // let x = &x as &Debug;
 }