fn try_consume(&mut self) -> bool {
        if self.qualif.intersects(Qualif::STATIC) && self.mode != Mode::Fn {
            let msg = if self.mode == Mode::Static ||
                         self.mode == Mode::StaticMut {
                "cannot refer to other statics by value, use the \
                 address-of operator or a constant instead"
            } else {
                "cannot refer to statics by value, use a constant instead"
            };
            struct_span_err!(self.tcx.sess, self.span, E0394, "{}", msg)
                .span_label(self.span, &format!("referring to another static by value"))
                .note(&format!("use the address-of operator or a constant instead"))
                .emit();

            // Replace STATIC with NOT_CONST to avoid further errors.
            self.qualif = self.qualif - Qualif::STATIC;
            self.add(Qualif::NOT_CONST);

            false
        } else {
            true
        }
    }
/// Check if an Lvalue with the current qualifications could
/// be consumed, by either an operand or a Deref projection.
Check if an Lvalue with the current qualifications could
be consumed, by either an operand or a Deref projection.
Check if an Lvalue with the current qualifications could be consumed by either an operand or a Deref projection .
fn try_consume(&mut self) -> bool {
        if self.qualif.intersects(Qualif::STATIC) && self.mode != Mode::Fn {
            let msg = if self.mode == Mode::Static ||
                         self.mode == Mode::StaticMut {
                "cannot refer to other statics by value, use the \
                 address-of operator or a constant instead"
            } else {
                "cannot refer to statics by value, use a constant instead"
            };
            struct_span_err!(self.tcx.sess, self.span, E0394, "{}", msg)
                .span_label(self.span, &format!("referring to another static by value"))
                .note(&format!("use the address-of operator or a constant instead"))
                .emit();
            // Replace STATIC with NOT_CONST to avoid further errors.
            self.qualif = self.qualif - Qualif::STATIC;
            self.add(Qualif::NOT_CONST);
            false
        } else {
            true
        }
    }
fn try_consume ( & mut self ) -> bool { if self . qualif . intersects ( Qualif :: STATIC ) && self . mode != Mode :: Fn { let msg = if self . mode == Mode :: Static || self . mode == Mode :: StaticMut { " \
 " } else { " " } ; struct_span_err ! ( self tcx sess self span E0394 " " msg ) . span_label ( self . span , & format ! ( " " ) ) . note ( & format ! ( " " ) ) . emit ( ) ; // Replace STATIC with NOT_CONST to avoid further errors. self . qualif = self . qualif - Qualif :: STATIC ; self . add ( Qualif :: NOT_CONST ) ; false } else { true } }
Check if an Lvalue with the current qualifications could
be consumed, by either an operand or a Deref projection.
Check if an Lvalue with the current qualifications could be consumed by either an operand or a Deref projection .
&mut self
&mut self