Skip to content

Commit 42b9e92

Browse files
committed
Auto merge of #6551 - phansch:tiny-symbol-cleanup, r=flip1995
Tiny Symbol cleanup * Renames `sym.rs` to `sym_helper.rs` so that the `sym as rustc_sym` is no longer needed. * Removes one needless `symbol` from a path changelog: none
2 parents a6b72d3 + ea885d9 commit 42b9e92

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

clippy_lints/src/utils/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[macro_use]
2-
pub mod sym;
2+
pub mod sym_helper;
33

44
#[allow(clippy::module_name_repetitions)]
55
pub mod ast_utils;
@@ -56,8 +56,8 @@ use rustc_semver::RustcVersion;
5656
use rustc_session::Session;
5757
use rustc_span::hygiene::{ExpnKind, MacroKind};
5858
use rustc_span::source_map::original_sp;
59-
use rustc_span::sym as rustc_sym;
60-
use rustc_span::symbol::{self, kw, Symbol};
59+
use rustc_span::sym;
60+
use rustc_span::symbol::{kw, Symbol};
6161
use rustc_span::{BytePos, Pos, Span, DUMMY_SP};
6262
use rustc_target::abi::Integer;
6363
use rustc_trait_selection::traits::query::normalize::AtExt;
@@ -1121,7 +1121,7 @@ pub fn is_refutable(cx: &LateContext<'_>, pat: &Pat<'_>) -> bool {
11211121
/// Checks for the `#[automatically_derived]` attribute all `#[derive]`d
11221122
/// implementations have.
11231123
pub fn is_automatically_derived(attrs: &[ast::Attribute]) -> bool {
1124-
attrs.iter().any(|attr| attr.has_name(rustc_sym::automatically_derived))
1124+
attrs.iter().any(|attr| attr.has_name(sym::automatically_derived))
11251125
}
11261126

11271127
/// Remove blocks around an expression.
@@ -1514,7 +1514,7 @@ pub fn is_must_use_func_call(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
15141514
pub fn is_no_std_crate(krate: &Crate<'_>) -> bool {
15151515
krate.item.attrs.iter().any(|attr| {
15161516
if let ast::AttrKind::Normal(ref attr, _) = attr.kind {
1517-
attr.path == symbol::sym::no_std
1517+
attr.path == sym::no_std
15181518
} else {
15191519
false
15201520
}

clippy_lints/src/utils/sym.rs renamed to clippy_lints/src/utils/sym_helper.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#[macro_export]
2+
/// Convenience wrapper around rustc's `Symbol::intern`
23
macro_rules! sym {
34
($tt:tt) => {
45
rustc_span::symbol::Symbol::intern(stringify!($tt))

0 commit comments

Comments
 (0)