1. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.
2. mir::Mutability -> ast::Mutability.
This commit is contained in:
parent
01a46509a4
commit
a7aec3f207
91 changed files with 292 additions and 319 deletions
|
|
@ -979,18 +979,18 @@ impl<'a> Parser<'a> {
|
|||
/// Parses mutability (`mut` or nothing).
|
||||
fn parse_mutability(&mut self) -> Mutability {
|
||||
if self.eat_keyword(kw::Mut) {
|
||||
Mutability::Mutable
|
||||
Mutability::Mut
|
||||
} else {
|
||||
Mutability::Immutable
|
||||
Mutability::Not
|
||||
}
|
||||
}
|
||||
|
||||
/// Possibly parses mutability (`const` or `mut`).
|
||||
fn parse_const_or_mut(&mut self) -> Option<Mutability> {
|
||||
if self.eat_keyword(kw::Mut) {
|
||||
Some(Mutability::Mutable)
|
||||
Some(Mutability::Mut)
|
||||
} else if self.eat_keyword(kw::Const) {
|
||||
Some(Mutability::Immutable)
|
||||
Some(Mutability::Not)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue