@@ -1502,47 +1502,14 @@ impl fmt::Display for LoopIdError {
15021502 }
15031503}
15041504
1505- // FIXME(cramertj) this should use `Result` once master compiles w/ a vesion of Rust where
1506- // `Result` implements `Encodable`/`Decodable`
1507- #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug , Copy ) ]
1508- pub enum LoopIdResult {
1509- Ok ( NodeId ) ,
1510- Err ( LoopIdError ) ,
1511- }
1512- impl Into < Result < NodeId , LoopIdError > > for LoopIdResult {
1513- fn into ( self ) -> Result < NodeId , LoopIdError > {
1514- match self {
1515- LoopIdResult :: Ok ( ok) => Ok ( ok) ,
1516- LoopIdResult :: Err ( err) => Err ( err) ,
1517- }
1518- }
1519- }
1520- impl From < Result < NodeId , LoopIdError > > for LoopIdResult {
1521- fn from ( res : Result < NodeId , LoopIdError > ) -> Self {
1522- match res {
1523- Ok ( ok) => LoopIdResult :: Ok ( ok) ,
1524- Err ( err) => LoopIdResult :: Err ( err) ,
1525- }
1526- }
1527- }
1528-
1529- impl LoopIdResult {
1530- pub fn ok ( self ) -> Option < NodeId > {
1531- match self {
1532- LoopIdResult :: Ok ( node_id) => Some ( node_id) ,
1533- LoopIdResult :: Err ( _) => None ,
1534- }
1535- }
1536- }
1537-
15381505#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug , Copy ) ]
15391506pub struct Destination {
15401507 // This is `Some(_)` iff there is an explicit user-specified `label
15411508 pub label : Option < Label > ,
15421509
15431510 // These errors are caught and then reported during the diagnostics pass in
15441511 // librustc_passes/loops.rs
1545- pub target_id : LoopIdResult ,
1512+ pub target_id : Result < NodeId , LoopIdError > ,
15461513}
15471514
15481515#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug , Copy ) ]
0 commit comments