diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-08-07 15:59:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-07 15:59:35 +0200 |
| commit | a6caceee4d32a00aaa6b572a302060a6ffecfa17 (patch) | |
| tree | f05c9ab20b56efbf63fd38abb0b4246f17b2b08a | |
| parent | 355eb9c79fed8895c7f96cb401e254696375955e (diff) | |
| parent | ec77db83b2de7e8c3a7f3629b7b453b8539c7bfa (diff) | |
| download | rust-a6caceee4d32a00aaa6b572a302060a6ffecfa17.tar.gz rust-a6caceee4d32a00aaa6b572a302060a6ffecfa17.zip | |
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)
| -rw-r--r-- | compiler/rustc_ast_lowering/src/item.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs | 26 |
2 files changed, 0 insertions, 27 deletions
diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index 1456890a0a2..7af3945d3f9 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -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, diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs index 034a4918b50..a59e9aa85fd 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs @@ -253,32 +253,6 @@ pub fn lower_generic_args<'tcx: 'a, 'a>( match (args_iter.peek(), params.peek()) { (Some(&arg), Some(¶m)) => { match (arg, ¶m.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(_), |
