Skip to content

Commit d2e913e

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 4b9a57c commit d2e913e

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
@@ -2450,20 +2450,6 @@ pub(crate) enum ConstantKind {
24502450
Infer,
24512451
}
24522452

2453-
impl Constant {
2454-
pub(crate) fn expr(&self, tcx: TyCtxt<'_>) -> String {
2455-
self.kind.expr(tcx)
2456-
}
2457-
2458-
pub(crate) fn value(&self, tcx: TyCtxt<'_>) -> Option<String> {
2459-
self.kind.value(tcx)
2460-
}
2461-
2462-
pub(crate) fn is_literal(&self, tcx: TyCtxt<'_>) -> bool {
2463-
self.kind.is_literal(tcx)
2464-
}
2465-
}
2466-
24672453
impl ConstantKind {
24682454
pub(crate) fn expr(&self, tcx: TyCtxt<'_>) -> String {
24692455
match *self {

src/librustdoc/json/conversions.rs

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

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

0 commit comments

Comments
 (0)