10095: internal: Augment panic context when resolving path r=jonas-schievink a=jonas-schievink

Should help with debugging https://github.com/rust-analyzer/rust-analyzer/issues/10084 and similar issues.

Might have a perf impact since the string is created on every function call.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
bors[bot] 2021-08-31 12:47:33 +00:00 committed by GitHub
commit aa1cdc0cce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,6 +178,11 @@ impl DefMap {
path: &ModPath,
shadow: BuiltinShadowMode,
) -> ResolvePathResult {
let _cx = stdx::panic_context::enter(format!(
"DefMap {:?} {:?} path {}",
self.krate, self.block, path
));
let mut segments = path.segments().iter().enumerate();
let mut curr_per_ns: PerNs = match path.kind {
PathKind::DollarCrate(krate) => {