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
fnfoo(x:usize) -> u32{match x {0 ..= usize::MAX => 0}}fnmain(){}
Gives:
error[E0004]: non-exhaustive patterns: `_` not covered
--> ...\test.rs:2:11
|
2 | match x {
| ^ pattern `_` not covered
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
= note: the matched value is of type `usize`
I'm not sure the feature is ever going to be stabilised, because there are concerns that this isn't a desirable feature. But hopefully the diagnostics will at least be improved in #73937.
I think the relevant concerns arose in the RFC thread (from this comment up). The overview is that we ought not to make assumptions about pointer sizes on the target platform, because they're not guaranteed to be fixed, so this could cause compatibility issues.
Activity
jonas-schievink commentedon Jul 1, 2020
Fairly sure this is intentional for
usizeleonardo-m commentedon Jul 1, 2020
From the pull 73937 I've seen a part that I didn't see/remember:
So you're right, this isn't a new bug, it's a known unfinished part. I hope to see that precise_pointer_size_matching implemented.
varkor commentedon Jul 3, 2020
It already exists.
leonardo-m commentedon Jul 3, 2020
I see, then what do I have to hope to see? :-)
varkor commentedon Jul 3, 2020
I'm not sure the feature is ever going to be stabilised, because there are concerns that this isn't a desirable feature. But hopefully the diagnostics will at least be improved in #73937.
leonardo-m commentedon Jul 4, 2020
Do you have a link to such concerns? (Or are you willing to summarize them?)
(I value your work on the compiler a lot varkor :-) )
varkor commentedon Jul 4, 2020
I think the relevant concerns arose in the RFC thread (from this comment up). The overview is that we ought not to make assumptions about pointer sizes on the target platform, because they're not guaranteed to be fixed, so this could cause compatibility issues.
Rollup merge of rust-lang#73937 - JohnTitor:note-exhaustive-sized-int…