Skip to content

Commit 2d82234

Browse files
committed
Remove dead code.
1 parent 02a42ff commit 2d82234

File tree

1 file changed

+1
-22
lines changed
  • compiler/rustc_mir_build/src/thir/cx

1 file changed

+1
-22
lines changed

Diff for: compiler/rustc_mir_build/src/thir/cx/mod.rs

+1-22
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@
55
use crate::thir::pattern::pat_from_hir;
66
use crate::thir::util::UserAnnotatedTyHelpers;
77

8-
use rustc_ast as ast;
98
use rustc_data_structures::steal::Steal;
109
use rustc_errors::ErrorGuaranteed;
1110
use rustc_hir as hir;
1211
use rustc_hir::def_id::{DefId, LocalDefId};
1312
use rustc_hir::HirId;
1413
use rustc_hir::Node;
1514
use rustc_middle::middle::region;
16-
use rustc_middle::mir::interpret::{LitToConstError, LitToConstInput};
17-
use rustc_middle::mir::ConstantKind;
1815
use rustc_middle::thir::*;
19-
use rustc_middle::ty::{self, RvalueScopes, Ty, TyCtxt};
16+
use rustc_middle::ty::{self, RvalueScopes, TyCtxt};
2017
use rustc_span::Span;
2118

2219
pub(crate) fn thir_body<'tcx>(
@@ -80,24 +77,6 @@ impl<'tcx> Cx<'tcx> {
8077
}
8178
}
8279

83-
#[instrument(skip(self), level = "debug")]
84-
pub(crate) fn const_eval_literal(
85-
&mut self,
86-
lit: &'tcx ast::LitKind,
87-
ty: Ty<'tcx>,
88-
sp: Span,
89-
neg: bool,
90-
) -> ConstantKind<'tcx> {
91-
match self.tcx.at(sp).lit_to_mir_constant(LitToConstInput { lit, ty, neg }) {
92-
Ok(c) => c,
93-
Err(LitToConstError::Reported) => {
94-
// create a dummy value and continue compiling
95-
ConstantKind::Ty(self.tcx.const_error(ty))
96-
}
97-
Err(LitToConstError::TypeError) => bug!("const_eval_literal: had type error"),
98-
}
99-
}
100-
10180
#[tracing::instrument(level = "debug", skip(self))]
10281
pub(crate) fn pattern_from_hir(&mut self, p: &hir::Pat<'_>) -> Pat<'tcx> {
10382
let p = match self.tcx.hir().get(p.hir_id) {

0 commit comments

Comments
 (0)