Remove dead code.

This commit is contained in:
Camille GILLOT 2022-06-23 22:16:50 +02:00
parent 02a42ff83d
commit 2d82234331

View File

@ -5,7 +5,6 @@
use crate::thir::pattern::pat_from_hir;
use crate::thir::util::UserAnnotatedTyHelpers;
use rustc_ast as ast;
use rustc_data_structures::steal::Steal;
use rustc_errors::ErrorGuaranteed;
use rustc_hir as hir;
@ -13,10 +12,8 @@ use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::HirId;
use rustc_hir::Node;
use rustc_middle::middle::region;
use rustc_middle::mir::interpret::{LitToConstError, LitToConstInput};
use rustc_middle::mir::ConstantKind;
use rustc_middle::thir::*;
use rustc_middle::ty::{self, RvalueScopes, Ty, TyCtxt};
use rustc_middle::ty::{self, RvalueScopes, TyCtxt};
use rustc_span::Span;
pub(crate) fn thir_body<'tcx>(
@ -80,24 +77,6 @@ impl<'tcx> Cx<'tcx> {
}
}
#[instrument(skip(self), level = "debug")]
pub(crate) fn const_eval_literal(
&mut self,
lit: &'tcx ast::LitKind,
ty: Ty<'tcx>,
sp: Span,
neg: bool,
) -> ConstantKind<'tcx> {
match self.tcx.at(sp).lit_to_mir_constant(LitToConstInput { lit, ty, neg }) {
Ok(c) => c,
Err(LitToConstError::Reported) => {
// create a dummy value and continue compiling
ConstantKind::Ty(self.tcx.const_error(ty))
}
Err(LitToConstError::TypeError) => bug!("const_eval_literal: had type error"),
}
}
#[tracing::instrument(level = "debug", skip(self))]
pub(crate) fn pattern_from_hir(&mut self, p: &hir::Pat<'_>) -> Pat<'tcx> {
let p = match self.tcx.hir().get(p.hir_id) {