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
I've found a more minimal reproduction. Going from fn f(arg: (usize, bool)) {} to fn f((arg: (usize, bool)) {} is enough to crash rust-analyzer with "internal error: entered unreachable code: Only tuple has tuple field".
so its basically parses as a function with a tuple pattern containing an ident pattern and another tuple pattern, missing the closing paren for the parameter list.
which is obviously bad, we shouldn't have a mir with unknowns in it in the first place!
And hence, as it turns out, just a fn f((a,)) {} also reproduces this (likely any non ident pattern in a param with a missing type. We probably just forget to check the function param pattern types if they contain unknowns and marking the type check result as tainted appropriately.
The text was updated successfully, but these errors were encountered:
i wonder if we should just kick that out, its clearly a reachable branch at this point x) (we need to restructure how we approach mir lowering to fix this I believe)
Originally posted by @davidbarsky in #15090
The parse tree for
fn f((arg: (usize, bool)) {}
isso its basically parses as a function with a tuple pattern containing an ident pattern and another tuple pattern, missing the closing paren for the parameter list.
The HIR is
which is expected.
The mir is
which is obviously bad, we shouldn't have a mir with unknowns in it in the first place!
And hence, as it turns out, just a
fn f((a,)) {}
also reproduces this (likely any non ident pattern in a param with a missing type. We probably just forget to check the function param pattern types if they contain unknowns and marking the type check result as tainted appropriately.The text was updated successfully, but these errors were encountered: