get rid of normalize_generic_arg... queries
This commit is contained in:
parent
8250eef685
commit
399ab40dbd
@ -1658,27 +1658,6 @@
|
||||
remap_env_constness
|
||||
}
|
||||
|
||||
// FIXME: Implement `normalize_generic_arg_after_erasing_regions` and
|
||||
// `normalize_mir_const_after_erasing_regions` in terms of
|
||||
// `try_normalize_generic_arg_after_erasing_regions` and
|
||||
// `try_normalize_mir_const_after_erasing_regions`, respectively.
|
||||
|
||||
/// Do not call this query directly: invoke `normalize_erasing_regions` instead.
|
||||
query normalize_generic_arg_after_erasing_regions(
|
||||
goal: ParamEnvAnd<'tcx, GenericArg<'tcx>>
|
||||
) -> GenericArg<'tcx> {
|
||||
desc { "normalizing `{}`", goal.value }
|
||||
remap_env_constness
|
||||
}
|
||||
|
||||
/// Do not call this query directly: invoke `normalize_erasing_regions` instead.
|
||||
query normalize_mir_const_after_erasing_regions(
|
||||
goal: ParamEnvAnd<'tcx, mir::ConstantKind<'tcx>>
|
||||
) -> mir::ConstantKind<'tcx> {
|
||||
desc { "normalizing `{}`", goal.value }
|
||||
remap_env_constness
|
||||
}
|
||||
|
||||
/// Do not call this query directly: invoke `try_normalize_erasing_regions` instead.
|
||||
query try_normalize_generic_arg_after_erasing_regions(
|
||||
goal: ParamEnvAnd<'tcx, GenericArg<'tcx>>
|
||||
|
@ -176,7 +176,10 @@ fn normalize_generic_arg_after_erasing_regions(
|
||||
let arg = self.param_env.and(arg);
|
||||
debug!(?arg);
|
||||
|
||||
self.tcx.normalize_generic_arg_after_erasing_regions(arg)
|
||||
self.tcx.try_normalize_generic_arg_after_erasing_regions(arg).unwrap_or_else(|_| bug!(
|
||||
"Failed to normalize {:?}, maybe try to call `try_normalize_erasing_regions` instead",
|
||||
arg.value
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,7 +200,9 @@ fn fold_const(&mut self, c: &'tcx ty::Const<'tcx>) -> &'tcx ty::Const<'tcx> {
|
||||
fn fold_mir_const(&mut self, c: mir::ConstantKind<'tcx>) -> mir::ConstantKind<'tcx> {
|
||||
// FIXME: This *probably* needs canonicalization too!
|
||||
let arg = self.param_env.and(c);
|
||||
self.tcx.normalize_mir_const_after_erasing_regions(arg)
|
||||
self.tcx
|
||||
.try_normalize_mir_const_after_erasing_regions(arg)
|
||||
.unwrap_or_else(|_| bug!("failed to normalize {:?}", c))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,30 +8,14 @@
|
||||
|
||||
crate fn provide(p: &mut Providers) {
|
||||
*p = Providers {
|
||||
normalize_generic_arg_after_erasing_regions: |tcx, goal| {
|
||||
debug!("normalize_generic_arg_after_erasing_regions(goal={:#?})", goal);
|
||||
try_normalize_generic_arg_after_erasing_regions: |tcx, goal| {
|
||||
debug!("try_normalize_generic_arg_after_erasing_regions(goal={:#?}", goal);
|
||||
|
||||
tcx.sess
|
||||
.perf_stats
|
||||
.normalize_generic_arg_after_erasing_regions
|
||||
.fetch_add(1, Ordering::Relaxed);
|
||||
|
||||
let (param_env, goal) = goal.into_parts();
|
||||
tcx.try_normalize_erasing_regions(param_env, goal).unwrap_or_else(|_| bug!(
|
||||
"Failed to normalize {:?}, maybe try to call `try_normalize_erasing_regions` instead",
|
||||
goal
|
||||
))
|
||||
},
|
||||
normalize_mir_const_after_erasing_regions: |tcx, goal| {
|
||||
let (param_env, goal) = goal.into_parts();
|
||||
tcx.try_normalize_erasing_regions(param_env, goal).unwrap_or_else(|_| bug!(
|
||||
"Failed to normalize {:?}, maybe try to call `try_normalize_erasing_regions` instead",
|
||||
goal
|
||||
))
|
||||
},
|
||||
try_normalize_generic_arg_after_erasing_regions: |tcx, goal| {
|
||||
debug!("try_normalize_generic_arg_after_erasing_regions(goal={:#?}", goal);
|
||||
|
||||
try_normalize_after_erasing_regions(tcx, goal)
|
||||
},
|
||||
try_normalize_mir_const_after_erasing_regions: |tcx, goal| {
|
||||
|
Loading…
Reference in New Issue
Block a user