Skip to content

Commit 2be0596

Browse files
committed
Use with_no_trimmed_paths
Fixes compilation without -Ztrim-diagnostic-paths=no
1 parent 793d260 commit 2be0596

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

src/bin/cg_clif.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
2424
self.time_passes = config.opts.prints.is_empty()
2525
&& (config.opts.debugging_opts.time_passes || config.opts.debugging_opts.time);
2626

27-
// FIXME workaround for an ICE
28-
config.opts.debugging_opts.trim_diagnostic_paths = false;
29-
3027
config.opts.cg.panic = Some(PanicStrategy::Abort);
3128
config.opts.debugging_opts.panic_abort_tests = true;
3229
config.opts.maybe_sysroot = Some(

src/bin/cg_clif_build_sysroot.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
4444
return;
4545
}
4646

47-
// FIXME workaround for an ICE
48-
config.opts.debugging_opts.trim_diagnostic_paths = false;
49-
5047
config.opts.cg.panic = Some(PanicStrategy::Abort);
5148
config.opts.debugging_opts.panic_abort_tests = true;
5249
config.opts.maybe_sysroot = Some(

src/intrinsics/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub(crate) use cpuid::codegen_cpuid_call;
99
pub(crate) use llvm::codegen_llvm_intrinsic_call;
1010

1111
use crate::prelude::*;
12+
use rustc_middle::ty::print::with_no_trimmed_paths;
1213

1314
macro intrinsic_pat {
1415
(_) => {
@@ -819,29 +820,29 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
819820
assert_inhabited | assert_zero_valid | assert_uninit_valid, <T> () {
820821
let layout = fx.layout_of(T);
821822
if layout.abi.is_uninhabited() {
822-
crate::base::codegen_panic(
823+
with_no_trimmed_paths(|| crate::base::codegen_panic(
823824
fx,
824825
&format!("attempted to instantiate uninhabited type `{}`", T),
825826
span,
826-
);
827+
));
827828
return;
828829
}
829830

830831
if intrinsic == "assert_zero_valid" && !layout.might_permit_raw_init(fx, /*zero:*/ true).unwrap() {
831-
crate::base::codegen_panic(
832+
with_no_trimmed_paths(|| crate::base::codegen_panic(
832833
fx,
833834
&format!("attempted to zero-initialize type `{}`, which is invalid", T),
834835
span,
835-
);
836+
));
836837
return;
837838
}
838839

839840
if intrinsic == "assert_uninit_valid" && !layout.might_permit_raw_init(fx, /*zero:*/ false).unwrap() {
840-
crate::base::codegen_panic(
841+
with_no_trimmed_paths(|| crate::base::codegen_panic(
841842
fx,
842843
&format!("attempted to leave type `{}` uninitialized, which is invalid", T),
843844
span,
844-
);
845+
));
845846
return;
846847
}
847848
};

src/trap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,3 @@ pub(crate) fn trap_unimplemented(fx: &mut FunctionCx<'_, '_, impl Module>, msg:
6767
let true_ = fx.bcx.ins().iconst(types::I32, 1);
6868
fx.bcx.ins().trapnz(true_, TrapCode::User(!0));
6969
}
70-

0 commit comments

Comments
 (0)