The match on opt should not require the own permission. Case in point, if you do let x = &opt and x is live across the match, the program still compiles.
Core issue is that match operand really only expects R for the discriminant operation. Any additional permission expectations should be placed on the patterns where things get bound.
This program:
Is visualized with these permission:
The match on
opt
should not require the own permission. Case in point, if you dolet x = &opt
andx
is live across the match, the program still compiles.