This repository was archived by the owner on Apr 5, 2024. It is now read-only.
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
matching is always considered a use of the place, even with _
patterns #27
Closed
Description
In this example playground:
let foo = [1, 2, 3];
let c = || match foo { _ => () };
the match foo
winds up registering a read of foo
in the ExprUseVisitor
. Note that the behavior here is different from let _ = foo
. This is also somewhat inconsistent with the borrow checker, which considers match foo { _ => () }
to not be a use (i.e., this code compiles, playground):
let mut x = 1;
let y = &x;
match x { _ => () }
drop(y);