From 13e889986d3f37014b4f8c3e892457831cb5d03b Mon Sep 17 00:00:00 2001 From: Dylan DPC Date: Tue, 15 Mar 2022 02:00:08 +0100 Subject: [PATCH] fix typos --- compiler/rustc_lint/src/builtin.rs | 14 +++++++------- compiler/rustc_lint/src/levels.rs | 4 ++-- compiler/rustc_middle/src/mir/generic_graph.rs | 2 +- compiler/rustc_middle/src/mir/query.rs | 2 +- compiler/rustc_mir_build/src/check_unsafety.rs | 2 +- compiler/rustc_session/src/options.rs | 4 ++-- compiler/rustc_session/src/parse.rs | 2 +- .../src/traits/error_reporting/mod.rs | 2 +- library/alloc/src/collections/btree/set/tests.rs | 2 +- src/bootstrap/builder.rs | 2 +- src/librustdoc/passes/collect_intra_doc_links.rs | 2 +- src/librustdoc/visit_ast.rs | 2 +- src/test/rustdoc-ui/display-output.rs | 2 +- src/test/ui/lint/cli-lint-override.rs | 2 +- src/tools/clippy/.github/ISSUE_TEMPLATE/ice.yml | 2 +- .../clippy/clippy_lints/src/upper_case_acronyms.rs | 2 +- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 53ad837434985..47de4c9be26fe 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -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`", diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs index 7b018e7f75fa7..1a7cbb61ae306 100644 --- a/compiler/rustc_lint/src/levels.rs +++ b/compiler/rustc_lint/src/levels.rs @@ -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. diff --git a/compiler/rustc_middle/src/mir/generic_graph.rs b/compiler/rustc_middle/src/mir/generic_graph.rs index 770b52a4d4b0f..dbebed67c2bd1 100644 --- a/compiler/rustc_middle/src/mir/generic_graph.rs +++ b/compiler/rustc_middle/src/mir/generic_graph.rs @@ -50,7 +50,7 @@ fn bb_to_graph_node(block: BasicBlock, body: &Body<'_>, dark_mode: bool) -> Node let style = NodeStyle { title_bg: Some(bgcolor.to_owned()), ..Default::default() }; let mut stmts: Vec = data.statements.iter().map(|x| format!("{:?}", x)).collect(); - // add the terminator to the stmts, gsgdt can print it out seperately + // add the terminator to the stmts, gsgdt can print it out separately let mut terminator_head = String::new(); data.terminator().kind.fmt_head(&mut terminator_head).unwrap(); stmts.push(terminator_head); diff --git a/compiler/rustc_middle/src/mir/query.rs b/compiler/rustc_middle/src/mir/query.rs index c237ba5c4ba20..00d1370625f9c 100644 --- a/compiler/rustc_middle/src/mir/query.rs +++ b/compiler/rustc_middle/src/mir/query.rs @@ -250,7 +250,7 @@ pub struct BorrowCheckResult<'tcx> { /// The result of the `mir_const_qualif` query. /// -/// Each field (except `error_occured`) corresponds to an implementer of the `Qualif` trait in +/// Each field (except `error_occurred`) corresponds to an implementer of the `Qualif` trait in /// `rustc_const_eval/src/transform/check_consts/qualifs.rs`. See that file for more information on each /// `Qualif`. #[derive(Clone, Copy, Debug, Default, TyEncodable, TyDecodable, HashStable)] diff --git a/compiler/rustc_mir_build/src/check_unsafety.rs b/compiler/rustc_mir_build/src/check_unsafety.rs index 2d1198edbc393..a96bb4e03d97a 100644 --- a/compiler/rustc_mir_build/src/check_unsafety.rs +++ b/compiler/rustc_mir_build/src/check_unsafety.rs @@ -608,7 +608,7 @@ pub fn check_unsafety<'tcx>(tcx: TyCtxt<'tcx>, def: ty::WithOptConstParam InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { (true, Some(None)) => { Some(format!("{cannot_do_this} in const contexts")) } - // overriden post message + // overridden post message (true, Some(Some(post_message))) => { Some(format!("{cannot_do_this}{post_message}")) } diff --git a/library/alloc/src/collections/btree/set/tests.rs b/library/alloc/src/collections/btree/set/tests.rs index 032563e4f09be..00a2a0aaa14ce 100644 --- a/library/alloc/src/collections/btree/set/tests.rs +++ b/library/alloc/src/collections/btree/set/tests.rs @@ -609,7 +609,7 @@ fn assert_send() { #[allow(dead_code)] // Check that the member-like functions conditionally provided by #[derive()] -// are not overriden by genuine member functions with a different signature. +// are not overridden by genuine member functions with a different signature. fn assert_derives() { fn hash(v: BTreeSet, state: &mut H) { v.hash(state); diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 0232446b1f7ae..7846c6db898a8 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -1795,7 +1795,7 @@ impl Rustflags { } /// By default, cargo will pick up on various variables in the environment. However, bootstrap - /// reuses those variables to pass additional flags to rustdoc, so by default they get overriden. + /// reuses those variables to pass additional flags to rustdoc, so by default they get overridden. /// Explicitly add back any previous value in the environment. /// /// `prefix` is usually `RUSTFLAGS` or `RUSTDOCFLAGS`. diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 64c0ae32aadde..3d8a62d50e06d 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -948,7 +948,7 @@ fn resolve_associated_trait_item<'a>( /// /// This function returns `None` if no associated item was found in the impl. /// This can occur when the trait associated item has a default value that is -/// not overriden in the impl. +/// not overridden in the impl. /// /// This is just a wrapper around [`TyCtxt::impl_item_implementor_ids()`] and /// [`TyCtxt::associated_item()`] (with some helpful logging added). diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 1693034db0e82..e793ee75fd2e0 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -326,7 +326,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { om.items.push((item, renamed)) } hir::ItemKind::Macro(ref macro_def, _) => { - // `#[macro_export] macro_rules!` items are handled seperately in `visit()`, + // `#[macro_export] macro_rules!` items are handled separately in `visit()`, // above, since they need to be documented at the module top level. Accordingly, // we only want to handle macros if one of three conditions holds: // diff --git a/src/test/rustdoc-ui/display-output.rs b/src/test/rustdoc-ui/display-output.rs index c40d99c9d4c3d..ec27a9f6ba31c 100644 --- a/src/test/rustdoc-ui/display-output.rs +++ b/src/test/rustdoc-ui/display-output.rs @@ -1,4 +1,4 @@ -// Test that `--show-output` has an effect and `allow(unused)` can be overriden. +// Test that `--show-output` has an effect and `allow(unused)` can be overridden. // check-pass // edition:2018 diff --git a/src/test/ui/lint/cli-lint-override.rs b/src/test/ui/lint/cli-lint-override.rs index 7d762b05c97b9..a0e853fc38489 100644 --- a/src/test/ui/lint/cli-lint-override.rs +++ b/src/test/ui/lint/cli-lint-override.rs @@ -1,5 +1,5 @@ // Tests that subsequent lints specified via the command line override -// each other, except for ForceWarn and Forbid, which cannot be overriden. +// each other, except for ForceWarn and Forbid, which cannot be overridden. // // revisions: warn_deny forbid_warn force_warn_deny // diff --git a/src/tools/clippy/.github/ISSUE_TEMPLATE/ice.yml b/src/tools/clippy/.github/ISSUE_TEMPLATE/ice.yml index 2a5b8b3c89141..81bd9c5e03278 100644 --- a/src/tools/clippy/.github/ISSUE_TEMPLATE/ice.yml +++ b/src/tools/clippy/.github/ISSUE_TEMPLATE/ice.yml @@ -10,7 +10,7 @@ body: attributes: label: Summary description: | - If possible, try to provide a minimal verifiable example. You can read ["Rust Bug Minimization Patterns"][mve] for how to create smaller examples. Otherwise, provide the crate where the ICE occured. + If possible, try to provide a minimal verifiable example. You can read ["Rust Bug Minimization Patterns"][mve] for how to create smaller examples. Otherwise, provide the crate where the ICE occurred. [mve]: http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/ validations: diff --git a/src/tools/clippy/clippy_lints/src/upper_case_acronyms.rs b/src/tools/clippy/clippy_lints/src/upper_case_acronyms.rs index 7286d0a7bf99b..02bf09ed5068c 100644 --- a/src/tools/clippy/clippy_lints/src/upper_case_acronyms.rs +++ b/src/tools/clippy/clippy_lints/src/upper_case_acronyms.rs @@ -114,7 +114,7 @@ impl LateLintPass<'_> for UpperCaseAcronyms { check_ident(cx, &it.ident, self.upper_case_acronyms_aggressive); }, ItemKind::Enum(ref enumdef, _) => { - // check enum variants seperately because again we only want to lint on private enums and + // check enum variants separately because again we only want to lint on private enums and // the fn check_variant does not know about the vis of the enum of its variants enumdef .variants