2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2014-03-05 15:28:08 -08:00
|
|
|
use std::mem::*;
|
2011-05-23 18:52:55 -07:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2014-03-05 15:28:08 -08:00
|
|
|
assert_eq!(size_of::<u8>(), 1);
|
2015-01-25 22:05:03 +01:00
|
|
|
let (mut x, mut y) = (1, 2);
|
2014-03-05 15:28:08 -08:00
|
|
|
swap(&mut x, &mut y);
|
|
|
|
assert_eq!(x, 2);
|
2014-03-21 22:37:41 +11:00
|
|
|
assert_eq!(y, 1);
|
2011-08-13 00:10:18 -07:00
|
|
|
}
|
2016-10-23 21:43:41 +00:00
|
|
|
|
|
|
|
#[allow(unused)]
|
|
|
|
fn f() {
|
|
|
|
mod foo { pub use *; }
|
|
|
|
mod bar { pub use ::*; }
|
|
|
|
|
|
|
|
foo::main();
|
|
|
|
bar::main();
|
|
|
|
}
|