File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
rustc_data_structures/src Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,14 @@ cfg_if! {
107107 }
108108 }
109109
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+
110118 impl <T : Copy + PartialEq > Atomic <T > {
111119 #[ inline]
112120 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(
15411541}
15421542
15431543pub 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 (
15461545 unclosed_delims. iter ( ) . any ( |unmatched_delim| unmatched_delim. found_delim . is_none ( ) ) ,
15471546 Ordering :: Relaxed ,
1548- Ordering :: Relaxed ,
15491547 ) ;
15501548 for unmatched in unclosed_delims. drain ( ..) {
15511549 if let Some ( mut e) = make_unclosed_delims_error ( unmatched, sess) {
You can’t perform that action at this time.
0 commit comments