change usages of const_param_default query to bound_const_param_default
This commit is contained in:
parent
c84917ad2e
commit
bd6c63597b
@ -1350,7 +1350,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
|
||||
// is incorrect when dealing with unused substs, for example
|
||||
// for `struct Foo<const N: usize, const M: usize = { 1 - 2 }>`
|
||||
// we should eagerly error.
|
||||
let default_ct = tcx.const_param_default(param.def_id);
|
||||
let default_ct = tcx.bound_const_param_default(param.def_id).subst_identity();
|
||||
if !default_ct.needs_subst() {
|
||||
wfcx.register_wf_obligation(
|
||||
tcx.def_span(param.def_id),
|
||||
@ -1396,7 +1396,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
|
||||
GenericParamDefKind::Const { .. } => {
|
||||
// If the param has a default, ...
|
||||
if is_our_default(param) {
|
||||
let default_ct = tcx.const_param_default(param.def_id);
|
||||
let default_ct = tcx.bound_const_param_default(param.def_id).subst_identity();
|
||||
// ... and it's not a dependent default, ...
|
||||
if !default_ct.needs_subst() {
|
||||
// ... then substitute it with the default.
|
||||
|
@ -2070,7 +2070,7 @@ fn encode_info_for_generics(&mut self, generics: &hir::Generics<'tcx>) {
|
||||
hir::GenericParamKind::Const { ref default, .. } => {
|
||||
let def_id = param.def_id.to_def_id();
|
||||
if default.is_some() {
|
||||
record!(self.tables.const_param_default[def_id] <- self.tcx.const_param_default(def_id))
|
||||
record!(self.tables.const_param_default[def_id] <- self.tcx.bound_const_param_default(def_id).subst_identity())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -838,7 +838,9 @@ fn generics(&mut self) -> &mut Self {
|
||||
GenericParamDefKind::Const { has_default } => {
|
||||
self.visit(self.ev.tcx.type_of(param.def_id));
|
||||
if has_default {
|
||||
self.visit(self.ev.tcx.const_param_default(param.def_id));
|
||||
self.visit(
|
||||
self.ev.tcx.bound_const_param_default(param.def_id).subst_identity(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -506,7 +506,9 @@ fn clean_generic_param_def<'tcx>(
|
||||
Some(def.def_id),
|
||||
)),
|
||||
default: match has_default {
|
||||
true => Some(Box::new(cx.tcx.const_param_default(def.def_id).to_string())),
|
||||
true => Some(Box::new(
|
||||
cx.tcx.bound_const_param_default(def.def_id).subst_identity().to_string(),
|
||||
)),
|
||||
false => None,
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user