Skip to content

Commit 5ad2d0d

Browse files
committed
Auto merge of #115859 - compiler-errors:effect-fallback, r=fee1-dead
Fallback effects even if types also fallback `||` is short circuiting, so if we do ty/int var fallback, we *don't* do effect fallback 😸 r? `@fee1-dead` or `@oli-obk` Fixes #115791 Fixes #115842
2 parents ca2b74f + 5c907a7 commit 5ad2d0d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Diff for: compiler/rustc_hir_typeck/src/fallback.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
2424
self.fulfillment_cx.borrow_mut().pending_obligations()
2525
);
2626

27-
let fallback_occured = self.fallback_types() || self.fallback_effects();
27+
let fallback_occured = self.fallback_types() | self.fallback_effects();
2828

2929
if !fallback_occured {
3030
return;
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
// check-pass
22

3-
#![feature(const_trait_impl, effects)]
3+
#![feature(effects)]
44

55
pub const fn owo() {}
66

77
fn main() {
8+
// make sure falling back ty/int vars doesn't cause const fallback to be skipped...
9+
// See issue: 115791.
10+
let _ = 1;
11+
if false {
12+
let x = panic!();
13+
}
14+
815
let _ = owo;
916
}

0 commit comments

Comments
 (0)