Use with_no_trimmed_paths
Fixes compilation without -Ztrim-diagnostic-paths=no
This commit is contained in:
parent
793d26047f
commit
2be0596810
4 changed files with 7 additions and 13 deletions
|
@ -24,9 +24,6 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
|
||||||
self.time_passes = config.opts.prints.is_empty()
|
self.time_passes = config.opts.prints.is_empty()
|
||||||
&& (config.opts.debugging_opts.time_passes || config.opts.debugging_opts.time);
|
&& (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.cg.panic = Some(PanicStrategy::Abort);
|
||||||
config.opts.debugging_opts.panic_abort_tests = true;
|
config.opts.debugging_opts.panic_abort_tests = true;
|
||||||
config.opts.maybe_sysroot = Some(
|
config.opts.maybe_sysroot = Some(
|
||||||
|
|
|
@ -44,9 +44,6 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME workaround for an ICE
|
|
||||||
config.opts.debugging_opts.trim_diagnostic_paths = false;
|
|
||||||
|
|
||||||
config.opts.cg.panic = Some(PanicStrategy::Abort);
|
config.opts.cg.panic = Some(PanicStrategy::Abort);
|
||||||
config.opts.debugging_opts.panic_abort_tests = true;
|
config.opts.debugging_opts.panic_abort_tests = true;
|
||||||
config.opts.maybe_sysroot = Some(
|
config.opts.maybe_sysroot = Some(
|
||||||
|
|
|
@ -9,6 +9,7 @@ pub(crate) use cpuid::codegen_cpuid_call;
|
||||||
pub(crate) use llvm::codegen_llvm_intrinsic_call;
|
pub(crate) use llvm::codegen_llvm_intrinsic_call;
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||||
|
|
||||||
macro intrinsic_pat {
|
macro intrinsic_pat {
|
||||||
(_) => {
|
(_) => {
|
||||||
|
@ -819,29 +820,29 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
|
||||||
assert_inhabited | assert_zero_valid | assert_uninit_valid, <T> () {
|
assert_inhabited | assert_zero_valid | assert_uninit_valid, <T> () {
|
||||||
let layout = fx.layout_of(T);
|
let layout = fx.layout_of(T);
|
||||||
if layout.abi.is_uninhabited() {
|
if layout.abi.is_uninhabited() {
|
||||||
crate::base::codegen_panic(
|
with_no_trimmed_paths(|| crate::base::codegen_panic(
|
||||||
fx,
|
fx,
|
||||||
&format!("attempted to instantiate uninhabited type `{}`", T),
|
&format!("attempted to instantiate uninhabited type `{}`", T),
|
||||||
span,
|
span,
|
||||||
);
|
));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if intrinsic == "assert_zero_valid" && !layout.might_permit_raw_init(fx, /*zero:*/ true).unwrap() {
|
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,
|
fx,
|
||||||
&format!("attempted to zero-initialize type `{}`, which is invalid", T),
|
&format!("attempted to zero-initialize type `{}`, which is invalid", T),
|
||||||
span,
|
span,
|
||||||
);
|
));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if intrinsic == "assert_uninit_valid" && !layout.might_permit_raw_init(fx, /*zero:*/ false).unwrap() {
|
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,
|
fx,
|
||||||
&format!("attempted to leave type `{}` uninitialized, which is invalid", T),
|
&format!("attempted to leave type `{}` uninitialized, which is invalid", T),
|
||||||
span,
|
span,
|
||||||
);
|
));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -67,4 +67,3 @@ pub(crate) fn trap_unimplemented(fx: &mut FunctionCx<'_, '_, impl Module>, msg:
|
||||||
let true_ = fx.bcx.ins().iconst(types::I32, 1);
|
let true_ = fx.bcx.ins().iconst(types::I32, 1);
|
||||||
fx.bcx.ins().trapnz(true_, TrapCode::User(!0));
|
fx.bcx.ins().trapnz(true_, TrapCode::User(!0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue