Skip to content

Commit e81d924

Browse files
authored
Unrolled build for rust-lang#133443
Rollup merge of rust-lang#133443 - fmease:rm-dead-eff-code-ii, r=compiler-errors Remove dead code stemming from the old effects desugaring (II) Follow-up to rust-lang#132374. r? project-const-traits
2 parents f2abf82 + 4301d02 commit e81d924

File tree

3 files changed

+4
-33
lines changed

3 files changed

+4
-33
lines changed

compiler/rustc_ast_lowering/src/lib.rs

+3-15
Original file line numberDiff line numberDiff line change
@@ -2117,11 +2117,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
21172117
hir::ConstArgKind::Anon(ct)
21182118
};
21192119

2120-
self.arena.alloc(hir::ConstArg {
2121-
hir_id: self.next_id(),
2122-
kind: ct_kind,
2123-
is_desugared_from_effects: false,
2124-
})
2120+
self.arena.alloc(hir::ConstArg { hir_id: self.next_id(), kind: ct_kind })
21252121
}
21262122

21272123
/// See [`hir::ConstArg`] for when to use this function vs
@@ -2163,19 +2159,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
21632159
None,
21642160
);
21652161

2166-
return ConstArg {
2167-
hir_id: self.next_id(),
2168-
kind: hir::ConstArgKind::Path(qpath),
2169-
is_desugared_from_effects: false,
2170-
};
2162+
return ConstArg { hir_id: self.next_id(), kind: hir::ConstArgKind::Path(qpath) };
21712163
}
21722164

21732165
let lowered_anon = self.lower_anon_const_to_anon_const(anon);
2174-
ConstArg {
2175-
hir_id: self.next_id(),
2176-
kind: hir::ConstArgKind::Anon(lowered_anon),
2177-
is_desugared_from_effects: false,
2178-
}
2166+
ConstArg { hir_id: self.next_id(), kind: hir::ConstArgKind::Anon(lowered_anon) }
21792167
}
21802168

21812169
/// See [`hir::ConstArg`] for when to use this function vs

compiler/rustc_hir/src/hir.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,6 @@ pub struct ConstArg<'hir> {
261261
#[stable_hasher(ignore)]
262262
pub hir_id: HirId,
263263
pub kind: ConstArgKind<'hir>,
264-
/// Indicates whether this comes from a `~const` desugaring.
265-
pub is_desugared_from_effects: bool,
266264
}
267265

268266
impl<'hir> ConstArg<'hir> {
@@ -462,14 +460,7 @@ impl<'hir> GenericArgs<'hir> {
462460
/// This function returns the number of type and const generic params.
463461
/// It should only be used for diagnostics.
464462
pub fn num_generic_params(&self) -> usize {
465-
self.args
466-
.iter()
467-
.filter(|arg| match arg {
468-
GenericArg::Lifetime(_)
469-
| GenericArg::Const(ConstArg { is_desugared_from_effects: true, .. }) => false,
470-
_ => true,
471-
})
472-
.count()
463+
self.args.iter().filter(|arg| !matches!(arg, GenericArg::Lifetime(_))).count()
473464
}
474465

475466
/// The span encompassing the arguments and constraints[^1] inside the surrounding brackets.

src/librustdoc/clean/mod.rs

-8
Original file line numberDiff line numberDiff line change
@@ -2516,14 +2516,6 @@ fn clean_generic_args<'tcx>(
25162516
}
25172517
hir::GenericArg::Lifetime(_) => GenericArg::Lifetime(Lifetime::elided()),
25182518
hir::GenericArg::Type(ty) => GenericArg::Type(clean_ty(ty, cx)),
2519-
// Checking for `is_desugared_from_effects` on the `AnonConst` not only accounts for the case
2520-
// where the argument is `host` but for all possible cases (e.g., `true`, `false`).
2521-
hir::GenericArg::Const(hir::ConstArg {
2522-
is_desugared_from_effects: true,
2523-
..
2524-
}) => {
2525-
return None;
2526-
}
25272519
hir::GenericArg::Const(ct) => GenericArg::Const(Box::new(clean_const(ct, cx))),
25282520
hir::GenericArg::Infer(_inf) => GenericArg::Infer,
25292521
})

0 commit comments

Comments
 (0)