]>
git.proxmox.com Git - rustc.git/blob - vendor/proc-macro-error/src/imp/fallback.rs
1 //! This implementation uses self-written stable facilities.
4 abort_now
, check_correctness
,
5 diagnostic
::{Diagnostic, Level}
,
7 use std
::cell
::RefCell
;
9 pub fn abort_if_dirty() {
11 ERR_STORAGE
.with(|storage
| {
12 if !storage
.borrow().is_empty() {
18 pub(crate) fn cleanup() -> Vec
<Diagnostic
> {
19 ERR_STORAGE
.with(|storage
| storage
.replace(Vec
::new()))
22 pub(crate) fn emit_diagnostic(diag
: Diagnostic
) {
23 if diag
.level
== Level
::Error
{
24 ERR_STORAGE
.with(|storage
| storage
.borrow_mut().push(diag
));
29 static ERR_STORAGE
: RefCell
<Vec
<Diagnostic
>> = RefCell
::new(Vec
::new());