Skip to content

Commit a6cacee

Browse files
Rollup merge of #128424 - fee1-dead-contrib:fx-clean, r=oli-obk
minor `effects` cleanups * remove the fixme comment about not needing defaults because it turns out we do need defaults (if I made it None instead it would ice a bunch of tests) * remove the part that special cased trait args when lowering them. This is now historical because effects doesn't add host args to traits anymore (we use associated types now)
2 parents 355eb9c + ec77db8 commit a6cacee

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

compiler/rustc_ast_lowering/src/item.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
16681668
}),
16691669
)),
16701670
)),
1671-
// FIXME(effects) we might not need a default.
16721671
default: Some(default_ct),
16731672
is_host_effect: true,
16741673
synthetic: true,

compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs

-26
Original file line numberDiff line numberDiff line change
@@ -253,32 +253,6 @@ pub fn lower_generic_args<'tcx: 'a, 'a>(
253253
match (args_iter.peek(), params.peek()) {
254254
(Some(&arg), Some(&param)) => {
255255
match (arg, &param.kind, arg_count.explicit_late_bound) {
256-
(
257-
GenericArg::Const(hir::ConstArg {
258-
is_desugared_from_effects: true,
259-
..
260-
}),
261-
GenericParamDefKind::Const { is_host_effect: false, .. }
262-
| GenericParamDefKind::Type { .. }
263-
| GenericParamDefKind::Lifetime,
264-
_,
265-
) => {
266-
// FIXME(effects): this should be removed
267-
// SPECIAL CASE FOR DESUGARED EFFECT PARAMS
268-
// This comes from the following example:
269-
//
270-
// ```
271-
// #[const_trait]
272-
// pub trait PartialEq<Rhs: ?Sized = Self> {}
273-
// impl const PartialEq for () {}
274-
// ```
275-
//
276-
// Since this is a const impl, we need to insert a host arg at the end of
277-
// `PartialEq`'s generics, but this errors since `Rhs` isn't specified.
278-
// To work around this, we infer all arguments until we reach the host param.
279-
args.push(ctx.inferred_kind(&args, param, infer_args));
280-
params.next();
281-
}
282256
(GenericArg::Lifetime(_), GenericParamDefKind::Lifetime, _)
283257
| (
284258
GenericArg::Type(_) | GenericArg::Infer(_),

0 commit comments

Comments
 (0)