-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Currently, rustc always hides the panic backtrace when a proc-macro panics:
rust/library/proc_macro/src/bridge/client.rs
Lines 308 to 322 in 1e99138
// Hide the default panic output within `proc_macro` expansions. | |
// NB. the server can't do this because it may use a different libstd. | |
static HIDE_PANICS_DURING_EXPANSION: Once = Once::new(); | |
HIDE_PANICS_DURING_EXPANSION.call_once(|| { | |
let prev = panic::take_hook(); | |
panic::set_hook(Box::new(move |info| { | |
let hide = BridgeState::with(|state| match state { | |
BridgeState::NotConnected => false, | |
BridgeState::Connected(_) | BridgeState::InUse => true, | |
}); | |
if !hide { | |
prev(info) | |
} | |
})); | |
}); |
It would be useful to able to set an environment variable or command-line argument to override this behavior.
stepancheg
Metadata
Metadata
Assignees
Labels
A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.