fn verify_piece(&mut self, p: &parse::Piece) {
        match *p {
            parse::String(..) => {}
            parse::CurrentArgument => {
                if self.nest_level == 0 {
                    self.ecx.span_err(self.fmtsp,
                                      "`#` reference used with nothing to \
                                       reference back to");
                }
            }
            parse::Argument(ref arg) => {
                // width/precision first, if they have implicit positional
                // parameters it makes more sense to consume them first.
                self.verify_count(arg.format.width);
                self.verify_count(arg.format.precision);

                // argument second, if it's an implicit positional parameter
                // it's written second, so it should come after width/precision.
                let pos = match arg.position {
                    parse::ArgumentNext => {
                        let i = self.next_arg;
                        if self.check_positional_ok() {
                            self.next_arg += 1;
                        }
                        Exact(i)
                    }
                    parse::ArgumentIs(i) => Exact(i),
                    parse::ArgumentNamed(s) => Named(s.to_managed()),
                };

                // and finally the method being applied
                match arg.method {
                    None => {
                        let ty = Known(arg.format.ty.to_managed());
                        self.verify_arg_type(pos, ty);
                    }
                    Some(ref method) => { self.verify_method(pos, *method); }
                }
            }
        }
    }
/// Verifies one piece of a parse string. All errors are not emitted as
/// fatal so we can continue giving errors about this and possibly other
/// format strings.
Verifies one piece of a parse string. All errors are not emitted as
fatal so we can continue giving errors about this and possibly other
format strings.
Verifies one piece of a parse string . All errors are not emitted as fatal so we can continue giving errors about this and possibly other format strings .
fn verify_piece(&mut self, p: &parse::Piece) {
        match *p {
            parse::String(..) => {}
            parse::CurrentArgument => {
                if self.nest_level == 0 {
                    self.ecx.span_err(self.fmtsp,
                                      "`#` reference used with nothing to \
                                       reference back to");
                }
            }
            parse::Argument(ref arg) => {
                // width/precision first, if they have implicit positional
                // parameters it makes more sense to consume them first.
                self.verify_count(arg.format.width);
                self.verify_count(arg.format.precision);
                // argument second, if it's an implicit positional parameter
                // it's written second, so it should come after width/precision.
                let pos = match arg.position {
                    parse::ArgumentNext => {
                        let i = self.next_arg;
                        if self.check_positional_ok() {
                            self.next_arg += 1;
                        }
                        Exact(i)
                    }
                    parse::ArgumentIs(i) => Exact(i),
                    parse::ArgumentNamed(s) => Named(s.to_managed()),
                };
                // and finally the method being applied
                match arg.method {
                    None => {
                        let ty = Known(arg.format.ty.to_managed());
                        self.verify_arg_type(pos, ty);
                    }
                    Some(ref method) => { self.verify_method(pos, *method); }
                }
            }
        }
    }
fn verify_piece ( & mut self , p : & parse :: Piece ) { match * p { parse :: String ( .. ) => { } parse :: CurrentArgument => { if self . nest_level == 0 { self . ecx . span_err ( self . fmtsp , " \
 " ) ; } } parse :: Argument ( ref arg ) => { // width/precision first, if they have implicit positional // parameters it makes more sense to consume them first. self . verify_count ( arg . format . width ) ; self . verify_count ( arg . format . precision ) ; // argument second, if it's an implicit positional parameter // it's written second, so it should come after width/precision. let pos = match arg . position { parse :: ArgumentNext => { let i = self . next_arg ; if self . check_positional_ok ( ) { self . next_arg += 1 ; } Exact ( i ) } parse :: ArgumentIs ( i ) => Exact ( i ) , parse :: ArgumentNamed ( s ) => Named ( s . to_managed ( ) ) , } ; // and finally the method being applied match arg . method { None => { let ty = Known ( arg . format . ty . to_managed ( ) ) ; self . verify_arg_type ( pos , ty ) ; } Some ( ref method ) => { self . verify_method ( pos , * method ) ; } } } } }
Verifies one piece of a parse string.
Verifies one piece of a parse string .
&mut self
p
&parse::Piece
&mut self
p
&parse::Piece