We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 136080b commit 42e3f95Copy full SHA for 42e3f95
src/lib.rs
@@ -622,5 +622,15 @@ fn check_numassign_ops() {
622
assert_eq!(compute(1, 2), 1)
623
}
624
625
-// TODO test `NumAssignRef`, but even the standard numeric types don't
626
-// implement this yet. (see rust pr41336)
+#[test]
+fn check_numassignref_ops() {
627
+ fn compute<T: NumAssignRef + Copy>(mut x: T, y: &T) -> T {
628
+ x *= y;
629
+ x /= y;
630
+ x %= y;
631
+ x += y;
632
+ x -= y;
633
+ x
634
+ }
635
+ assert_eq!(compute(1, &2), 1)
636
+}
0 commit comments