From c021ba48a70e69fa681ea6617512ae2028e2677a Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Wed, 9 Feb 2022 17:20:43 -0500 Subject: Delete Decoder::read_struct --- .../rustc_query_system/src/dep_graph/serialized.rs | 41 ++++++++++------------ 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'compiler/rustc_query_system/src') diff --git a/compiler/rustc_query_system/src/dep_graph/serialized.rs b/compiler/rustc_query_system/src/dep_graph/serialized.rs index c95dff13d66..8c85605c030 100644 --- a/compiler/rustc_query_system/src/dep_graph/serialized.rs +++ b/compiler/rustc_query_system/src/dep_graph/serialized.rs @@ -122,29 +122,26 @@ impl<'a, K: DepKind + Decodable>> Decodable = d.read_struct_field("node", Decodable::decode); - let _i: SerializedDepNodeIndex = nodes.push(dep_node); - debug_assert_eq!(_i.index(), _index); - - let fingerprint: Fingerprint = - d.read_struct_field("fingerprint", Decodable::decode); - let _i: SerializedDepNodeIndex = fingerprints.push(fingerprint); - debug_assert_eq!(_i.index(), _index); - - d.read_struct_field("edges", |d| { - d.read_seq(|d, len| { - let start = edge_list_data.len().try_into().unwrap(); - for _ in 0..len { - let edge = d.read_seq_elt(Decodable::decode); - edge_list_data.push(edge); - } - let end = edge_list_data.len().try_into().unwrap(); - let _i: SerializedDepNodeIndex = edge_list_indices.push((start, end)); - debug_assert_eq!(_i.index(), _index); - }) + let dep_node: DepNode = d.read_struct_field("node", Decodable::decode); + let _i: SerializedDepNodeIndex = nodes.push(dep_node); + debug_assert_eq!(_i.index(), _index); + + let fingerprint: Fingerprint = d.read_struct_field("fingerprint", Decodable::decode); + let _i: SerializedDepNodeIndex = fingerprints.push(fingerprint); + debug_assert_eq!(_i.index(), _index); + + d.read_struct_field("edges", |d| { + d.read_seq(|d, len| { + let start = edge_list_data.len().try_into().unwrap(); + for _ in 0..len { + let edge = d.read_seq_elt(Decodable::decode); + edge_list_data.push(edge); + } + let end = edge_list_data.len().try_into().unwrap(); + let _i: SerializedDepNodeIndex = edge_list_indices.push((start, end)); + debug_assert_eq!(_i.index(), _index); }) - }); + }) } let index: FxHashMap<_, _> = -- cgit 1.4.1-3-g733a5