struct Rule;
struct Position;
enum Token {
Start {
rule: Rule,
pos: Position,
}
}
struct FmtToken(Token);
impl FmtToken {
fn foo(&self) {
match self.0 {
Token::Start { rule, pos } => unimplemented!(),
}
}
}
error[E0507]: cannot move out of borrowed content
--> src/main.rs:15:15
|
15 | match self.0 {
| ^^^^ cannot move out of borrowed content
16 | Token::Start { rule, pos } => unimplemented!(),
| ---- --- ...and here (use `ref pos` or `ref mut pos`)
| |
| hint: to prevent move, use `ref rule` or `ref mut rule`
I just ran into this. Shouldn't match-default-modes be inserting ref-mode here?