diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2024-06-14 12:16:15 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2024-06-28 10:57:35 +0000 |
| commit | 72e8244e64b284f8f93a778e804b59c10305fc59 (patch) | |
| tree | 753376943d4ce70ac6da8f56f7e24b3e4f000e97 /compiler/rustc_hir_analysis/src/collect/generics_of.rs | |
| parent | 99f77a2eda555b50b518f74823ab636a20efb87f (diff) | |
| download | rust-72e8244e64b284f8f93a778e804b59c10305fc59.tar.gz rust-72e8244e64b284f8f93a778e804b59c10305fc59.zip | |
implement new effects desugaring
Diffstat (limited to 'compiler/rustc_hir_analysis/src/collect/generics_of.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/collect/generics_of.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect/generics_of.rs b/compiler/rustc_hir_analysis/src/collect/generics_of.rs index 303fa23dbc1..9b02c1a61fa 100644 --- a/compiler/rustc_hir_analysis/src/collect/generics_of.rs +++ b/compiler/rustc_hir_analysis/src/collect/generics_of.rs @@ -354,7 +354,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics { kind, }) } - GenericParamKind::Const { ty: _, default, is_host_effect } => { + GenericParamKind::Const { ty: _, default, is_host_effect, synthetic } => { if !matches!(allow_defaults, Defaults::Allowed) && default.is_some() // `host` effect params are allowed to have defaults. @@ -388,6 +388,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics { kind: ty::GenericParamDefKind::Const { has_default: default.is_some(), is_host_effect, + synthetic, }, }) } @@ -541,7 +542,8 @@ struct AnonConstInParamTyDetector { impl<'v> Visitor<'v> for AnonConstInParamTyDetector { fn visit_generic_param(&mut self, p: &'v hir::GenericParam<'v>) { - if let GenericParamKind::Const { ty, default: _, is_host_effect: _ } = p.kind { + if let GenericParamKind::Const { ty, default: _, is_host_effect: _, synthetic: _ } = p.kind + { let prev = self.in_param_ty; self.in_param_ty = true; self.visit_ty(ty); |
