]> 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 6a69bfc248f16ec5794a31073657ebb1487f326c..0c7ecfcefff34bcdc9bcf3cac4e53fd5eefe9dad 100644 (file)
 // Test that overloaded index expressions with DST result types
 // work and don't ICE.
 
-#![feature(associated_types)]
-
 use std::ops::Index;
-use std::fmt::Show;
+use std::fmt::Debug;
 
 struct S;
 
@@ -29,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]).as_slice(), "42");
+    &T[0];
+    // let x = &x as &Debug;
 }