Remove unused ConstMutability
This commit is contained in:
parent
a2290db797
commit
3df1eb2c2b
3 changed files with 1 additions and 11 deletions
|
|
@ -222,7 +222,6 @@ impl<'a> CheckLoanCtxt<'a> {
|
|||
let illegal_if = match loan2.mutbl {
|
||||
MutableMutability => RESTR_ALIAS | RESTR_FREEZE | RESTR_CLAIM,
|
||||
ImmutableMutability => RESTR_ALIAS | RESTR_FREEZE,
|
||||
ConstMutability => RESTR_ALIAS,
|
||||
};
|
||||
debug!("illegal_if={:?}", illegal_if);
|
||||
|
||||
|
|
@ -598,8 +597,7 @@ impl<'a> CheckLoanCtxt<'a> {
|
|||
|
||||
// Check for a non-const loan of `loan_path`
|
||||
let cont = this.each_in_scope_loan(expr.id, |loan| {
|
||||
if loan.loan_path == loan_path &&
|
||||
loan.mutbl != ConstMutability {
|
||||
if loan.loan_path == loan_path {
|
||||
this.report_illegal_mutation(expr,
|
||||
full_loan_path,
|
||||
loan);
|
||||
|
|
|
|||
|
|
@ -568,11 +568,6 @@ impl<'a> GatherLoanCtxt<'a> {
|
|||
//! Implements the M-* rules in doc.rs.
|
||||
|
||||
match req_mutbl {
|
||||
ConstMutability => {
|
||||
// Data of any mutability can be lent as const.
|
||||
Ok(())
|
||||
}
|
||||
|
||||
ImmutableMutability => {
|
||||
// both imm and mut data can be lent as imm;
|
||||
// for mutable data, this is a freeze
|
||||
|
|
@ -596,7 +591,6 @@ impl<'a> GatherLoanCtxt<'a> {
|
|||
pub fn restriction_set(&self, req_mutbl: LoanMutability)
|
||||
-> RestrictionSet {
|
||||
match req_mutbl {
|
||||
ConstMutability => RESTR_EMPTY,
|
||||
ImmutableMutability => RESTR_EMPTY | RESTR_MUTATE | RESTR_CLAIM,
|
||||
MutableMutability => {
|
||||
RESTR_EMPTY | RESTR_MUTATE | RESTR_CLAIM | RESTR_FREEZE
|
||||
|
|
|
|||
|
|
@ -214,7 +214,6 @@ pub enum PartialTotal {
|
|||
#[deriving(Clone, Eq)]
|
||||
pub enum LoanMutability {
|
||||
ImmutableMutability,
|
||||
ConstMutability,
|
||||
MutableMutability,
|
||||
}
|
||||
|
||||
|
|
@ -232,7 +231,6 @@ impl ToStr for LoanMutability {
|
|||
fn to_str(&self) -> ~str {
|
||||
match *self {
|
||||
ImmutableMutability => ~"immutable",
|
||||
ConstMutability => ~"read-only",
|
||||
MutableMutability => ~"mutable",
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue