rebase and remove dead code
This commit is contained in:
parent
9b28d3b494
commit
14e3d038c0
7 changed files with 4 additions and 234 deletions
|
@ -5,7 +5,6 @@
|
|||
use crate::thir::pattern::pat_from_hir;
|
||||
use crate::thir::util::UserAnnotatedTyHelpers;
|
||||
|
||||
use rustc_ast::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, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use rustc_span::Span;
|
||||
|
||||
crate fn thir_body<'tcx>(
|
||||
|
@ -78,24 +75,6 @@ impl<'tcx> Cx<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[instrument(skip(self), level = "debug")]
|
||||
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"),
|
||||
}
|
||||
}
|
||||
|
||||
crate fn pattern_from_hir(&mut self, p: &hir::Pat<'_>) -> Pat<'tcx> {
|
||||
let p = match self.tcx.hir().get(p.hir_id) {
|
||||
Node::Pat(p) | Node::Binding(p) => p,
|
||||
|
|
|
@ -739,7 +739,6 @@ impl<'tcx> PatternFoldable<'tcx> for PatKind<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: Get rid of this function once valtrees land
|
||||
#[instrument(skip(tcx), level = "debug")]
|
||||
crate fn compare_const_vals<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
|
@ -759,8 +758,7 @@ crate fn compare_const_vals<'tcx>(
|
|||
|
||||
// Early return for equal constants (so e.g. references to ZSTs can be compared, even if they
|
||||
// are just integer addresses).
|
||||
// FIXME This might be wrong
|
||||
if a == b {
|
||||
if a.val() == b.val() {
|
||||
return from_bool(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue