unsafety_check_result_for_const_arg

This commit is contained in:
Bastian Kauschke 2020-07-15 11:26:26 +02:00
parent aca66bd052
commit e070b45e6a
3 changed files with 4 additions and 4 deletions

View File

@ -501,7 +501,7 @@ rustc_queries! {
desc { |tcx| "unsafety-checking `{}`", tcx.def_path_str(key.to_def_id()) } desc { |tcx| "unsafety-checking `{}`", tcx.def_path_str(key.to_def_id()) }
cache_on_disk_if { true } cache_on_disk_if { true }
} }
query unsafety_check_result_const_arg(key: (LocalDefId, DefId)) -> &'tcx mir::UnsafetyCheckResult { query unsafety_check_result_for_const_arg(key: (LocalDefId, DefId)) -> &'tcx mir::UnsafetyCheckResult {
desc { desc {
|tcx| "unsafety-checking the const argument `{}`", |tcx| "unsafety-checking the const argument `{}`",
tcx.def_path_str(key.0.to_def_id()) tcx.def_path_str(key.0.to_def_id())

View File

@ -493,7 +493,7 @@ pub(crate) fn provide(providers: &mut Providers) {
unsafety_check_result: |tcx, def_id| { unsafety_check_result: |tcx, def_id| {
unsafety_check_result(tcx, ty::WithOptConstParam::unknown(def_id)) unsafety_check_result(tcx, ty::WithOptConstParam::unknown(def_id))
}, },
unsafety_check_result_const_arg: |tcx, (did, param_did)| { unsafety_check_result_for_const_arg: |tcx, (did, param_did)| {
unsafety_check_result( unsafety_check_result(
tcx, tcx,
ty::WithOptConstParam { did, const_param_did: Some(param_did) }, ty::WithOptConstParam { did, const_param_did: Some(param_did) },
@ -553,7 +553,7 @@ fn unsafety_check_result<'tcx>(
) -> &'tcx UnsafetyCheckResult { ) -> &'tcx UnsafetyCheckResult {
if def.const_param_did.is_none() { if def.const_param_did.is_none() {
if let Some(param_did) = tcx.opt_const_param_of(def.did) { if let Some(param_did) = tcx.opt_const_param_of(def.did) {
return tcx.unsafety_check_result_const_arg((def.did, param_did)); return tcx.unsafety_check_result_for_const_arg((def.did, param_did));
} }
} }

View File

@ -274,7 +274,7 @@ fn mir_const<'tcx>(
// Unsafety check uses the raw mir, so make sure it is run. // Unsafety check uses the raw mir, so make sure it is run.
if let Some(param_did) = def.const_param_did { if let Some(param_did) = def.const_param_did {
tcx.ensure().unsafety_check_result_const_arg((def.did, param_did)); tcx.ensure().unsafety_check_result_for_const_arg((def.did, param_did));
} else { } else {
tcx.ensure().unsafety_check_result(def.did); tcx.ensure().unsafety_check_result(def.did);
} }