Skip to content

Commit 4cc5aaa

Browse files
Protect error handler fields with single lock
This avoids concurrency-related bugs when locks are acquired for too short a time and similar cases.
1 parent 2a767ee commit 4cc5aaa

File tree

2 files changed

+207
-135
lines changed

2 files changed

+207
-135
lines changed

src/librustc/session/config/tests.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn test_can_print_warnings() {
8787
let registry = errors::registry::Registry::new(&[]);
8888
let (sessopts, _) = build_session_options_and_crate_config(&matches);
8989
let sess = build_session(sessopts, None, registry);
90-
assert!(!sess.diagnostic().flags.can_emit_warnings);
90+
assert!(!sess.diagnostic().can_emit_warnings());
9191
});
9292

9393
syntax::with_default_globals(|| {
@@ -97,15 +97,15 @@ fn test_can_print_warnings() {
9797
let registry = errors::registry::Registry::new(&[]);
9898
let (sessopts, _) = build_session_options_and_crate_config(&matches);
9999
let sess = build_session(sessopts, None, registry);
100-
assert!(sess.diagnostic().flags.can_emit_warnings);
100+
assert!(sess.diagnostic().can_emit_warnings());
101101
});
102102

103103
syntax::with_default_globals(|| {
104104
let matches = optgroups().parse(&["-Adead_code".to_string()]).unwrap();
105105
let registry = errors::registry::Registry::new(&[]);
106106
let (sessopts, _) = build_session_options_and_crate_config(&matches);
107107
let sess = build_session(sessopts, None, registry);
108-
assert!(sess.diagnostic().flags.can_emit_warnings);
108+
assert!(sess.diagnostic().can_emit_warnings());
109109
});
110110
}
111111

0 commit comments

Comments
 (0)