// work and don't ICE.
use std::ops::Index;
-use std::fmt::Show;
+use std::fmt::Debug;
struct S;
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;
}