Skip to content

Commit 94d8318

Browse files
committed
Introduce hir::ImplItemImplKind
1 parent bd8b08d commit 94d8318

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

compiler/rustc_lint/src/nonstandard_style.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ pub(crate) fn method_context(cx: &LateContext<'_>, id: LocalDefId) -> MethodLate
3838
}
3939
}
4040

41-
fn assoc_item_in_trait_impl(cx: &LateContext<'_>, ii: &hir::ImplItem<'_>) -> bool {
42-
let item = cx.tcx.associated_item(ii.owner_id);
43-
item.trait_item_def_id.is_some()
44-
}
45-
4641
declare_lint! {
4742
/// The `non_camel_case_types` lint detects types, variants, traits and
4843
/// type parameters that don't have camel case names.
@@ -610,7 +605,7 @@ impl<'tcx> LateLintPass<'tcx> for NonUpperCaseGlobals {
610605

611606
fn check_impl_item(&mut self, cx: &LateContext<'_>, ii: &hir::ImplItem<'_>) {
612607
if let hir::ImplItemKind::Const(..) = ii.kind
613-
&& !assoc_item_in_trait_impl(cx, ii)
608+
&& let hir::ImplItemImplKind::Inherent { .. } = ii.impl_kind
614609
{
615610
NonUpperCaseGlobals::check_upper_case(cx, "associated constant", None, &ii.ident);
616611
}

0 commit comments

Comments
 (0)