cleanup: Remove outdated comment and logic of thir_body
This commit is contained in:
parent
fbab78289d
commit
15a71b64b8
2 changed files with 1 additions and 5 deletions
|
@ -463,7 +463,7 @@ rustc_queries! {
|
||||||
separate_provide_extern
|
separate_provide_extern
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fetch the THIR for a given body. If typeck for that body failed, returns an empty `Thir`.
|
/// Fetch the THIR for a given body.
|
||||||
query thir_body(key: LocalDefId) -> Result<(&'tcx Steal<thir::Thir<'tcx>>, thir::ExprId), ErrorGuaranteed> {
|
query thir_body(key: LocalDefId) -> Result<(&'tcx Steal<thir::Thir<'tcx>>, thir::ExprId), ErrorGuaranteed> {
|
||||||
// Perf tests revealed that hashing THIR is inefficient (see #85729).
|
// Perf tests revealed that hashing THIR is inefficient (see #85729).
|
||||||
no_hash
|
no_hash
|
||||||
|
|
|
@ -1005,10 +1005,6 @@ pub(crate) fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
|
||||||
// Runs all other queries that depend on THIR.
|
// Runs all other queries that depend on THIR.
|
||||||
tcx.ensure_with_value().mir_built(def);
|
tcx.ensure_with_value().mir_built(def);
|
||||||
let thir = &thir.steal();
|
let thir = &thir.steal();
|
||||||
// If `thir` is empty, a type error occurred, skip this body.
|
|
||||||
if thir.exprs.is_empty() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let hir_id = tcx.local_def_id_to_hir_id(def);
|
let hir_id = tcx.local_def_id_to_hir_id(def);
|
||||||
let safety_context = tcx.hir().fn_sig_by_hir_id(hir_id).map_or(SafetyContext::Safe, |fn_sig| {
|
let safety_context = tcx.hir().fn_sig_by_hir_id(hir_id).map_or(SafetyContext::Safe, |fn_sig| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue