diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2022-02-09 17:20:43 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2022-02-20 18:58:22 -0500 |
| commit | c021ba48a70e69fa681ea6617512ae2028e2677a (patch) | |
| tree | a559aec34a2ed348bcd169d2a18021812213e1ae /compiler/rustc_query_system/src | |
| parent | a421b631ba0af42878250174e57ee25b8f7dbf03 (diff) | |
| download | rust-c021ba48a70e69fa681ea6617512ae2028e2677a.tar.gz rust-c021ba48a70e69fa681ea6617512ae2028e2677a.zip | |
Delete Decoder::read_struct
Diffstat (limited to 'compiler/rustc_query_system/src')
| -rw-r--r-- | compiler/rustc_query_system/src/dep_graph/serialized.rs | 41 |
1 files changed, 19 insertions, 22 deletions
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<opaque::Decoder<'a>>> Decodable<opaque::Decoder< let mut edge_list_data = Vec::with_capacity(edge_count); for _index in 0..node_count { - d.read_struct(|d| { - let dep_node: DepNode<K> = 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<K> = 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<_, _> = |
