Skip to content

Commit 74de969

Browse files
committed
Auto merge of #146494 - jdonszelmann:rollup-0bbwwwf, r=jdonszelmann
Rollup of 5 pull requests Successful merges: - rust-lang/rust#146389 (Convert `no_std` and `no_core` to the new attribute infrastructure) - rust-lang/rust#146403 (sort array trait implementation suggestions correctly) - rust-lang/rust#146452 (Improve `alloc::Layout` coverage) - rust-lang/rust#146477 (Improve `core::char` coverage) - rust-lang/rust#146481 (Improve `core::hash` coverage) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 12b5004 + 1b6076e commit 74de969

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

clippy_utils/src/lib.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,17 +2133,11 @@ pub fn std_or_core(cx: &LateContext<'_>) -> Option<&'static str> {
21332133
}
21342134

21352135
pub fn is_no_std_crate(cx: &LateContext<'_>) -> bool {
2136-
cx.tcx
2137-
.hir_attrs(hir::CRATE_HIR_ID)
2138-
.iter()
2139-
.any(|attr| attr.has_name(sym::no_std))
2136+
find_attr!(cx.tcx.hir_attrs(hir::CRATE_HIR_ID), AttributeKind::NoStd(..))
21402137
}
21412138

21422139
pub fn is_no_core_crate(cx: &LateContext<'_>) -> bool {
2143-
cx.tcx
2144-
.hir_attrs(hir::CRATE_HIR_ID)
2145-
.iter()
2146-
.any(|attr| attr.has_name(sym::no_core))
2140+
find_attr!(cx.tcx.hir_attrs(hir::CRATE_HIR_ID), AttributeKind::NoCore(..))
21472141
}
21482142

21492143
/// Check if parent of a hir node is a trait implementation block.

0 commit comments

Comments
 (0)