diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-06-17 15:09:04 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-06-22 07:36:57 +1000 |
| commit | 4736142c48590dfa4de48bef702348501d7fcc28 (patch) | |
| tree | 6c8f4778c8a48c13a56e18e18c42c4c9ebb17f4f | |
| parent | 6854f7d89ae60c96ae487e98f6cae03418435614 (diff) | |
| download | rust-4736142c48590dfa4de48bef702348501d7fcc28.tar.gz rust-4736142c48590dfa4de48bef702348501d7fcc28.zip | |
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.
| -rw-r--r-- | src/librustdoc/clean/types.rs | 14 | ||||
| -rw-r--r-- | src/librustdoc/json/conversions.rs | 11 |
2 files changed, 0 insertions, 25 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 408ef611ee5..c0a9d8c84f6 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -2432,20 +2432,6 @@ pub(crate) enum ConstantKind { Infer, } -impl Constant { - pub(crate) fn expr(&self, tcx: TyCtxt<'_>) -> String { - self.kind.expr(tcx) - } - - pub(crate) fn value(&self, tcx: TyCtxt<'_>) -> Option<String> { - self.kind.value(tcx) - } - - pub(crate) fn is_literal(&self, tcx: TyCtxt<'_>) -> bool { - self.kind.is_literal(tcx) - } -} - impl ConstantKind { pub(crate) fn expr(&self, tcx: TyCtxt<'_>) -> String { match *self { diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index 076d373887a..3d028fe681b 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -201,17 +201,6 @@ impl FromClean<clean::GenericArg> for GenericArg { } } -impl FromClean<clean::Constant> for Constant { - // FIXME(generic_const_items): Add support for generic const items. - fn from_clean(constant: &clean::Constant, renderer: &JsonRenderer<'_>) -> Self { - let tcx = renderer.tcx; - let expr = constant.expr(tcx); - let value = constant.value(tcx); - let is_literal = constant.is_literal(tcx); - Constant { expr, value, is_literal } - } -} - impl FromClean<clean::ConstantKind> for Constant { // FIXME(generic_const_items): Add support for generic const items. fn from_clean(constant: &clean::ConstantKind, renderer: &JsonRenderer<'_>) -> Self { |
