You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Method call on a bare Type.Variant path receiver fails MIR lowering (S.A.tag()) #1310
A method call whose receiver is a bare unit-variant path fails to lower; binding the variant first works.
enum S { A | B(i32) }
impl S:
fn tag(self: &Self) -> i32: 1
fn main:
let x = S.A
print(f"{x.tag()}") // ok
print(f"{S.A.tag()}") // MIR lowering failed
error: MIR lowering failed for function 'main' in r_path.w; AST codegen was removed, so this function cannot be compiled
WITH_MIR_AUDIT=1: [mir-lower-fail] kind=27 (NK_CALL) fn=main span=266..275
Reproduces on the installed with (main at bbb9c5b) with a hand-written impl, so it is independent of @[derive]. Expected: an rvalue receiver of a unit variant lowers like let x = S.A; x.tag() (§9.7 / §11).
Workaround: bind the variant to a local first (the #1289 test does this).
Activity
Fix #1287 (Atomic stores an element view's address), #1289 (derive on…
Closures reference globals in place (#1313) and `S.A.tag()` lowers on…