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 38a898b commit bf6b0a8Copy full SHA for bf6b0a8
tests/ui/ptr_ops/ptr-swap-basic.rs
@@ -1,9 +1,13 @@
1
+//! Check the basic functionality of `std::mem::swap` to ensure it correctly
2
+//! exchanges the values of two mutable variables.
3
+
4
//@ run-pass
5
6
use std::mem::swap;
7
8
pub fn main() {
- let mut x = 3; let mut y = 7;
9
+ let mut x = 3;
10
+ let mut y = 7;
11
swap(&mut x, &mut y);
12
assert_eq!(x, 7);
13
assert_eq!(y, 3);
0 commit comments