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