@@ -7,7 +7,6 @@ use rustc::ty::{self, TyCtxt};
7
7
use semver:: Version ;
8
8
use syntax:: ast:: { Attribute , AttrStyle , Lit , LitKind , MetaItemKind , NestedMetaItem , NestedMetaItemKind } ;
9
9
use syntax:: codemap:: Span ;
10
- use syntax_pos:: { Pos } ;
11
10
use utils:: { in_macro, match_def_path, opt_def_id, paths, snippet_opt, span_lint, span_lint_and_then} ;
12
11
13
12
/// **What it does:** Checks for items annotated with `#[inline(always)]`,
@@ -268,7 +267,24 @@ fn check_attrs(cx: &LateContext, span: Span, name: &Name, attrs: &[Attribute]) {
268
267
269
268
if let Some ( snippet) = snippet_opt ( cx, attr_to_item_span) {
270
269
let lines = snippet. split ( '\n' ) . collect :: < Vec < _ > > ( ) ;
271
- if lines. iter ( ) . filter ( |l| l. trim ( ) . is_empty ( ) ) . count ( ) > 1 && !is_hidden_attr ( attr) {
270
+ if lines. iter ( ) . filter ( |l| l. trim ( ) . is_empty ( ) ) . count ( ) > 1 {
271
+ println ! ( "attr.style {:?}" , attr. style) ;
272
+ println ! ( "attr.name() {:?}" , attr. name( ) ) ;
273
+ println ! ( "attr.meta() {:?}" , attr. meta( ) ) ;
274
+ println ! ( "attr.value_str() {:?}" , attr. value_str( ) ) ;
275
+ println ! ( "attr.is_sugared_doc {:?}" , attr. is_sugared_doc) ;
276
+ println ! ( "attr.path {:?}" , attr. path) ;
277
+ println ! ( "attr.span {:?}" , attr. span) ;
278
+ println ! ( "attr.span.end_point() {:?}" , attr. span. end_point( ) ) ;
279
+ println ! ( "attr.span.next_point() {:?}" , attr. span. next_point( ) ) ;
280
+ println ! ( "attr.span.source_callsite() {:?}" , attr. span. source_callsite( ) ) ;
281
+ println ! ( "attr.span.source_callee() {:?}" , attr. span. source_callee( ) ) ;
282
+ println ! ( "attr.span.macro_backtrace() {:?}" , attr. span. macro_backtrace( ) ) ;
283
+ println ! ( "attr.span.compiler_desugaring_kind() {:?}" , attr. span. compiler_desugaring_kind( ) ) ;
284
+ println ! ( "attr.span.end_point().macro_backtrace() {:?}" , attr. span. end_point( ) . macro_backtrace( ) ) ;
285
+ println ! ( "attr.span.end_point().lo() {:?}" , attr. span. end_point( ) . lo( ) ) ;
286
+ println ! ( "attr.span.end_point().hi() {:?}" , attr. span. end_point( ) . hi( ) ) ;
287
+ println ! ( "whats between? {:?}" , snippet_opt( cx, Span :: new( attr. span. end_point( ) . lo( ) , attr. span. end_point( ) . hi( ) , attr. span. end_point( ) . ctxt( ) ) ) ) ;
272
288
span_lint (
273
289
cx,
274
290
EMPTY_LINE_AFTER_OUTER_ATTR ,
@@ -313,10 +329,6 @@ fn check_semver(cx: &LateContext, span: Span, lit: &Lit) {
313
329
) ;
314
330
}
315
331
316
- fn is_hidden_attr ( attr : & Attribute ) -> bool {
317
- attr. span . lo ( ) . to_usize ( ) == 0 && attr. span . hi ( ) . to_usize ( ) == 0
318
- }
319
-
320
332
fn is_word ( nmi : & NestedMetaItem , expected : & str ) -> bool {
321
333
if let NestedMetaItemKind :: MetaItem ( ref mi) = nmi. node {
322
334
mi. is_word ( ) && mi. name ( ) == expected
0 commit comments