File tree 2 files changed +9
-3
lines changed
rustc_data_structures/src
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,14 @@ cfg_if! {
107
107
}
108
108
}
109
109
110
+ impl Atomic <bool > {
111
+ pub fn fetch_or( & self , val: bool , _: Ordering ) -> bool {
112
+ let result = self . 0 . get( ) | val;
113
+ self . 0 . set( val) ;
114
+ result
115
+ }
116
+ }
117
+
110
118
impl <T : Copy + PartialEq > Atomic <T > {
111
119
#[ inline]
112
120
pub fn compare_exchange( & self ,
Original file line number Diff line number Diff line change @@ -1541,11 +1541,9 @@ pub(crate) fn make_unclosed_delims_error(
1541
1541
}
1542
1542
1543
1543
pub fn emit_unclosed_delims ( unclosed_delims : & mut Vec < UnmatchedDelim > , sess : & ParseSess ) {
1544
- let _ = sess. reached_eof . compare_exchange (
1545
- false ,
1544
+ let _ = sess. reached_eof . fetch_or (
1546
1545
unclosed_delims. iter ( ) . any ( |unmatched_delim| unmatched_delim. found_delim . is_none ( ) ) ,
1547
1546
Ordering :: Relaxed ,
1548
- Ordering :: Relaxed ,
1549
1547
) ;
1550
1548
for unmatched in unclosed_delims. drain ( ..) {
1551
1549
if let Some ( mut e) = make_unclosed_delims_error ( unmatched, sess) {
You can’t perform that action at this time.
0 commit comments