Protect error handler fields with single lock
This avoids concurrency-related bugs when locks are acquired for too short a time and similar cases.
This commit is contained in:
parent
2a767eec0c
commit
4cc5aaada2
2 changed files with 214 additions and 142 deletions
|
|
@ -87,7 +87,7 @@ fn test_can_print_warnings() {
|
|||
let registry = errors::registry::Registry::new(&[]);
|
||||
let (sessopts, _) = build_session_options_and_crate_config(&matches);
|
||||
let sess = build_session(sessopts, None, registry);
|
||||
assert!(!sess.diagnostic().flags.can_emit_warnings);
|
||||
assert!(!sess.diagnostic().can_emit_warnings());
|
||||
});
|
||||
|
||||
syntax::with_default_globals(|| {
|
||||
|
|
@ -97,7 +97,7 @@ fn test_can_print_warnings() {
|
|||
let registry = errors::registry::Registry::new(&[]);
|
||||
let (sessopts, _) = build_session_options_and_crate_config(&matches);
|
||||
let sess = build_session(sessopts, None, registry);
|
||||
assert!(sess.diagnostic().flags.can_emit_warnings);
|
||||
assert!(sess.diagnostic().can_emit_warnings());
|
||||
});
|
||||
|
||||
syntax::with_default_globals(|| {
|
||||
|
|
@ -105,7 +105,7 @@ fn test_can_print_warnings() {
|
|||
let registry = errors::registry::Registry::new(&[]);
|
||||
let (sessopts, _) = build_session_options_and_crate_config(&matches);
|
||||
let sess = build_session(sessopts, None, registry);
|
||||
assert!(sess.diagnostic().flags.can_emit_warnings);
|
||||
assert!(sess.diagnostic().can_emit_warnings());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue