mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-04 19:28:29 +00:00

`tcx.def_kind()` could theoretically invoke another query, which could cause an infinite query loop. Accessing the HIR map directly makes that less likely to happen. I also changed it to use `as_local()` (`tcx.def_kind()` seems to implicitly call `expect_local()`) and `opt_def_kind()` to reduce the chance of panicking on valid code.