Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bb74f47
Do not suggest borrow that is already there in fully-qualified call
estebank Nov 1, 2024
a0111ec
awhile -> a while where appropriate
nabijaczleweli Jul 1, 2025
7603adc
Rework logic and provide structured suggestion
estebank Jul 3, 2025
f7046bd
Regression tests for repr ICEs
JonathanBrouwer Jul 6, 2025
8b33e93
Fix `x86_64-unknown-netbsd` platform support page
jieyouxu Jul 7, 2025
6d58a88
`loop_match`: fix 'no terminator on block'
folkertdev Jul 7, 2025
be6cd11
make `Machine::load_mir` infallible
fee1-dead Jul 7, 2025
3b48407
Remove unused allow attrs
yotamofek Jun 28, 2025
be9669f
fix the link in `rustdoc.md`
makai410 Jul 4, 2025
2cb2478
Fix missing words in future tracking issue
ehuss Jul 7, 2025
00a4418
Rollup merge of #132469 - estebank:issue-132041, r=Nadrieril
matthiaskrgr Jul 7, 2025
2554c42
Rollup merge of #143340 - nabijaczleweli:awhile, r=mati865
matthiaskrgr Jul 7, 2025
1b922d3
Rollup merge of #143438 - makai410:rustdoc-fix, r=ehuss
matthiaskrgr Jul 7, 2025
6c8482e
Rollup merge of #143539 - JonathanBrouwer:ice-regression-tests, r=oli…
matthiaskrgr Jul 7, 2025
b6777b1
Rollup merge of #143566 - jieyouxu:fix-x86_64-unknown-netbsd, r=fee1-…
matthiaskrgr Jul 7, 2025
7ed6bd9
Rollup merge of #143572 - yotamofek:pr/unused-allow-attrs, r=fee1-dead
matthiaskrgr Jul 7, 2025
f5df1f5
Rollup merge of #143583 - folkertdev:loop-match-no-terminator-on-bloc…
matthiaskrgr Jul 7, 2025
42b105e
Rollup merge of #143584 - fee1-dead-contrib:push-skswvrwsrmll, r=Ralf…
matthiaskrgr Jul 7, 2025
ff6b881
Rollup merge of #143591 - ehuss:future-typos, r=jieyouxu
matthiaskrgr Jul 7, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
loop_match: fix 'no terminator on block'
  • Loading branch information
folkertdev committed Jul 7, 2025
commit 6d58a88c3ca2eefc24654700db522bfed668e1cb
4 changes: 3 additions & 1 deletion compiler/rustc_mir_build/src/builder/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {

valtree
}
Err(ErrorHandled::Reported(..)) => return self.cfg.start_new_block().unit(),
Err(ErrorHandled::Reported(..)) => {
return block.unit();
}
Err(ErrorHandled::TooGeneric(_)) => {
self.tcx.dcx().emit_fatal(ConstContinueBadConst { span: constant.span });
}
Expand Down
22 changes: 22 additions & 0 deletions tests/ui/loop-match/panic-in-const.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#![allow(incomplete_features)]
#![feature(loop_match)]
#![crate_type = "lib"]

const CONST_THAT_PANICS: u8 = panic!("diverge!");
//~^ ERROR: evaluation panicked: diverge!

fn test(mut state: u8) {
#[loop_match]
loop {
state = 'blk: {
match state {
0 => {
#[const_continue]
break 'blk CONST_THAT_PANICS;
}

_ => unreachable!(),
}
}
}
}
9 changes: 9 additions & 0 deletions tests/ui/loop-match/panic-in-const.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0080]: evaluation panicked: diverge!
--> $DIR/panic-in-const.rs:5:31
|
LL | const CONST_THAT_PANICS: u8 = panic!("diverge!");
| ^^^^^^^^^^^^^^^^^^ evaluation of `CONST_THAT_PANICS` failed here

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0080`.
Loading