Skip to content

Commit 4736142

Browse files
committed
Remove some dead code.
We currently have both `FromClean<clean::Constant> for Constant` and `FromClean<clean::ConstantKind> for Constant` which are basically identical, but the former is unused.
1 parent 6854f7d commit 4736142

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

src/librustdoc/clean/types.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,20 +2432,6 @@ pub(crate) enum ConstantKind {
24322432
Infer,
24332433
}
24342434

2435-
impl Constant {
2436-
pub(crate) fn expr(&self, tcx: TyCtxt<'_>) -> String {
2437-
self.kind.expr(tcx)
2438-
}
2439-
2440-
pub(crate) fn value(&self, tcx: TyCtxt<'_>) -> Option<String> {
2441-
self.kind.value(tcx)
2442-
}
2443-
2444-
pub(crate) fn is_literal(&self, tcx: TyCtxt<'_>) -> bool {
2445-
self.kind.is_literal(tcx)
2446-
}
2447-
}
2448-
24492435
impl ConstantKind {
24502436
pub(crate) fn expr(&self, tcx: TyCtxt<'_>) -> String {
24512437
match *self {

src/librustdoc/json/conversions.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,6 @@ impl FromClean<clean::GenericArg> for GenericArg {
201201
}
202202
}
203203

204-
impl FromClean<clean::Constant> for Constant {
205-
// FIXME(generic_const_items): Add support for generic const items.
206-
fn from_clean(constant: &clean::Constant, renderer: &JsonRenderer<'_>) -> Self {
207-
let tcx = renderer.tcx;
208-
let expr = constant.expr(tcx);
209-
let value = constant.value(tcx);
210-
let is_literal = constant.is_literal(tcx);
211-
Constant { expr, value, is_literal }
212-
}
213-
}
214-
215204
impl FromClean<clean::ConstantKind> for Constant {
216205
// FIXME(generic_const_items): Add support for generic const items.
217206
fn from_clean(constant: &clean::ConstantKind, renderer: &JsonRenderer<'_>) -> Self {

0 commit comments

Comments
 (0)