mirror of https://github.com/rust-lang/rust.git
Do not collect tokens for doc comments
This commit is contained in:
parent
34244190d4
commit
8845f10e94
|
@ -588,7 +588,7 @@ impl EarlyLintPass for EarlyAttributes {
|
||||||
|
|
||||||
fn check_empty_line_after_outer_attr(cx: &EarlyContext<'_>, item: &rustc_ast::Item) {
|
fn check_empty_line_after_outer_attr(cx: &EarlyContext<'_>, item: &rustc_ast::Item) {
|
||||||
for attr in &item.attrs {
|
for attr in &item.attrs {
|
||||||
let attr_item = if let AttrKind::Normal(ref attr) = attr.kind {
|
let attr_item = if let AttrKind::Normal(ref attr, _) = attr.kind {
|
||||||
attr
|
attr
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -509,7 +509,7 @@ pub fn eq_attr(l: &Attribute, r: &Attribute) -> bool {
|
||||||
l.style == r.style
|
l.style == r.style
|
||||||
&& match (&l.kind, &r.kind) {
|
&& match (&l.kind, &r.kind) {
|
||||||
(DocComment(l1, l2), DocComment(r1, r2)) => l1 == r1 && l2 == r2,
|
(DocComment(l1, l2), DocComment(r1, r2)) => l1 == r1 && l2 == r2,
|
||||||
(Normal(l), Normal(r)) => eq_path(&l.path, &r.path) && eq_mac_args(&l.args, &r.args),
|
(Normal(l, _), Normal(r, _)) => eq_path(&l.path, &r.path) && eq_mac_args(&l.args, &r.args),
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ pub fn get_attr<'a>(
|
||||||
name: &'static str,
|
name: &'static str,
|
||||||
) -> impl Iterator<Item = &'a ast::Attribute> {
|
) -> impl Iterator<Item = &'a ast::Attribute> {
|
||||||
attrs.iter().filter(move |attr| {
|
attrs.iter().filter(move |attr| {
|
||||||
let attr = if let ast::AttrKind::Normal(ref attr) = attr.kind {
|
let attr = if let ast::AttrKind::Normal(ref attr, _) = attr.kind {
|
||||||
attr
|
attr
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1349,7 +1349,7 @@ pub fn is_must_use_func_call(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
|
||||||
|
|
||||||
pub fn is_no_std_crate(krate: &Crate<'_>) -> bool {
|
pub fn is_no_std_crate(krate: &Crate<'_>) -> bool {
|
||||||
krate.item.attrs.iter().any(|attr| {
|
krate.item.attrs.iter().any(|attr| {
|
||||||
if let ast::AttrKind::Normal(ref attr) = attr.kind {
|
if let ast::AttrKind::Normal(ref attr, _) = attr.kind {
|
||||||
attr.path == symbol::sym::no_std
|
attr.path == symbol::sym::no_std
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
|
|
Loading…
Reference in New Issue