about summary refs log tree commit diff
path: root/compiler/rustc_parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-02 23:39:25 +0000
committerbors <bors@rust-lang.org>2022-04-02 23:39:25 +0000
commitc1550e3f8c57b0ebb0edb3a7ea64727e668f669c (patch)
tree9dd00bf58606e2c3c98f2b2d18cd41fca19d92e3 /compiler/rustc_parse
parent76d770ac21d9521db6a92a48c7b3d5b2cc535941 (diff)
parent732ed2adc816eb600eac33a4cfcd2095c43be4f7 (diff)
downloadrust-c1550e3f8c57b0ebb0edb3a7ea64727e668f669c.tar.gz
rust-c1550e3f8c57b0ebb0edb3a7ea64727e668f669c.zip
Auto merge of #95590 - GuillaumeGomez:multi-line-attr-handling-doctest, r=notriddle
Fix multiline attributes handling in doctests

Fixes #55713.

I needed to have access to the `unclosed_delims` field in order to check that the attribute was completely parsed and didn't have missing parts, so I created a getter for it.

r? `@notriddle`
Diffstat (limited to 'compiler/rustc_parse')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 8f64d6d732f..0bbbd3a32c4 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -210,6 +210,10 @@ impl<'a> Parser<'a> {
         self.unclosed_delims.extend(snapshot.unclosed_delims.clone());
     }
 
+    pub fn unclosed_delims(&self) -> &[UnmatchedBrace] {
+        &self.unclosed_delims
+    }
+
     /// Create a snapshot of the `Parser`.
     pub(super) fn create_snapshot_for_diagnostic(&self) -> SnapshotParser<'a> {
         let mut snapshot = self.clone();