Skip to content

Commit ef5808a

Browse files
committed
add a fixme for tailcalls with opaque types
1 parent d93ea6b commit ef5808a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/rustc_mir_build/src/check_tail_calls.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ impl<'tcx> TailCallCkVisitor<'_, 'tcx> {
117117
self.report_arguments_mismatch(expr.span, caller_sig, callee_sig);
118118
}
119119

120+
// FIXME(explicit_tail_calls): this currenly fails for cases where opaques are used.
121+
// e.g.
122+
// ```
123+
// fn a() -> impl Sized { become b() } // ICE
124+
// fn b() -> u8 { 0 }
125+
// ```
126+
// we should think what is the expected behavior here.
127+
// (we should probably just accept this by revealing opaques?)
120128
if caller_sig.output() != callee_sig.output() {
121129
span_bug!(expr.span, "hir typeck should have checked the return type already");
122130
}

0 commit comments

Comments
 (0)