Use question_mark feature in librustc_incremental.
This commit is contained in:
parent
8391760bd8
commit
8a9e52a8e7
@ -194,7 +194,7 @@ impl<'a, 'tcx> HashContext<'a, 'tcx> {
|
||||
|
||||
// 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
|
||||
@ -202,7 +202,7 @@ impl<'a, 'tcx> HashContext<'a, 'tcx> {
|
||||
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
|
||||
|
@ -125,11 +125,11 @@ pub fn decode_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
{
|
||||
// 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.
|
||||
@ -142,8 +142,8 @@ pub fn decode_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
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);
|
||||
|
@ -110,7 +110,7 @@ pub fn encode_dep_graph(preds: &Predecessors,
|
||||
-> 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.
|
||||
@ -149,8 +149,8 @@ pub fn encode_dep_graph(preds: &Predecessors,
|
||||
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(())
|
||||
}
|
||||
@ -222,8 +222,8 @@ pub fn encode_metadata_hashes(tcx: TyCtxt,
|
||||
}
|
||||
|
||||
// Encode everything.
|
||||
try!(svh.encode(encoder));
|
||||
try!(serialized_hashes.encode(encoder));
|
||||
svh.encode(encoder)?;
|
||||
serialized_hashes.encode(encoder)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user