diff options
| author | bors <bors@rust-lang.org> | 2023-08-15 01:31:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-08-15 01:31:56 +0000 |
| commit | ffaa32b7b646c208f20c827655bb98ff9868852e (patch) | |
| tree | a631a0e56dcd1d809cdf5ae2ff1c8451ecbb6537 /compiler/rustc_parse/src | |
| parent | 3276b29ddbe080946d3a4813c13ce1785c2f1c30 (diff) | |
| parent | 223c43b154690d6368a26faa1dfc68d9a70cb5a0 (diff) | |
| download | rust-ffaa32b7b646c208f20c827655bb98ff9868852e.tar.gz rust-ffaa32b7b646c208f20c827655bb98ff9868852e.zip | |
Auto merge of #114803 - bjorn3:less_session_mutable_state, r=fee1-dead
Couple of global state and driver refactors * Remove some unused global mutable state * Remove a couple of unnecessary queries (both driver and `TyCtxt` queries) * Remove an unnecessary use of `FxIndexMap`
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/lexer/mod.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 13 |
2 files changed, 0 insertions, 14 deletions
diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index 1931ee5e528..a375a1d69cd 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -74,7 +74,6 @@ pub(crate) fn parse_token_trees<'a>( // because the delimiter mismatch is more likely to be the root cause of error let mut buffer = Vec::with_capacity(1); - // Not using `emit_unclosed_delims` to use `db.buffer` for unmatched in unmatched_delims { if let Some(err) = make_unclosed_delims_error(unmatched, &sess) { err.buffer(&mut buffer); diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index c5b46b809b1..ce4d4a60551 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -29,7 +29,6 @@ use rustc_ast::{Async, AttrArgs, AttrArgsEq, Expr, ExprKind, Mutability, StrLit} use rustc_ast::{HasAttrs, HasTokens, Unsafe, Visibility, VisibilityKind}; use rustc_ast_pretty::pprust; use rustc_data_structures::fx::FxHashMap; -use rustc_data_structures::sync::Ordering; use rustc_errors::PResult; use rustc_errors::{ Applicability, DiagnosticBuilder, ErrorGuaranteed, FatalError, IntoDiagnostic, MultiSpan, @@ -1455,18 +1454,6 @@ pub(crate) fn make_unclosed_delims_error( Some(err) } -pub fn emit_unclosed_delims(unclosed_delims: &mut Vec<UnmatchedDelim>, sess: &ParseSess) { - let _ = sess.reached_eof.fetch_or( - unclosed_delims.iter().any(|unmatched_delim| unmatched_delim.found_delim.is_none()), - Ordering::Relaxed, - ); - for unmatched in unclosed_delims.drain(..) { - if let Some(mut e) = make_unclosed_delims_error(unmatched, sess) { - e.emit(); - } - } -} - /// A helper struct used when building an `AttrTokenStream` from /// a `LazyAttrTokenStream`. Both delimiter and non-delimited tokens /// are stored as `FlatToken::Token`. A vector of `FlatToken`s |
