Uh oh!
There was an error while loading. Please reload this page.
Fix bug in integer range matching - #57978
Conversation
rust-highfive
commented
Jan 29, 2019
(rust_highfive has picked a reviewer for you, use r? to override) |
varkor
commented
Jan 29, 2019
r? @oli-obk |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
So this basically makes sure that unsigned comparison of signed numbers still works out?
There was a problem hiding this comment.
Yeah. I'll add a comment.
rust-highfive
commented
Jan 31, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
oli-obk
commented
Jan 31, 2019
@bors r+ |
bors
commented
Jan 31, 2019
📌 Commit 441355d7c2fe99b1e666d3c30ee9b6c7996547bf has been approved by |
oli-obk
commented
Jan 31, 2019
@bors r- r=me with the comment nit addressed |
@varkor your update to the comment (890198445cde6603ea58c67a3177d38c36da4ede) continues to refer to floating-point numbers rather than signed integers (which is what I had interpreted @matthewjasper 's comment nit as referring to). So now I am inferring that you did in fact mean to reference floating-point numbers in your comment. I haven't attempted to validate the reasoning in the comment/code when applied to floating-point numbers.
But, both your own code here and the referenced code in pattern/_match.rs, is only going to look at ranges constructed from one of the types { ... so ... is there some way that floating point values can arise in these code paths? Even the underlying representation in the MIR interpreter, as far as I can tell, avoids using floating-point values... |
pnkfelix
commented
Feb 1, 2019
(If in fact floating-point values can arise ... I guess I'd expect to see a unit test illustrating that scenario...) |
varkor
commented
Feb 1, 2019
Sorry, I must have been distracted when editing the comment; it should not refer to floating-point numbers at all. I think I was conflating it with another problem I've been thinking about recently. Floating-point range patterns are not permitted in this location and do not need to be handled. I shall update the comment (and squash all of the edits) once I get back to my computer. Sorry for the confusion. |
8901984 to
cd1047eComparevarkor
commented
Feb 1, 2019
@bors r=oli-obk |
bors
commented
Feb 1, 2019
📌 Commit cd1047e has been approved by |
…oli-obk Fix bug in integer range matching Fixes#57894.
bors
commented
Feb 1, 2019
bors
commented
Feb 1, 2019
☀️ Test successful - checks-travis, status-appveyor |
[beta] Rollup backports Cherry-picked: * #58008: Pass correct arguments to places_conflict * #58007: Don't panic when accessing enum variant ctor using `Self` in match * #57978: Fix bug in integer range matching * #57862: Build the standard library for thumbv7neon-unknown-linux-gnueabihf in CI * #57659: Fix release manifest generation r? @ghost
Fixes#57894.