Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor effects cleanups #128424

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
}),
)),
)),
// FIXME(effects) we might not need a default.
default: Some(default_ct),
is_host_effect: true,
synthetic: true,
Expand Down
26 changes: 0 additions & 26 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,32 +253,6 @@ pub fn lower_generic_args<'tcx: 'a, 'a>(
match (args_iter.peek(), params.peek()) {
(Some(&arg), Some(&param)) => {
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::Type(_) | GenericArg::Infer(_),
Expand Down
Loading