-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
Currently, we don't define Ord for &mut T
if T
is Ord
. But we should. As a curious side-effect, that permits you to write things like:
fn min<T:Ord>(x: T, y: T) -> T {
if x < y { x } else { y }
}
pub fn main() {
let mut x = 3;
let mut y = 4;
let mut z = 5;
*min(&mut x, &mut y) = min(0, z);
}
Metadata
Metadata
Assignees
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.