Skip to content

Fix few typos #15218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions clippy_lints/src/disallowed_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ pub struct DisallowedMacros {

// When a macro is disallowed in an early pass, it's stored
// and emitted during the late pass. This happens for attributes.
earlies: AttrStorage,
early_macro_cache: AttrStorage,
}

impl DisallowedMacros {
pub fn new(tcx: TyCtxt<'_>, conf: &'static Conf, earlies: AttrStorage) -> Self {
pub fn new(tcx: TyCtxt<'_>, conf: &'static Conf, early_macro_cache: AttrStorage) -> Self {
let (disallowed, _) = create_disallowed_map(
tcx,
&conf.disallowed_macros,
Expand All @@ -88,7 +88,7 @@ impl DisallowedMacros {
disallowed,
seen: FxHashSet::default(),
derive_src: None,
earlies,
early_macro_cache,
}
}

Expand Down Expand Up @@ -129,7 +129,7 @@ impl_lint_pass!(DisallowedMacros => [DISALLOWED_MACROS]);
impl LateLintPass<'_> for DisallowedMacros {
fn check_crate(&mut self, cx: &LateContext<'_>) {
// once we check a crate in the late pass we can emit the early pass lints
if let Some(attr_spans) = self.earlies.clone().0.get() {
if let Some(attr_spans) = self.early_macro_cache.clone().0.get() {
for span in attr_spans {
self.check(cx, *span, None);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/auxiliary/external_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ impl _ExternalStruct {
pub fn _foo(self) {}
}

pub fn _exernal_foo() {}
pub fn _external_foo() {}
4 changes: 2 additions & 2 deletions tests/ui/used_underscore_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ fn main() {
//~^ used_underscore_items
}

// should not lint exteranl crate.
// should not lint external crate.
// user cannot control how others name their items
fn external_item_call() {
let foo_struct3 = external_item::_ExternalStruct {};
foo_struct3._foo();

external_item::_exernal_foo();
external_item::_external_foo();
}

// should not lint foreign functions.
Expand Down