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
|
|
@ -985,7 +985,7 @@ impl<'l> Visitor<'l> for PathCollector<'l> {
|
|||
// Even if the ref is mut, you can't change the ref, only
|
||||
// the data pointed at, so showing the initialising expression
|
||||
// is still worthwhile.
|
||||
ast::BindingMode::ByRef(_) => ast::Mutability::Immutable,
|
||||
ast::BindingMode::ByRef(_) => ast::Mutability::Not,
|
||||
ast::BindingMode::ByValue(mt) => mt,
|
||||
};
|
||||
self.collected_idents
|
||||
|
|
|
|||
|
|
@ -175,8 +175,8 @@ impl Sig for ast::Ty {
|
|||
}
|
||||
ast::TyKind::Ptr(ref mt) => {
|
||||
let prefix = match mt.mutbl {
|
||||
ast::Mutability::Mutable => "*mut ",
|
||||
ast::Mutability::Immutable => "*const ",
|
||||
ast::Mutability::Mut => "*mut ",
|
||||
ast::Mutability::Not => "*const ",
|
||||
};
|
||||
let nested = mt.ty.make(offset + prefix.len(), id, scx)?;
|
||||
let text = format!("{}{}", prefix, nested.text);
|
||||
|
|
@ -188,7 +188,7 @@ impl Sig for ast::Ty {
|
|||
prefix.push_str(&l.ident.to_string());
|
||||
prefix.push(' ');
|
||||
}
|
||||
if let ast::Mutability::Mutable = mt.mutbl {
|
||||
if let ast::Mutability::Mut = mt.mutbl {
|
||||
prefix.push_str("mut ");
|
||||
};
|
||||
|
||||
|
|
@ -330,7 +330,7 @@ impl Sig for ast::Item {
|
|||
match self.kind {
|
||||
ast::ItemKind::Static(ref ty, m, ref expr) => {
|
||||
let mut text = "static ".to_owned();
|
||||
if m == ast::Mutability::Mutable {
|
||||
if m == ast::Mutability::Mut {
|
||||
text.push_str("mut ");
|
||||
}
|
||||
let name = self.ident.to_string();
|
||||
|
|
@ -787,7 +787,7 @@ impl Sig for ast::ForeignItem {
|
|||
}
|
||||
ast::ForeignItemKind::Static(ref ty, m) => {
|
||||
let mut text = "static ".to_owned();
|
||||
if m == ast::Mutability::Mutable {
|
||||
if m == ast::Mutability::Mut {
|
||||
text.push_str("mut ");
|
||||
}
|
||||
let name = self.ident.to_string();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue