Get rid of special const intrinsic query in favour of const_eval
This commit is contained in:
parent
5670d048c0
commit
0de9485038
14 changed files with 117 additions and 130 deletions
|
|
@ -213,6 +213,15 @@ fn print_backtrace(backtrace: &mut Backtrace) {
|
|||
eprintln!("\n\nAn error occurred in miri:\n{:?}", backtrace);
|
||||
}
|
||||
|
||||
impl From<ErrorHandled> for InterpErrorInfo<'tcx> {
|
||||
fn from(err: ErrorHandled) -> Self {
|
||||
match err {
|
||||
ErrorHandled::Reported => err_inval!(ReferencedConstant),
|
||||
ErrorHandled::TooGeneric => err_inval!(TooGeneric),
|
||||
}.into()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> From<InterpError<'tcx>> for InterpErrorInfo<'tcx> {
|
||||
fn from(kind: InterpError<'tcx>) -> Self {
|
||||
let backtrace = match env::var("RUSTC_CTFE_BACKTRACE") {
|
||||
|
|
|
|||
|
|
@ -462,15 +462,6 @@ rustc_queries! {
|
|||
no_force
|
||||
desc { "extract field of const" }
|
||||
}
|
||||
|
||||
/// Produces an absolute path representation of the given type. See also the documentation
|
||||
/// on `std::any::type_name`.
|
||||
query type_name(key: Ty<'tcx>) -> &'tcx ty::Const<'tcx> {
|
||||
eval_always
|
||||
no_force
|
||||
desc { "get absolute path of type" }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TypeChecking {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue