Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for Integer Overflow (RFC 560) #22020
Comments
aturon
added
the
B-RFC-approved
label
Feb 6, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
cc @Aatch |
This comment has been minimized.
This comment has been minimized.
|
(cc #20795) |
pnkfelix
referenced this issue
Feb 19, 2015
Closed
constant evaluation should not mask overflow for cases that are otherwise checked #22531
This comment has been minimized.
This comment has been minimized.
|
(cc #22532) |
This comment has been minimized.
This comment has been minimized.
|
@aturon does a |
This comment has been minimized.
This comment has been minimized.
|
@pnkfelix I'm not sure; I wasn't the one who updated this with a checklist. @nikomatsakis @alexcrichton? |
This comment has been minimized.
This comment has been minimized.
|
I would personally consider a |
This comment has been minimized.
This comment has been minimized.
|
Interesting. I consider a On Wed, Mar 04, 2015 at 05:27:27PM -0800, Alex Crichton wrote:
|
This comment has been minimized.
This comment has been minimized.
|
May also want to add:
(or whatever it should be named) To match with:
|
This comment has been minimized.
This comment has been minimized.
|
for consistency with the (of course it won't be a 100% correspondence anyway; e.g. we implement |
This was referenced Mar 11, 2015
This comment has been minimized.
This comment has been minimized.
|
@aturon to be 100% clear, the lint that is described here:
is a reference to the lint section of the RFC, and therefore is talking about linting for uses of Right? |
This comment has been minimized.
This comment has been minimized.
|
@pnkfelix I didn't make the detailed list here -- I would check with @nikomatsakis |
simias
referenced this issue
Mar 17, 2015
Closed
Inaccuracies in the reference about bitshifts and overflows #23421
This was referenced Mar 18, 2015
This comment has been minimized.
This comment has been minimized.
|
cc me |
This comment has been minimized.
This comment has been minimized.
|
@pnkfelix correct |
This comment has been minimized.
This comment has been minimized.
|
(regarding shift behavior, I thought the (old) discussion on #1877 was interesting. In particular there is a semi-open question of whether we should follow Java in our fallback behavior for the RHS of a shift, or if we should just pass it directly to LLVM, and live with underspecification in general.) |
This comment has been minimized.
This comment has been minimized.
|
If we weren't willing to live with underspecification around the result of arithmetic overflows (with checks off), then it seems we should be consistent and be the same way with respect to shifts also. |
pnkfelix
referenced this issue
Mar 19, 2015
Merged
overflowing-checking for rhs of shift operators #23536
This comment has been minimized.
This comment has been minimized.
|
@glaebhoerl yes that is a reasonable conclusion to draw. In any case, I have left a prominent spot in the code indicating what lines to uncomment to follow Java's approach; see: Update: To be clear: I originally wrote and tested the code with those masks in place. I only commented them out after reading #1877. It should be trivial to uncomment them if that's what we want. |
This comment has been minimized.
This comment has been minimized.
|
@glaebhoerl okay, due to #10183 and #23551, my mind is now completely turned around on this issue: As far as I can tell, we must ensure that the input-rhs is in the half-open range |
rust-highfive
added
the
P-backcompat-lang
label
Apr 10, 2015
rust-highfive
added this to the 1.0 milestone
Apr 10, 2015
pnkfelix
self-assigned this
Apr 10, 2015
theemathas
referenced this issue
Apr 13, 2015
Open
Literal overflow warnings should only apply to decimal. #24361
pnkfelix
referenced this issue
Apr 14, 2015
Merged
Fill in missing parts of Integer overflow API #24420
bors
added a commit
that referenced
this issue
Apr 16, 2015
bors
added a commit
that referenced
this issue
Apr 17, 2015
This comment has been minimized.
This comment has been minimized.
|
I think all of the backwards compatibility issues have now been resolved. |
This comment has been minimized.
This comment has been minimized.
|
Not sure how important that lint was. Nominating for discussion at next triage mtg. |
rust-highfive
added
P-medium
and removed
P-backcompat-lang
labels
Apr 23, 2015
This comment has been minimized.
This comment has been minimized.
|
(oops I added a "triage:" comment and then deleted it, but of course rust-highfive cannot turn back time.) |
This comment has been minimized.
This comment has been minimized.
|
My intent was to nominate, but also suggest a P-medium assignment for the remaining work here. I will put back the P-backcompat-lang label. |
pnkfelix
added
I-nominated
P-backcompat-lang
and removed
P-medium
labels
Apr 23, 2015
brson
added
the
P-high
label
Apr 29, 2015
brson
removed this from the 1.0 milestone
Apr 29, 2015
brson
removed
the
P-backcompat-lang
label
Apr 29, 2015
This comment has been minimized.
This comment has been minimized.
|
triage: Remaining work is P-medium (at most).... lint may only qualify as a "nice to have" at this point, it is unclear how important it will be. |
pnkfelix
added
P-medium
and removed
P-high
I-nominated
labels
Apr 30, 2015
alexcrichton
added
the
T-lang
label
Aug 11, 2015
This comment has been minimized.
This comment has been minimized.
|
I believe this has basically all been implemented, so closing. |
alexcrichton
closed this
Feb 18, 2016
This comment has been minimized.
This comment has been minimized.
|
(Well there is the lint that was listed in the description, but its questionable whether we actually need/want that...) |
aturon commentedFeb 6, 2015
RFC: rust-lang/rfcs#560
Final text: https://github.com/rust-lang/rfcs/blob/master/text/0560-integer-overflow.md
List of tasks to accomplish:
+,-,*#22532wrapping_add,wrapping_sub,wrapping_mulfrom theWrappingOpstrait #22532/,%(we currently check unconditionally; see #8460)wrapping_div,wrapping_remfrom theWrappingOpstrait (see rust-lang/rfcs#964) #24420<<and>>#23536wrapping_lshift,wrapping_rshiftfrom theWrappingOpstraitwrapping_shl,wrapping_shr.) #24420-for signed values #24500wrapping_negfrom theWrappingOpstrait #24420unsafefn or fn containingunsafeblocksunsafeblock, just a fn containingunsafeblocksu64/i64(on all of the above cases) - #23863 (#22531)Optional error checking onas(see http://internals.rust-lang.org/t/on-casts-and-checked-overflow/1710/15)Implementwrapping_as_Xmethods from theWrappingOpstraitashas been [re]defined to never panic).