Remove the now-useless Result
from lit_to_const
This commit is contained in:
parent
07fcead073
commit
8505904dcc
7 changed files with 19 additions and 47 deletions
|
@ -83,15 +83,6 @@ pub struct LitToConstInput<'tcx> {
|
|||
pub neg: bool,
|
||||
}
|
||||
|
||||
/// Error type for `tcx.lit_to_const`.
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, HashStable)]
|
||||
pub enum LitToConstError {
|
||||
/// The literal's inferred type did not match the expected `ty` in the input.
|
||||
/// This is used for graceful error handling (`span_delayed_bug`) in
|
||||
/// type checking (`Const::from_anon_const`).
|
||||
TypeError,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct AllocId(pub NonZero<u64>);
|
||||
|
||||
|
|
|
@ -141,14 +141,6 @@ impl EraseType for Result<rustc_abi::TyAndLayout<'_, Ty<'_>>, &ty::layout::Layou
|
|||
>()];
|
||||
}
|
||||
|
||||
impl EraseType for Result<ty::Const<'_>, mir::interpret::LitToConstError> {
|
||||
type Result = [u8; size_of::<Result<ty::Const<'static>, mir::interpret::LitToConstError>>()];
|
||||
}
|
||||
|
||||
impl EraseType for Result<mir::Const<'_>, mir::interpret::LitToConstError> {
|
||||
type Result = [u8; size_of::<Result<mir::Const<'static>, mir::interpret::LitToConstError>>()];
|
||||
}
|
||||
|
||||
impl EraseType for Result<mir::ConstAlloc<'_>, mir::interpret::ErrorHandled> {
|
||||
type Result = [u8; size_of::<Result<mir::ConstAlloc<'static>, mir::interpret::ErrorHandled>>()];
|
||||
}
|
||||
|
@ -296,7 +288,6 @@ trivial! {
|
|||
rustc_middle::mir::interpret::AllocId,
|
||||
rustc_middle::mir::interpret::CtfeProvenance,
|
||||
rustc_middle::mir::interpret::ErrorHandled,
|
||||
rustc_middle::mir::interpret::LitToConstError,
|
||||
rustc_middle::thir::ExprId,
|
||||
rustc_middle::traits::CodegenObligationError,
|
||||
rustc_middle::traits::EvaluationResult,
|
||||
|
|
|
@ -57,7 +57,7 @@ use crate::middle::resolve_bound_vars::{ObjectLifetimeDefault, ResolveBoundVars,
|
|||
use crate::middle::stability::{self, DeprecationEntry};
|
||||
use crate::mir::interpret::{
|
||||
EvalStaticInitializerRawResult, EvalToAllocationRawResult, EvalToConstValueResult,
|
||||
EvalToValTreeResult, GlobalId, LitToConstError, LitToConstInput,
|
||||
EvalToValTreeResult, GlobalId, LitToConstInput,
|
||||
};
|
||||
use crate::mir::mono::{CodegenUnit, CollectionMode, MonoItem};
|
||||
use crate::query::erase::{Erase, erase, restore};
|
||||
|
@ -1268,7 +1268,7 @@ rustc_queries! {
|
|||
// FIXME get rid of this with valtrees
|
||||
query lit_to_const(
|
||||
key: LitToConstInput<'tcx>
|
||||
) -> Result<ty::Const<'tcx>, LitToConstError> {
|
||||
) -> ty::Const<'tcx> {
|
||||
desc { "converting literal to const" }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue