Use a simpler atomic operation than the compare_exchange hammer
This commit is contained in:
@@ -1541,11 +1541,9 @@ pub(crate) fn make_unclosed_delims_error(
|
||||
}
|
||||
|
||||
pub fn emit_unclosed_delims(unclosed_delims: &mut Vec<UnmatchedDelim>, sess: &ParseSess) {
|
||||
let _ = sess.reached_eof.compare_exchange(
|
||||
false,
|
||||
let _ = sess.reached_eof.fetch_or(
|
||||
unclosed_delims.iter().any(|unmatched_delim| unmatched_delim.found_delim.is_none()),
|
||||
Ordering::Relaxed,
|
||||
Ordering::Relaxed,
|
||||
);
|
||||
for unmatched in unclosed_delims.drain(..) {
|
||||
if let Some(mut e) = make_unclosed_delims_error(unmatched, sess) {
|
||||
|
||||
Reference in New Issue
Block a user