1 use std::error; 2 use std::fmt; 3 4 /// Returned when borrowing fails. 5 #[derive(Debug)] 6 pub struct InvalidThreadAccess; 7 8 impl fmt::Display for InvalidThreadAccess { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result9 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 10 write!(f, "fragile value accessed from foreign thread") 11 } 12 } 13 14 impl error::Error for InvalidThreadAccess {} 15