2014-12-05 17:56:25 -06:00
|
|
|
fn main() {
|
2015-03-03 02:42:26 -06:00
|
|
|
let foo = &mut 1;
|
2014-12-05 17:56:25 -06:00
|
|
|
|
|
|
|
// (separate lines to ensure the spans are accurate)
|
|
|
|
|
2015-01-12 00:01:44 -06:00
|
|
|
let &_ //~ ERROR mismatched types
|
2019-11-13 16:16:56 -06:00
|
|
|
//~| expected mutable reference `&mut {integer}`
|
|
|
|
//~| found reference `&_`
|
2016-08-19 18:05:37 -05:00
|
|
|
//~| types differ in mutability
|
2015-01-07 15:29:48 -06:00
|
|
|
= foo;
|
2014-12-05 17:56:25 -06:00
|
|
|
let &mut _ = foo;
|
|
|
|
|
2015-03-03 02:42:26 -06:00
|
|
|
let bar = &1;
|
2014-12-05 17:56:25 -06:00
|
|
|
let &_ = bar;
|
2015-01-12 00:01:44 -06:00
|
|
|
let &mut _ //~ ERROR mismatched types
|
2019-11-13 16:16:56 -06:00
|
|
|
//~| expected reference `&{integer}`
|
|
|
|
//~| found mutable reference `&mut _`
|
2016-08-19 18:05:37 -05:00
|
|
|
//~| types differ in mutability
|
2014-12-05 17:56:25 -06:00
|
|
|
= bar;
|
|
|
|
}
|