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
constA:u8 = 5u8;fnmain(){let b = &mut[5u8];match b {[A] => (),[_b] => panic!("??")};}
(playground)
A type inlay is shown on [A: <here>] exactly like when matching a variable. They slightly differ in type (above [A: u8] and [_b: &mut u8] but is still confusing in my opinion.
Personally, I checked whether using a constant variable instead of a constant literal was allowed in this context because of this inlay.
I also don't think the inlay is particularly useful and omitting it would resolve the confusion and not loose any relevant information.
(my apologies if the terminology isn't correct, I hope it's understandable)
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
When writing code similar to:
(playground)
A type inlay is shown on
[A: <here>]
exactly like when matching a variable. They slightly differ in type (above[A: u8]
and[_b: &mut u8]
but is still confusing in my opinion.Personally, I checked whether using a constant variable instead of a constant literal was allowed in this context because of this inlay.
I also don't think the inlay is particularly useful and omitting it would resolve the confusion and not loose any relevant information.
(my apologies if the terminology isn't correct, I hope it's understandable)
The text was updated successfully, but these errors were encountered: