Skip to content

Commit 8a5eecc

Browse files
committed
Rustup to rustc 1.79.0-nightly (aa067fb 2024-04-10)
1 parent c183c61 commit 8a5eecc

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2024-04-05"
2+
channel = "nightly-2024-04-11"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]

src/base.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,19 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
267267
.generic_activity("codegen prelude")
268268
.run(|| crate::abi::codegen_fn_prelude(fx, start_block));
269269

270-
for (bb, bb_data) in traversal::mono_reachable(fx.mir, fx.tcx, fx.instance) {
270+
let reachable_blocks = traversal::mono_reachable_as_bitset(fx.mir, fx.tcx, fx.instance);
271+
272+
for (bb, bb_data) in fx.mir.basic_blocks.iter_enumerated() {
271273
let block = fx.get_block(bb);
272274
fx.bcx.switch_to_block(block);
273275

276+
if !reachable_blocks.contains(bb) {
277+
// We want to skip this block, because it's not reachable. But we still create
278+
// the block so terminators in other blocks can reference it.
279+
fx.bcx.ins().trap(TrapCode::UnreachableCodeReached);
280+
continue;
281+
}
282+
274283
if bb_data.is_cleanup {
275284
// Unwinding after panicking is not supported
276285
continue;

0 commit comments

Comments
 (0)