1
Fork 0

Rollup merge of #94947 - Dylan-DPC:fix/typos, r=oli-obk

fix typos

Rework of #94603 which got closed as I was trying to unmerge and repush.  This is a subset of changes from the original pr as I sed'd whatever typos I remembered from the original PR

thanks to `@cuishuang` for the original PR
This commit is contained in:
Matthias Krüger 2022-03-15 17:15:53 +01:00 committed by GitHub
commit 277802e99a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 24 additions and 24 deletions

View file

@ -328,7 +328,7 @@ impl UnsafeCode {
cx.struct_span_lint(UNSAFE_CODE, span, decorate);
}
fn report_overriden_symbol_name(&self, cx: &EarlyContext<'_>, span: Span, msg: &str) {
fn report_overridden_symbol_name(&self, cx: &EarlyContext<'_>, span: Span, msg: &str) {
self.report_unsafe(cx, span, |lint| {
lint.build(msg)
.note(
@ -380,14 +380,14 @@ impl EarlyLintPass for UnsafeCode {
ast::ItemKind::Fn(..) => {
if let Some(attr) = cx.sess().find_by_name(&it.attrs, sym::no_mangle) {
self.report_overriden_symbol_name(
self.report_overridden_symbol_name(
cx,
attr.span,
"declaration of a `no_mangle` function",
);
}
if let Some(attr) = cx.sess().find_by_name(&it.attrs, sym::export_name) {
self.report_overriden_symbol_name(
self.report_overridden_symbol_name(
cx,
attr.span,
"declaration of a function with `export_name`",
@ -397,14 +397,14 @@ impl EarlyLintPass for UnsafeCode {
ast::ItemKind::Static(..) => {
if let Some(attr) = cx.sess().find_by_name(&it.attrs, sym::no_mangle) {
self.report_overriden_symbol_name(
self.report_overridden_symbol_name(
cx,
attr.span,
"declaration of a `no_mangle` static",
);
}
if let Some(attr) = cx.sess().find_by_name(&it.attrs, sym::export_name) {
self.report_overriden_symbol_name(
self.report_overridden_symbol_name(
cx,
attr.span,
"declaration of a static with `export_name`",
@ -419,14 +419,14 @@ impl EarlyLintPass for UnsafeCode {
fn check_impl_item(&mut self, cx: &EarlyContext<'_>, it: &ast::AssocItem) {
if let ast::AssocItemKind::Fn(..) = it.kind {
if let Some(attr) = cx.sess().find_by_name(&it.attrs, sym::no_mangle) {
self.report_overriden_symbol_name(
self.report_overridden_symbol_name(
cx,
attr.span,
"declaration of a `no_mangle` method",
);
}
if let Some(attr) = cx.sess().find_by_name(&it.attrs, sym::export_name) {
self.report_overriden_symbol_name(
self.report_overridden_symbol_name(
cx,
attr.span,
"declaration of a method with `export_name`",

View file

@ -116,7 +116,7 @@ impl<'s> LintLevelsBuilder<'s> {
continue
};
for id in ids {
// ForceWarn and Forbid cannot be overriden
// ForceWarn and Forbid cannot be overridden
if let Some((Level::ForceWarn | Level::Forbid, _)) = self.current_specs().get(&id) {
continue;
}
@ -137,7 +137,7 @@ impl<'s> LintLevelsBuilder<'s> {
self.sets.get_lint_level(id.lint, self.cur, Some(self.current_specs()), &self.sess);
// Setting to a non-forbid level is an error if the lint previously had
// a forbid level. Note that this is not necessarily true even with a
// `#[forbid(..)]` attribute present, as that is overriden by `--cap-lints`.
// `#[forbid(..)]` attribute present, as that is overridden by `--cap-lints`.
//
// This means that this only errors if we're truly lowering the lint
// level from forbid.