Be careful with expressions with attributes
This commit is contained in:
parent
6aa5f1ac6f
commit
cd45d5a81c
@ -58,6 +58,7 @@ fn check_block(&mut self, cx: &EarlyContext<'_>, block: &ast::Block) {
|
|||||||
&& let ctxt = block.span.ctxt()
|
&& let ctxt = block.span.ctxt()
|
||||||
&& stmt.span.ctxt() == ctxt
|
&& stmt.span.ctxt() == ctxt
|
||||||
&& expr.span.ctxt() == ctxt
|
&& expr.span.ctxt() == ctxt
|
||||||
|
&& expr.attrs.is_empty()
|
||||||
{
|
{
|
||||||
let sp = expr.span;
|
let sp = expr.span;
|
||||||
span_lint_and_sugg(
|
span_lint_and_sugg(
|
||||||
|
@ -94,3 +94,10 @@ mod issue9748 {
|
|||||||
let _ = for<'a> |_: &'a u32| -> () {};
|
let _ = for<'a> |_: &'a u32| -> () {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod issue9949 {
|
||||||
|
fn main() {
|
||||||
|
#[doc = "documentation"]
|
||||||
|
()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -94,3 +94,10 @@ fn main() {
|
|||||||
let _ = for<'a> |_: &'a u32| -> () {};
|
let _ = for<'a> |_: &'a u32| -> () {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod issue9949 {
|
||||||
|
fn main() {
|
||||||
|
#[doc = "documentation"]
|
||||||
|
()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user