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
Sorry if this is a silly question, but is var x being treated as var x: var Mint? So it's not really a true/independent location, but it's a view into optLen.x? Also is optLen still a live borrow because of the second echo meaning that optLen still has a read against it?
Then no, for this, x is the "owning" location of Mint, and optlent is a view into x.
Since optlent is referred to by the echo after x = , it's considered to be alive at the point of x = , which meant that the location x should remain sealed from mutations.
Example
Actual Output
Compiles and run
Expected Output
Error that
x
cannot be modified becauseoptlent
is holding a live borrow.The text was updated successfully, but these errors were encountered: