Uh oh!
There was an error while loading. Please reload this page.
Fix #49660 - Adds checks to ensure existence of arithmetic trait implementations - #78259
Conversation
rust-highfive
commented
Oct 23, 2020
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sfackler (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Dylan-DPC-zz
commented
Nov 10, 2020
r? @KodrAus |
JohnCSimon
commented
Jan 11, 2021
Ping from triage |
KodrAus
commented
Jan 14, 2021
This looks like a great safety net to me! r=me after a rebase |
plaflamme
commented
Jan 14, 2021
@KodrAus I was actually working on this just now... I've merged and fixed the conflicts. Please take a look |
KodrAus
commented
Jan 14, 2021
@plaflamme Looks good to me! Would you like to squash these commits down (we try to avoid any merge commits if we can) then it should be good to go. r=me after that. |
AFAIK it isn't currently possible to do this. It is also more in line with other tests in the surrounding modules.
These tests invoke the various op traits using all accepted types they are implemented for as well as for references to those types. This fixesrust-lang#49660 and ensures the following implementations exist: * `Add`, `Sub`, `Mul`, `Div`, `Rem` * `T op T`, `T op &T`, `&T op T` and `&T op &T` * for all integer and floating point types * `AddAssign`, `SubAssign`, `MulAssign`, `DivAssign`, `RemAssign` * `&mut T op T` and `&mut T op &T` * for all integer and floating point types * `Neg` * `op T` and `op &T` * for all signed integer and floating point types * `Not` * `op T` and `op &T` * for `bool` * `BitAnd`, `BitOr`, `BitXor` * `T op T`, `T op &T`, `&T op T` and `&T op &T` * for all integer types and bool * `BitAndAssign`, `BitOrAssign`, `BitXorAssign` * `&mut T op T` and `&mut T op &T` * for all integer types and bool * `Shl`, `Shr` * `L op R`, `L op &R`, `&L op R` and `&L op &R` * for all pairs of integer types * `ShlAssign`, `ShrAssign` * `&mut L op R`, `&mut L op &R` * for all pairs of integer types
plaflamme
commented
Jan 14, 2021
@KodrAus I've rebased and force pushed, removing the merge commit. Let me know if you'd like me to squash all of them. I kept the ones affecting |
KodrAus
commented
Jan 14, 2021
Thanks @plaflamme! @bors r+ |
bors
commented
Jan 14, 2021
📌 Commit 64d695b has been approved by |
bors
commented
Jan 14, 2021
bors
commented
Jan 14, 2021
☀️ Test successful - checks-actions |
The first 2 commits fix an issue with the existing
wrapping.rstests. It wasn't referred to from the module, so the file was being ignored. This is fixed in 872dc60 This surfaced a bug in its macro which is fixed in 8ddad18Lastly, commit 64d695b is the actual tests for fixing #49660
The following checks are done:
Add,Sub,Mul,Div,RemT op T,T op &T,&T op Tand&T op &TAddAssign,SubAssign,MulAssign,DivAssign,RemAssign&mut T op Tand&mut T op &TNegop Tandop &TNotop Tandop &TboolBitAnd,BitOr,BitXorT op T,T op &T,&T op Tand&T op &TBitAndAssign,BitOrAssign,BitXorAssign&mut T op Tand&mut T op &TShl,ShrL op R,L op &R,&L op Rand&L op &RShlAssign,ShrAssign&mut L op R,&mut L op &RNOTE: I'd like some feedback on improving the macros. I'm not familiar with the idioms and patterns there and composing them has been a challenge for me.
[EDIT]: updated links to commits after rebase.