2016-03-12 21:32:24 -06:00
|
|
|
#![feature(custom_attribute)]
|
|
|
|
#![allow(dead_code, unused_attributes)]
|
|
|
|
|
|
|
|
// #[miri_run(expected = "Int(1)")]
|
2016-03-12 22:39:09 -06:00
|
|
|
// fn one_line_ref() -> i64 {
|
2016-03-12 21:32:24 -06:00
|
|
|
// *&1
|
|
|
|
// }
|
|
|
|
|
|
|
|
// #[miri_run(expected = "Int(1)")]
|
2016-03-12 22:39:09 -06:00
|
|
|
// fn basic_ref() -> i64 {
|
2016-03-12 21:32:24 -06:00
|
|
|
// let x = &1;
|
|
|
|
// *x
|
|
|
|
// }
|
|
|
|
|
|
|
|
// #[miri_run(expected = "Int(3)")]
|
2016-03-12 22:39:09 -06:00
|
|
|
// fn basic_ref_mut() -> i64 {
|
2016-03-12 21:32:24 -06:00
|
|
|
// let x = &mut 1;
|
|
|
|
// *x += 2;
|
|
|
|
// *x
|
|
|
|
// }
|
|
|
|
|
|
|
|
// #[miri_run(expected = "Int(3)")]
|
2016-03-12 22:39:09 -06:00
|
|
|
// fn basic_ref_mut_var() -> i64 {
|
2016-03-12 21:32:24 -06:00
|
|
|
// let mut a = 1;
|
|
|
|
// {
|
|
|
|
// let x = &mut a;
|
|
|
|
// *x += 2;
|
|
|
|
// }
|
|
|
|
// a
|
|
|
|
// }
|