]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/upper_case_acronyms.rs
Rollup merge of #102846 - zertosh:update-syn, r=dtolnay
[rust.git] / src / tools / clippy / clippy_lints / src / upper_case_acronyms.rs
index 02bf09ed5068c152710bc2c32153f2241ab1649b..654ea306793bd20dc187bc7ea1a03abb01141e67 100644 (file)
@@ -93,7 +93,7 @@ fn check_ident(cx: &LateContext<'_>, ident: &Ident, be_aggressive: bool) {
             cx,
             UPPER_CASE_ACRONYMS,
             span,
-            &format!("name `{}` contains a capitalized acronym", ident),
+            &format!("name `{ident}` contains a capitalized acronym"),
             "consider making the acronym lowercase, except the initial letter",
             corrected,
             Applicability::MaybeIncorrect,
@@ -105,7 +105,7 @@ impl LateLintPass<'_> for UpperCaseAcronyms {
     fn check_item(&mut self, cx: &LateContext<'_>, it: &Item<'_>) {
         // do not lint public items or in macros
         if in_external_macro(cx.sess(), it.span)
-            || (self.avoid_breaking_exported_api && cx.access_levels.is_exported(it.def_id))
+            || (self.avoid_breaking_exported_api && cx.access_levels.is_exported(it.def_id.def_id))
         {
             return;
         }
@@ -114,6 +114,7 @@ fn check_item(&mut self, cx: &LateContext<'_>, it: &Item<'_>) {
                 check_ident(cx, &it.ident, self.upper_case_acronyms_aggressive);
             },
             ItemKind::Enum(ref enumdef, _) => {
+                check_ident(cx, &it.ident, self.upper_case_acronyms_aggressive);
                 // check enum variants separately because again we only want to lint on private enums and
                 // the fn check_variant does not know about the vis of the enum of its variants
                 enumdef