about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/attr_wrapper.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-07-12 15:47:16 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-07-19 15:25:54 +1000
commit757f73f506a48ff96de54c0cb8c79a25ffbc70d9 (patch)
treef92ed5e6ac886abff68e4bd18955dc3dc918c5b7 /compiler/rustc_parse/src/parser/attr_wrapper.rs
parent3d68afc9e821b00d59058abc9bda670b07639955 (diff)
downloadrust-757f73f506a48ff96de54c0cb8c79a25ffbc70d9.tar.gz
rust-757f73f506a48ff96de54c0cb8c79a25ffbc70d9.zip
Simplify `CaptureState::inner_attr_ranges`.
The `Option`s within the `ReplaceRange`s within the hashmap are always
`None`. This PR omits them and inserts them when they are extracted from
the hashmap.
Diffstat (limited to 'compiler/rustc_parse/src/parser/attr_wrapper.rs')
-rw-r--r--compiler/rustc_parse/src/parser/attr_wrapper.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/attr_wrapper.rs b/compiler/rustc_parse/src/parser/attr_wrapper.rs
index 7e56e92f87b..efe9c55f523 100644
--- a/compiler/rustc_parse/src/parser/attr_wrapper.rs
+++ b/compiler/rustc_parse/src/parser/attr_wrapper.rs
@@ -260,7 +260,7 @@ impl<'a> Parser<'a> {
         // Take the captured ranges for any inner attributes that we parsed.
         for inner_attr in ret.attrs().iter().filter(|a| a.style == ast::AttrStyle::Inner) {
             if let Some(attr_range) = self.capture_state.inner_attr_ranges.remove(&inner_attr.id) {
-                inner_attr_replace_ranges.push(attr_range);
+                inner_attr_replace_ranges.push((attr_range, None));
             } else {
                 self.dcx().span_delayed_bug(inner_attr.span, "Missing token range for attribute");
             }