pub(crate) fn visit_attrs(&mut self, attrs: &[ast::Attribute], style: ast::AttrStyle) -> bool {
        for attr in attrs {
            if attr.has_name(depr_skip_annotation()) {
                let file_name = self.parse_sess.span_to_filename(attr.span);
                self.report.append(
                    file_name,
                    vec![FormattingError::from_span(
                        attr.span,
                        self.parse_sess,
                        ErrorKind::DeprecatedAttr,
                    )],
                );
            } else {
                match &attr.kind {
                    ast::AttrKind::Normal(ref attribute_item, _)
                        if self.is_unknown_rustfmt_attr(&attribute_item.path.segments) =>
                    {
                        let file_name = self.parse_sess.span_to_filename(attr.span);
                        self.report.append(
                            file_name,
                            vec![FormattingError::from_span(
                                attr.span,
                                self.parse_sess,
                                ErrorKind::BadAttr,
                            )],
                        );
                    }
                    _ => (),
                }
            }
        }
        if contains_skip(attrs) {
            return true;
        }

        let attrs: Vec<_> = attrs.iter().filter(|a| a.style == style).cloned().collect();
        if attrs.is_empty() {
            return false;
        }

        let rewrite = attrs.rewrite(&self.get_context(), self.shape());
        let span = mk_sp(attrs[0].span.lo(), attrs[attrs.len() - 1].span.hi());
        self.push_rewrite(span, rewrite);

        false
    }
// Returns true if we should skip the following item.
Returns true if we should skip the following item.
Returns true if we should skip the following item .
pub(crate) fn visit_attrs(&mut self, attrs: &[ast::Attribute], style: ast::AttrStyle) -> bool {
        for attr in attrs {
            if attr.has_name(depr_skip_annotation()) {
                let file_name = self.parse_sess.span_to_filename(attr.span);
                self.report.append(
                    file_name,
                    vec![FormattingError::from_span(
                        attr.span,
                        self.parse_sess,
                        ErrorKind::DeprecatedAttr,
                    )],
                );
            } else {
                match &attr.kind {
                    ast::AttrKind::Normal(ref attribute_item, _)
                        if self.is_unknown_rustfmt_attr(&attribute_item.path.segments) =>
                    {
                        let file_name = self.parse_sess.span_to_filename(attr.span);
                        self.report.append(
                            file_name,
                            vec![FormattingError::from_span(
                                attr.span,
                                self.parse_sess,
                                ErrorKind::BadAttr,
                            )],
                        );
                    }
                    _ => (),
                }
            }
        }
        if contains_skip(attrs) {
            return true;
        }
        let attrs: Vec<_> = attrs.iter().filter(|a| a.style == style).cloned().collect();
        if attrs.is_empty() {
            return false;
        }
        let rewrite = attrs.rewrite(&self.get_context(), self.shape());
        let span = mk_sp(attrs[0].span.lo(), attrs[attrs.len() - 1].span.hi());
        self.push_rewrite(span, rewrite);
        false
    }
pub ( crate ) fn visit_attrs ( & mut self , attrs : & [ ast :: Attribute ] , style : ast :: AttrStyle ) -> bool { for attr in attrs { if attr . has_name ( depr_skip_annotation ( ) ) { let file_name = self . parse_sess . span_to_filename ( attr . span ) ; self . report . append ( file_name , vec ! [ FormattingError from_span ( attr span self parse_sess ErrorKind DeprecatedAttr ) ] , ) ; } else { match & attr . kind { ast :: AttrKind :: Normal ( ref attribute_item , _ ) if self . is_unknown_rustfmt_attr ( & attribute_item . path . segments ) => { let file_name = self . parse_sess . span_to_filename ( attr . span ) ; self . report . append ( file_name , vec ! [ FormattingError from_span ( attr span self parse_sess ErrorKind BadAttr ) ] , ) ; } _ => ( ) , } } } if contains_skip ( attrs ) { return true ; } let attrs : Vec < _ > = attrs . iter ( ) . filter ( | a | a . style == style ) . cloned ( ) . collect ( ) ; if attrs . is_empty ( ) { return false ; } let rewrite = attrs . rewrite ( & self . get_context ( ) , self . shape ( ) ) ; let span = mk_sp ( attrs [ 0 ] . span . lo ( ) , attrs [ attrs . len ( ) - 1 ] . span . hi ( ) ) ; self . push_rewrite ( span , rewrite ) ; false }
Returns true if we should skip the following item.
Returns true if we should skip the following item .
&mut self
attrs
&[ast::Attribute]
style
ast::AttrStyle
&mut self
attrs
&[ast::Attribute]
style
ast::AttrStyle