In save-analysis, enum struct variant constructions aren't being recorded #61385
Labels
A-save-analysis
Area: saving results of analyses such as inference and borrowck results to a file.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Consider this snippet:
If you, in vscode, right click onto
Foo
inenum Foo {
to get the places it's referenced, it won't list you any references. Similarly, if you right click onv
inlet v = 31;
, there won't be any references listed. However, both are referenced one line below. Now, if you addlet w = Foo::Baz(v);
, then theBaz
reference will be recorded for bothFoo
andv
. So the problem is that enum struct variant constructor expressions aren't being considered for references.Thisis no rls bug as the save-analysis by rustc is wrong. If you dump the save-analysis generated for the code above, you'll notice that the refs array is empty while it should contain entries for uses of
Foo
and the localv
variable (as well as theBar
enum variant but that is a separate bug, it doesn't just affect struct variant constructors. See #61302).The text was updated successfully, but these errors were encountered: