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.
This commit is contained in:
parent
6854f7d89a
commit
4736142c48
2 changed files with 0 additions and 25 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue