diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2021-08-29 19:02:47 -0700 |
|---|---|---|
| committer | Noah Lev <camelidcamel@gmail.com> | 2021-08-29 19:38:47 -0700 |
| commit | d96234bed72e1935d8ab9a0c7a7e70027c86ad77 (patch) | |
| tree | c0b80db73e86b736b4d6a2604f7e63de15de2d12 /compiler/rustc_query_impl/src/keys.rs | |
| parent | c3df8328241bc0b10a5a77fae532aec795869c20 (diff) | |
| download | rust-d96234bed72e1935d8ab9a0c7a7e70027c86ad77.tar.gz rust-d96234bed72e1935d8ab9a0c7a7e70027c86ad77.zip | |
Retrieve `DefKind` from HIR map to reduce chance of cycles
`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.
Diffstat (limited to 'compiler/rustc_query_impl/src/keys.rs')
0 files changed, 0 insertions, 0 deletions
