Use with_no_trimmed_paths

Fixes compilation without -Ztrim-diagnostic-paths=no
This commit is contained in:
bjorn3 2020-10-27 10:59:09 +01:00
parent 793d26047f
commit 2be0596810
4 changed files with 7 additions and 13 deletions

View File

@ -24,9 +24,6 @@ fn config(&mut self, config: &mut interface::Config) {
self.time_passes = config.opts.prints.is_empty()
&& (config.opts.debugging_opts.time_passes || config.opts.debugging_opts.time);
// FIXME workaround for an ICE
config.opts.debugging_opts.trim_diagnostic_paths = false;
config.opts.cg.panic = Some(PanicStrategy::Abort);
config.opts.debugging_opts.panic_abort_tests = true;
config.opts.maybe_sysroot = Some(

View File

@ -44,9 +44,6 @@ fn config(&mut self, config: &mut interface::Config) {
return;
}
// FIXME workaround for an ICE
config.opts.debugging_opts.trim_diagnostic_paths = false;
config.opts.cg.panic = Some(PanicStrategy::Abort);
config.opts.debugging_opts.panic_abort_tests = true;
config.opts.maybe_sysroot = Some(

View File

@ -9,6 +9,7 @@
pub(crate) use llvm::codegen_llvm_intrinsic_call;
use crate::prelude::*;
use rustc_middle::ty::print::with_no_trimmed_paths;
macro intrinsic_pat {
(_) => {
@ -819,29 +820,29 @@ fn swap(bcx: &mut FunctionBuilder<'_>, v: Value) -> Value {
assert_inhabited | assert_zero_valid | assert_uninit_valid, <T> () {
let layout = fx.layout_of(T);
if layout.abi.is_uninhabited() {
crate::base::codegen_panic(
with_no_trimmed_paths(|| crate::base::codegen_panic(
fx,
&format!("attempted to instantiate uninhabited type `{}`", T),
span,
);
));
return;
}
if intrinsic == "assert_zero_valid" && !layout.might_permit_raw_init(fx, /*zero:*/ true).unwrap() {
crate::base::codegen_panic(
with_no_trimmed_paths(|| crate::base::codegen_panic(
fx,
&format!("attempted to zero-initialize type `{}`, which is invalid", T),
span,
);
));
return;
}
if intrinsic == "assert_uninit_valid" && !layout.might_permit_raw_init(fx, /*zero:*/ false).unwrap() {
crate::base::codegen_panic(
with_no_trimmed_paths(|| crate::base::codegen_panic(
fx,
&format!("attempted to leave type `{}` uninitialized, which is invalid", T),
span,
);
));
return;
}
};

View File

@ -67,4 +67,3 @@ pub(crate) fn trap_unimplemented(fx: &mut FunctionCx<'_, '_, impl Module>, msg:
let true_ = fx.bcx.ins().iconst(types::I32, 1);
fx.bcx.ins().trapnz(true_, TrapCode::User(!0));
}