minor effects cleanups

This commit is contained in:
Deadbeef 2024-07-31 03:29:10 +00:00
parent 249cf71f11
commit ec77db83b2
2 changed files with 0 additions and 27 deletions

View File

@ -1668,7 +1668,6 @@ fn lower_generics<T>(
}), }),
)), )),
)), )),
// FIXME(effects) we might not need a default.
default: Some(default_ct), default: Some(default_ct),
is_host_effect: true, is_host_effect: true,
synthetic: true, synthetic: true,

View File

@ -253,32 +253,6 @@ pub fn lower_generic_args<'tcx: 'a, 'a>(
match (args_iter.peek(), params.peek()) { match (args_iter.peek(), params.peek()) {
(Some(&arg), Some(&param)) => { (Some(&arg), Some(&param)) => {
match (arg, &param.kind, arg_count.explicit_late_bound) { match (arg, &param.kind, arg_count.explicit_late_bound) {
(
GenericArg::Const(hir::ConstArg {
is_desugared_from_effects: true,
..
}),
GenericParamDefKind::Const { is_host_effect: false, .. }
| GenericParamDefKind::Type { .. }
| GenericParamDefKind::Lifetime,
_,
) => {
// FIXME(effects): this should be removed
// SPECIAL CASE FOR DESUGARED EFFECT PARAMS
// This comes from the following example:
//
// ```
// #[const_trait]
// pub trait PartialEq<Rhs: ?Sized = Self> {}
// impl const PartialEq for () {}
// ```
//
// Since this is a const impl, we need to insert a host arg at the end of
// `PartialEq`'s generics, but this errors since `Rhs` isn't specified.
// To work around this, we infer all arguments until we reach the host param.
args.push(ctx.inferred_kind(&args, param, infer_args));
params.next();
}
(GenericArg::Lifetime(_), GenericParamDefKind::Lifetime, _) (GenericArg::Lifetime(_), GenericParamDefKind::Lifetime, _)
| ( | (
GenericArg::Type(_) | GenericArg::Infer(_), GenericArg::Type(_) | GenericArg::Infer(_),