mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
adjust const generics defaults FIXMEs to the new feature gate
This commit is contained in:
parent
907ba75eb0
commit
1fc3c4c16d
@ -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 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||
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 @@ impl EncodeContext<'a, 'tcx> {
|
||||
EntryKind::ConstParam,
|
||||
true,
|
||||
);
|
||||
// FIXME(const_generics:defaults)
|
||||
// FIXME(const_generics_defaults)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ pub trait Printer<'tcx>: Sized {
|
||||
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 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, '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 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
defaults.types += has_default as usize
|
||||
}
|
||||
GenericParamDefKind::Const => {
|
||||
// FIXME(const_generics:defaults)
|
||||
// FIXME(const_generics_defaults)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
}
|
||||
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 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
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 @@ impl Visitor<'tcx> for CollectItemTypesVisitor<'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 @@ impl Clean<GenericParamDef> for hir::GenericParam<'_> {
|
||||
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 @@ struct Foo<T, U = [u8; std::mem::size_of::<T>()]>(T, U);
|
||||
//[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
|
||||
|
Loading…
Reference in New Issue
Block a user