Skip to content

Commit 5726026

Browse files
committed
rustc_trans: Disable landing pads on MSVC
Currently all these do is cause linker errors as they try to lower to GNU-like exception handling, none of which exists with MSVC.
1 parent 9cc0b22 commit 5726026

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc_trans/trans/base.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,12 @@ pub fn invoke<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
756756
}
757757

758758
pub fn need_invoke(bcx: Block) -> bool {
759-
if bcx.sess().no_landing_pads() {
759+
// FIXME(#25869) currently unwinding is not implemented for MSVC and our
760+
// normal unwinding infrastructure ends up just causing linker
761+
// errors with the current LLVM implementation, so landing
762+
// pads are disabled entirely for MSVC targets
763+
if bcx.sess().no_landing_pads() ||
764+
bcx.sess().target.target.options.is_like_msvc {
760765
return false;
761766
}
762767

0 commit comments

Comments
 (0)