// Load up the hashes for the def-ids from this crate.
let mut decoder = Decoder::new(data, 0);
- let svh_in_hashes_file = try!(Svh::decode(&mut decoder));
+ let svh_in_hashes_file = Svh::decode(&mut decoder)?;
if svh_in_hashes_file != expected_svh {
// We should not be able to get here. If we do, then
bug!("mismatch between SVH in crate and SVH in incr. comp. hashes")
}
- let serialized_hashes = try!(SerializedMetadataHashes::decode(&mut decoder));
+ let serialized_hashes = SerializedMetadataHashes::decode(&mut decoder)?;
for serialized_hash in serialized_hashes.hashes {
// the hashes are stored with just a def-index, which is
// always relative to the old crate; convert that to use
{
// Decode the list of work_products
let mut work_product_decoder = Decoder::new(work_products_data, 0);
- let work_products = try!(<Vec<SerializedWorkProduct>>::decode(&mut work_product_decoder));
+ let work_products = <Vec<SerializedWorkProduct>>::decode(&mut work_product_decoder)?;
// Deserialize the directory and dep-graph.
let mut dep_graph_decoder = Decoder::new(dep_graph_data, 0);
- let prev_commandline_args_hash = try!(u64::decode(&mut dep_graph_decoder));
+ let prev_commandline_args_hash = u64::decode(&mut dep_graph_decoder)?;
if prev_commandline_args_hash != tcx.sess.opts.dep_tracking_hash() {
// We can't reuse the cache, purge it.
return Ok(());
}
- let directory = try!(DefIdDirectory::decode(&mut dep_graph_decoder));
- let serialized_dep_graph = try!(SerializedDepGraph::decode(&mut dep_graph_decoder));
+ let directory = DefIdDirectory::decode(&mut dep_graph_decoder)?;
+ let serialized_dep_graph = SerializedDepGraph::decode(&mut dep_graph_decoder)?;
// Retrace the paths in the directory to find their current location (if any).
let retraced = directory.retrace(tcx);
-> io::Result<()> {
// First encode the commandline arguments hash
let tcx = builder.tcx();
- try!(tcx.sess.opts.dep_tracking_hash().encode(encoder));
+ tcx.sess.opts.dep_tracking_hash().encode(encoder)?;
// Create a flat list of (Input, WorkProduct) edges for
// serialization.
debug!("graph = {:#?}", graph);
// Encode the directory and then the graph data.
- try!(builder.directory().encode(encoder));
- try!(graph.encode(encoder));
+ builder.directory().encode(encoder)?;
+ graph.encode(encoder)?;
Ok(())
}
}
// Encode everything.
- try!(svh.encode(encoder));
- try!(serialized_hashes.encode(encoder));
+ svh.encode(encoder)?;
+ serialized_hashes.encode(encoder)?;
Ok(())
}