提交 1fc3c4c1 编写于 作者: R Rémy Rakic

adjust const generics defaults FIXMEs to the new feature gate

上级 907ba75e
......@@ -774,7 +774,7 @@ fn validate_generic_param_order(
}
GenericParamKind::Type { default: None } => (),
GenericParamKind::Lifetime => (),
// FIXME(const_generics:defaults)
// FIXME(const_generics_defaults)
GenericParamKind::Const { ty: _, kw_span: _, default: _ } => (),
}
first = false;
......
......@@ -958,7 +958,7 @@ fn strip_generic_default_params(
ty::GenericParamDefKind::Type { has_default, .. } => {
Some((param.def_id, has_default))
}
ty::GenericParamDefKind::Const => None, // FIXME(const_generics:defaults)
ty::GenericParamDefKind::Const => None, // FIXME(const_generics_defaults)
})
.peekable();
let has_default = {
......
......@@ -1834,7 +1834,7 @@ fn encode_info_for_generics(&mut self, generics: &hir::Generics<'tcx>) {
EntryKind::ConstParam,
true,
);
// FIXME(const_generics:defaults)
// FIXME(const_generics_defaults)
}
}
}
......
......@@ -203,7 +203,7 @@ fn generic_args_to_print(
self.tcx().type_of(param.def_id).subst(self.tcx(), substs),
)
}
ty::GenericParamDefKind::Const => false, // FIXME(const_generics:defaults)
ty::GenericParamDefKind::Const => false, // FIXME(const_generics_defaults)
}
})
.count();
......
......@@ -443,7 +443,7 @@ fn visit_macro_def(&mut self, md: &'tcx hir::MacroDef<'tcx>) {
fn visit_generic_param(&mut self, p: &'tcx hir::GenericParam<'tcx>) {
let kind = match &p.kind {
// FIXME(const_generics:defaults)
// FIXME(const_generics_defaults)
hir::GenericParamKind::Type { default, .. } if default.is_some() => {
AnnotationKind::Container
}
......
......@@ -214,7 +214,7 @@ enum ResolutionError<'a> {
/// Error E0530: `X` bindings cannot shadow `Y`s.
BindingShadowsSomethingUnacceptable(&'static str, Symbol, &'a NameBinding<'a>),
/// Error E0128: type parameters with a default cannot use forward-declared identifiers.
ForwardDeclaredTyParam, // FIXME(const_generics:defaults)
ForwardDeclaredTyParam, // FIXME(const_generics_defaults)
/// ERROR E0770: the type of const parameters must not depend on other generic parameters.
ParamInTyOfConstParam(Symbol),
/// constant values inside of type parameter defaults must not depend on generic parameters.
......
......@@ -387,7 +387,7 @@ pub(crate) fn check_generic_arg_count(
defaults.types += has_default as usize
}
GenericParamDefKind::Const => {
// FIXME(const_generics:defaults)
// FIXME(const_generics_defaults)
}
};
}
......
......@@ -486,7 +486,7 @@ fn inferred_kind(
}
GenericParamDefKind::Const => {
let ty = tcx.at(self.span).type_of(param.def_id);
// FIXME(const_generics:defaults)
// FIXME(const_generics_defaults)
if infer_args {
// No const parameters were provided, we can infer all.
self.astconv.ct_infer(ty, Some(param), self.span).into()
......
......@@ -1376,7 +1376,7 @@ fn inferred_kind(
}
}
GenericParamDefKind::Const => {
// FIXME(const_generics:defaults)
// FIXME(const_generics_defaults)
// No const parameters were provided, we have to infer them.
self.fcx.var_for_def(self.span, param)
}
......
......@@ -785,7 +785,7 @@ fn check_where_clauses<'tcx, 'fcx>(
}
GenericParamDefKind::Const => {
// FIXME(const_generics:defaults)
// FIXME(const_generics_defaults)
fcx.tcx.mk_param_from_def(param)
}
}
......
......@@ -228,7 +228,7 @@ fn visit_generics(&mut self, generics: &'tcx hir::Generics<'tcx>) {
hir::GenericParamKind::Const { .. } => {
let def_id = self.tcx.hir().local_def_id(param.hir_id);
self.tcx.ensure().type_of(def_id);
// FIXME(const_generics:defaults)
// FIXME(const_generics_defaults)
}
}
}
......
......@@ -612,7 +612,7 @@ fn clean(&self, cx: &DocContext<'_>) -> GenericParamDef {
GenericParamDefKind::Const {
did: cx.tcx.hir().local_def_id(self.hir_id).to_def_id(),
ty: ty.clean(cx),
// FIXME(const_generics_defaults): add `default` field here to the docs
// FIXME(const_generics_defaults): add `default` field here for docs
},
),
};
......@@ -1386,7 +1386,7 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &DocContext<'_>) -> Type {
if let Some(ct) = const_ {
ct_substs.insert(const_param_def_id.to_def_id(), ct.clean(cx));
}
// FIXME(const_generics:defaults)
// FIXME(const_generics_defaults)
indices.consts += 1;
}
}
......
......@@ -7,7 +7,7 @@
//[full]~^ ERROR constant values inside of type parameter defaults
//[min]~^^ ERROR generic parameters may not be used in const operations
// FIXME(const_generics:defaults): We still don't know how to we deal with type defaults.
// FIXME(const_generics_defaults): We still don't know how to deal with type defaults.
struct Bar<T = [u8; N], const N: usize>(T);
//~^ ERROR constant values inside of type parameter defaults
//~| ERROR type parameters with a default
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册