about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_parse/src/parser/mod.rs')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 2e1a61e634e..20515b36fa1 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -37,6 +37,7 @@ use rustc_errors::{
 use rustc_session::parse::ParseSess;
 use rustc_span::source_map::{Span, DUMMY_SP};
 use rustc_span::symbol::{kw, sym, Ident, Symbol};
+use rustc_span::BytePos;
 use std::ops::Range;
 use std::{cmp, mem, slice};
 use thin_vec::ThinVec;
@@ -157,12 +158,17 @@ pub struct Parser<'a> {
     /// Whether the parser is allowed to do recovery.
     /// This is disabled when parsing macro arguments, see #103534
     pub recovery: Recovery,
+    /// The low part of a ternary operator (`cond ? then : else`).
+    /// FIXME(Centri3): This is currently only used so that type ascription is
+    /// not mentioned in the error. Once the error in `stmt.rs` is removed, this
+    /// can be removed.
+    maybe_ternary_lo: Option<BytePos>,
 }
 
 // This type is used a lot, e.g. it's cloned when matching many declarative macro rules with nonterminals. Make sure
 // it doesn't unintentionally get bigger.
 #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
-rustc_data_structures::static_assert_size!(Parser<'_>, 272);
+rustc_data_structures::static_assert_size!(Parser<'_>, 280);
 
 /// Stores span information about a closure.
 #[derive(Clone)]
@@ -475,6 +481,7 @@ impl<'a> Parser<'a> {
             },
             current_closure: None,
             recovery: Recovery::Allowed,
+            maybe_ternary_lo: None,
         };
 
         // Make parser point to the first token.