File tree 2 files changed +12
-10
lines changed
2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -697,13 +697,6 @@ pub fn phase_1_parse_input<'a>(
697
697
hir_stats:: print_ast_stats ( & krate, "PRE EXPANSION AST STATS" ) ;
698
698
}
699
699
700
- // Add all buffered lints from the `ParseSess` to the `Session`.
701
- let mut parse_sess_buffered = sess. parse_sess . buffered_lints . borrow_mut ( ) ;
702
- for BufferedEarlyLint { id, span, msg, lint_id} in parse_sess_buffered. drain ( ..) {
703
- let lint = lint:: Lint :: from_parser_lint_id ( lint_id) ;
704
- sess. buffer_lint ( lint, id, span, & msg) ;
705
- }
706
-
707
700
Ok ( krate)
708
701
}
709
702
@@ -1074,6 +1067,15 @@ where
1074
1067
)
1075
1068
} ) ;
1076
1069
1070
+ // Add all buffered lints from the `ParseSess` to the `Session`.
1071
+ sess. parse_sess . buffered_lints . with_lock ( |buffered_lints| {
1072
+ info ! ( "{} parse sess buffered_lints" , buffered_lints. len( ) ) ;
1073
+ for BufferedEarlyLint { id, span, msg, lint_id} in buffered_lints. drain ( ..) {
1074
+ let lint = lint:: Lint :: from_parser_lint_id ( lint_id) ;
1075
+ sess. buffer_lint ( lint, id, span, & msg) ;
1076
+ }
1077
+ } ) ;
1078
+
1077
1079
// Done with macro expansion!
1078
1080
1079
1081
after_expand ( & krate) ?;
Original file line number Diff line number Diff line change @@ -96,14 +96,14 @@ impl ParseSess {
96
96
id : NodeId ,
97
97
msg : & str ,
98
98
) {
99
- self . buffered_lints
100
- . borrow_mut ( )
101
- . push ( BufferedEarlyLint {
99
+ self . buffered_lints . with_lock ( |buffered_lints| {
100
+ buffered_lints. push ( BufferedEarlyLint {
102
101
span : span. into ( ) ,
103
102
id,
104
103
msg : msg. into ( ) ,
105
104
lint_id,
106
105
} ) ;
106
+ } ) ;
107
107
}
108
108
}
109
109
You can’t perform that action at this time.
0 commit comments