Fix few typos (#15218)

Fix few typos

changelog: none
This commit is contained in:
llogiq 2025-07-10 21:25:45 +00:00 committed by GitHub
commit 4dcaa80651
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 7 deletions

View file

@ -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,
@ -88,7 +88,7 @@ impl DisallowedMacros {
disallowed,
seen: FxHashSet::default(),
derive_src: None,
earlies,
early_macro_cache,
}
}
@ -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);
}

View file

@ -4,4 +4,4 @@ impl _ExternalStruct {
pub fn _foo(self) {}
}
pub fn _exernal_foo() {}
pub fn _external_foo() {}

View file

@ -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.