Add hir::Attribute
This commit is contained in:
parent
53b2c7cc95
commit
d50c0a5480
89 changed files with 1144 additions and 659 deletions
|
@ -387,7 +387,7 @@ pub struct MissingDoc;
|
|||
|
||||
impl_lint_pass!(MissingDoc => [MISSING_DOCS]);
|
||||
|
||||
fn has_doc(attr: &ast::Attribute) -> bool {
|
||||
fn has_doc(attr: &hir::Attribute) -> bool {
|
||||
if attr.is_doc_comment() {
|
||||
return true;
|
||||
}
|
||||
|
@ -1012,7 +1012,7 @@ declare_lint_pass!(InvalidNoMangleItems => [NO_MANGLE_CONST_ITEMS, NO_MANGLE_GEN
|
|||
impl<'tcx> LateLintPass<'tcx> for InvalidNoMangleItems {
|
||||
fn check_item(&mut self, cx: &LateContext<'_>, it: &hir::Item<'_>) {
|
||||
let attrs = cx.tcx.hir().attrs(it.hir_id());
|
||||
let check_no_mangle_on_generic_fn = |no_mangle_attr: &ast::Attribute,
|
||||
let check_no_mangle_on_generic_fn = |no_mangle_attr: &hir::Attribute,
|
||||
impl_generics: Option<&hir::Generics<'_>>,
|
||||
generics: &hir::Generics<'_>,
|
||||
span| {
|
||||
|
@ -1176,7 +1176,7 @@ declare_lint_pass!(
|
|||
);
|
||||
|
||||
impl<'tcx> LateLintPass<'tcx> for UnstableFeatures {
|
||||
fn check_attribute(&mut self, cx: &LateContext<'_>, attr: &ast::Attribute) {
|
||||
fn check_attribute(&mut self, cx: &LateContext<'_>, attr: &hir::Attribute) {
|
||||
if attr.has_name(sym::feature)
|
||||
&& let Some(items) = attr.meta_item_list()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue