Skip to content

Commit ef60f50

Browse files
authored
Rollup merge of #146102 - fmease:rm-dead-eff-code-iii, r=fee1-dead
Remove dead code stemming from an old effects desugaring CC #132374, #133443. r? fee1-dead
2 parents f4c5c34 + 6fc0cf4 commit ef60f50

File tree

11 files changed

+16
-26
lines changed

11 files changed

+16
-26
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
20282028

20292029
(
20302030
hir::ParamName::Plain(self.lower_ident(param.ident)),
2031-
hir::GenericParamKind::Const { ty, default, synthetic: false },
2031+
hir::GenericParamKind::Const { ty, default },
20322032
)
20332033
}
20342034
}

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,6 @@ pub enum GenericParamKind<'hir> {
784784
ty: &'hir Ty<'hir>,
785785
/// Optional default value for the const generic param
786786
default: Option<&'hir ConstArg<'hir>>,
787-
synthetic: bool,
788787
},
789788
}
790789

compiler/rustc_hir/src/intravisit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ pub fn walk_generic_param<'v, V: Visitor<'v>>(
10851085
GenericParamKind::Type { ref default, .. } => {
10861086
visit_opt!(visitor, visit_ty_unambig, default)
10871087
}
1088-
GenericParamKind::Const { ref ty, ref default, synthetic: _ } => {
1088+
GenericParamKind::Const { ref ty, ref default } => {
10891089
try_visit!(visitor.visit_ty_unambig(ty));
10901090
if let Some(default) = default {
10911091
try_visit!(visitor.visit_const_param_default(*hir_id, default));

compiler/rustc_hir_analysis/src/collect/generics_of.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
305305

306306
ty::GenericParamDefKind::Type { has_default: default.is_some(), synthetic }
307307
}
308-
GenericParamKind::Const { ty: _, default, synthetic } => {
308+
GenericParamKind::Const { ty: _, default } => {
309309
if default.is_some() {
310310
match param_default_policy.expect("no policy for generic param default") {
311311
ParamDefaultPolicy::Allowed => {}
@@ -316,7 +316,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
316316
}
317317
}
318318

319-
ty::GenericParamDefKind::Const { has_default: default.is_some(), synthetic }
319+
ty::GenericParamDefKind::Const { has_default: default.is_some() }
320320
}
321321
};
322322
Some(ty::GenericParamDef {
@@ -523,7 +523,7 @@ impl<'v> Visitor<'v> for AnonConstInParamTyDetector {
523523
type Result = ControlFlow<()>;
524524

525525
fn visit_generic_param(&mut self, p: &'v hir::GenericParam<'v>) -> Self::Result {
526-
if let GenericParamKind::Const { ty, default: _, synthetic: _ } = p.kind {
526+
if let GenericParamKind::Const { ty, default: _ } = p.kind {
527527
let prev = self.in_param_ty;
528528
self.in_param_ty = true;
529529
let res = self.visit_ty_unambig(ty);

compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,7 @@ pub(crate) fn check_generic_arg_count(
419419
.filter(|param| matches!(param.kind, ty::GenericParamDefKind::Type { synthetic: true, .. }))
420420
.count();
421421
let named_type_param_count = param_counts.types - has_self as usize - synth_type_param_count;
422-
let synth_const_param_count = gen_params
423-
.own_params
424-
.iter()
425-
.filter(|param| {
426-
matches!(param.kind, ty::GenericParamDefKind::Const { synthetic: true, .. })
427-
})
428-
.count();
429-
let named_const_param_count = param_counts.consts - synth_const_param_count;
422+
let named_const_param_count = param_counts.consts;
430423
let infer_lifetimes =
431424
(gen_pos != GenericArgPosition::Type || seg.infer_args) && !gen_args.has_lifetime_params();
432425

compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2379,7 +2379,7 @@ impl<'a> State<'a> {
23792379
self.print_type(default);
23802380
}
23812381
}
2382-
GenericParamKind::Const { ty, ref default, synthetic: _ } => {
2382+
GenericParamKind::Const { ty, ref default } => {
23832383
self.word_space(":");
23842384
self.print_type(ty);
23852385
if let Some(default) = default {

compiler/rustc_middle/src/ty/generics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::ty::{EarlyBinder, GenericArgsRef};
1313
pub enum GenericParamDefKind {
1414
Lifetime,
1515
Type { has_default: bool, synthetic: bool },
16-
Const { has_default: bool, synthetic: bool },
16+
Const { has_default: bool },
1717
}
1818

1919
impl GenericParamDefKind {

compiler/rustc_public/src/unstable/convert/stable/ty.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,13 +656,13 @@ impl<'tcx> Stable<'tcx> for rustc_middle::ty::GenericParamDefKind {
656656

657657
fn stable(&self, _: &mut Tables<'_, BridgeTys>, _: &CompilerCtxt<'_, BridgeTys>) -> Self::T {
658658
use crate::ty::GenericParamDefKind;
659-
match self {
659+
match *self {
660660
ty::GenericParamDefKind::Lifetime => GenericParamDefKind::Lifetime,
661661
ty::GenericParamDefKind::Type { has_default, synthetic } => {
662-
GenericParamDefKind::Type { has_default: *has_default, synthetic: *synthetic }
662+
GenericParamDefKind::Type { has_default, synthetic }
663663
}
664-
ty::GenericParamDefKind::Const { has_default, synthetic: _ } => {
665-
GenericParamDefKind::Const { has_default: *has_default }
664+
ty::GenericParamDefKind::Const { has_default } => {
665+
GenericParamDefKind::Const { has_default }
666666
}
667667
}
668668
}

src/librustdoc/clean/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ fn clean_generic_param_def(
557557
},
558558
)
559559
}
560-
ty::GenericParamDefKind::Const { has_default, synthetic } => (
560+
ty::GenericParamDefKind::Const { has_default } => (
561561
def.name,
562562
GenericParamDefKind::Const {
563563
ty: Box::new(clean_middle_ty(
@@ -580,7 +580,6 @@ fn clean_generic_param_def(
580580
} else {
581581
None
582582
},
583-
synthetic,
584583
},
585584
),
586585
};
@@ -636,14 +635,13 @@ fn clean_generic_param<'tcx>(
636635
},
637636
)
638637
}
639-
hir::GenericParamKind::Const { ty, default, synthetic } => (
638+
hir::GenericParamKind::Const { ty, default } => (
640639
param.name.ident().name,
641640
GenericParamDefKind::Const {
642641
ty: Box::new(clean_ty(ty, cx)),
643642
default: default.map(|ct| {
644643
Box::new(lower_const_arg_for_rustdoc(cx.tcx, ct, FeedConstTy::No).to_string())
645644
}),
646-
synthetic,
647645
},
648646
),
649647
};

src/librustdoc/clean/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ pub(crate) enum GenericParamDefKind {
13961396
Lifetime { outlives: ThinVec<Lifetime> },
13971397
Type { bounds: ThinVec<GenericBound>, default: Option<Box<Type>>, synthetic: bool },
13981398
// Option<Box<String>> makes this type smaller than `Option<String>` would.
1399-
Const { ty: Box<Type>, default: Option<Box<String>>, synthetic: bool },
1399+
Const { ty: Box<Type>, default: Option<Box<String>> },
14001400
}
14011401

14021402
impl GenericParamDefKind {

0 commit comments

Comments
 (0)