From bf88b113eab9c36e63f8461f5849138cb60d810a Mon Sep 17 00:00:00 2001 From: Frank Steffahn Date: Sun, 22 Aug 2021 14:46:15 +0200 Subject: Fix typos “a”→“an” MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compiler/rustc_resolve/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_resolve/src') diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 7114fd33188..5df2f22b789 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -668,7 +668,7 @@ enum NameBindingKind<'a> { } impl<'a> NameBindingKind<'a> { - /// Is this a name binding of a import? + /// Is this a name binding of an import? fn is_import(&self) -> bool { matches!(*self, NameBindingKind::Import { .. }) } @@ -3066,7 +3066,7 @@ impl<'a> Resolver<'a> { self.extern_prelude.get(&ident).map_or(true, |entry| entry.introduced_by_item); // Only suggest removing an import if both bindings are to the same def, if both spans // aren't dummy spans. Further, if both bindings are imports, then the ident must have - // been introduced by a item. + // been introduced by an item. let should_remove_import = duplicate && !has_dummy_span && ((new_binding.is_extern_crate() || old_binding.is_extern_crate()) || from_item); @@ -3213,7 +3213,7 @@ impl<'a> Resolver<'a> { Applicability::MaybeIncorrect, ); } else { - // Remove the entire line if we cannot extend the span back, this indicates a + // Remove the entire line if we cannot extend the span back, this indicates an // `issue_52891::{self}` case. err.span_suggestion( import.use_span_with_attributes, -- cgit 1.4.1-3-g733a5 From be9d2699ca3581448097ec446fecb45ec171975e Mon Sep 17 00:00:00 2001 From: Frank Steffahn Date: Sun, 22 Aug 2021 16:20:58 +0200 Subject: Fix more “a”/“an” typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compiler/rustc_codegen_llvm/src/builder.rs | 2 +- compiler/rustc_codegen_llvm/src/intrinsic.rs | 2 +- compiler/rustc_data_structures/src/owning_ref/mod.rs | 2 +- compiler/rustc_mir/src/borrow_check/mod.rs | 2 +- compiler/rustc_resolve/src/late/diagnostics.rs | 2 +- compiler/rustc_serialize/src/json.rs | 4 ++-- library/core/src/array/iter.rs | 2 +- library/std/src/ffi/c_str.rs | 2 +- library/std/src/ffi/os_str.rs | 2 +- library/std/src/sys_common/remutex/tests.rs | 4 ++-- src/librustdoc/formats/cache.rs | 2 +- src/test/ui/async-await/issues/issue-53249.rs | 2 +- src/test/ui/consts/cast-discriminant-zst-enum.rs | 2 +- src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs | 2 +- src/tools/rustfmt/src/visitor.rs | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) (limited to 'compiler/rustc_resolve/src') diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index 2139f9776b7..07e1b55afe5 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -558,7 +558,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { fn range_metadata(&mut self, load: &'ll Value, range: Range) { if self.sess().target.arch == "amdgpu" { - // amdgpu/LLVM does something weird and thinks a i64 value is + // amdgpu/LLVM does something weird and thinks an i64 value is // split into a v2i32, halving the bitwidth LLVM expects, // tripping an assertion. So, for now, just disable this // optimization. diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs index fff2268596a..f7793c58a37 100644 --- a/compiler/rustc_codegen_llvm/src/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs @@ -139,7 +139,7 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> { if self.cx().size_of(ret_ty).bytes() < 4 { // `va_arg` should not be called on an integer type // less than 4 bytes in length. If it is, promote - // the integer to a `i32` and truncate the result + // the integer to an `i32` and truncate the result // back to the smaller type. let promoted_result = emit_va_arg(self, args[0], tcx.types.i32); self.trunc(promoted_result, llret_ty) diff --git a/compiler/rustc_data_structures/src/owning_ref/mod.rs b/compiler/rustc_data_structures/src/owning_ref/mod.rs index 19b4426981c..5b27a407ad4 100644 --- a/compiler/rustc_data_structures/src/owning_ref/mod.rs +++ b/compiler/rustc_data_structures/src/owning_ref/mod.rs @@ -1148,7 +1148,7 @@ pub type StringRef = OwningRef; /// Typedef of an owning reference that uses a `Rc` as the owner. pub type RcRef = OwningRef, U>; -/// Typedef of an owning reference that uses a `Arc` as the owner. +/// Typedef of an owning reference that uses an `Arc` as the owner. pub type ArcRef = OwningRef, U>; /// Typedef of an owning reference that uses a `Ref` as the owner. diff --git a/compiler/rustc_mir/src/borrow_check/mod.rs b/compiler/rustc_mir/src/borrow_check/mod.rs index 8e6ebd124ee..fa081adfb21 100644 --- a/compiler/rustc_mir/src/borrow_check/mod.rs +++ b/compiler/rustc_mir/src/borrow_check/mod.rs @@ -1889,7 +1889,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { ProjectionElem::Downcast(_/*adt_def*/, _/*variant_idx*/) => // assigning to (P->variant) is okay if assigning to `P` is okay // - // FIXME: is this true even if P is a adt with a dtor? + // FIXME: is this true even if P is an adt with a dtor? { } // assigning to (*P) requires P to be initialized diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index a602a58e517..9d923599db7 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -1826,7 +1826,7 @@ impl<'tcx> LifetimeContext<'_, 'tcx> { err.emit(); } - // FIXME(const_generics): This patches over a ICE caused by non-'static lifetimes in const + // FIXME(const_generics): This patches over an ICE caused by non-'static lifetimes in const // generics. We are disallowing this until we can decide on how we want to handle non-'static // lifetimes in const generics. See issue #74052 for discussion. crate fn emit_non_static_lt_in_const_generic_error(&self, lifetime_ref: &hir::Lifetime) { diff --git a/compiler/rustc_serialize/src/json.rs b/compiler/rustc_serialize/src/json.rs index 4d213207fb6..e5369b4bbfd 100644 --- a/compiler/rustc_serialize/src/json.rs +++ b/compiler/rustc_serialize/src/json.rs @@ -1202,7 +1202,7 @@ impl Json { matches!(*self, Json::I64(_) | Json::U64(_) | Json::F64(_)) } - /// Returns `true` if the Json value is a `i64`. + /// Returns `true` if the Json value is an `i64`. pub fn is_i64(&self) -> bool { matches!(*self, Json::I64(_)) } @@ -1217,7 +1217,7 @@ impl Json { matches!(*self, Json::F64(_)) } - /// If the Json value is a number, returns or cast it to a `i64`; + /// If the Json value is a number, returns or cast it to an `i64`; /// returns `None` otherwise. pub fn as_i64(&self) -> Option { match *self { diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs index f6616399610..77c52e51abb 100644 --- a/library/core/src/array/iter.rs +++ b/library/core/src/array/iter.rs @@ -45,7 +45,7 @@ impl IntoIter { /// use std::array; /// /// for value in array::IntoIter::new([1, 2, 3, 4, 5]) { - /// // The type of `value` is a `i32` here, instead of `&i32` + /// // The type of `value` is an `i32` here, instead of `&i32` /// let _: i32 = value; /// } /// ``` diff --git a/library/std/src/ffi/c_str.rs b/library/std/src/ffi/c_str.rs index b9e0f0e271c..0d082648591 100644 --- a/library/std/src/ffi/c_str.rs +++ b/library/std/src/ffi/c_str.rs @@ -939,7 +939,7 @@ impl<'a> From<&'a CString> for Cow<'a, CStr> { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From for Arc { - /// Converts a [`CString`] into a [`Arc`]`` without copying or allocating. + /// Converts a [`CString`] into an [`Arc`]`` without copying or allocating. #[inline] fn from(s: CString) -> Arc { let arc: Arc<[u8]> = Arc::from(s.into_inner()); diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 397b35a84cf..f05295f89af 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -897,7 +897,7 @@ impl Clone for Box { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From for Arc { - /// Converts an [`OsString`] into a [`Arc`]`` without copying or allocating. + /// Converts an [`OsString`] into an [`Arc`]`` without copying or allocating. #[inline] fn from(s: OsString) -> Arc { let arc = s.inner.into_arc(); diff --git a/library/std/src/sys_common/remutex/tests.rs b/library/std/src/sys_common/remutex/tests.rs index 88453ded2f9..64873b850d3 100644 --- a/library/std/src/sys_common/remutex/tests.rs +++ b/library/std/src/sys_common/remutex/tests.rs @@ -30,7 +30,7 @@ fn smoke() { #[test] fn is_mutex() { let m = unsafe { - // FIXME: Simplify this if Arc gets a Arc::get_pin_mut. + // FIXME: Simplify this if Arc gets an Arc::get_pin_mut. let mut m = Arc::new(ReentrantMutex::new(RefCell::new(0))); Pin::new_unchecked(Arc::get_mut_unchecked(&mut m)).init(); Pin::new_unchecked(m) @@ -52,7 +52,7 @@ fn is_mutex() { #[test] fn trylock_works() { let m = unsafe { - // FIXME: Simplify this if Arc gets a Arc::get_pin_mut. + // FIXME: Simplify this if Arc gets an Arc::get_pin_mut. let mut m = Arc::new(ReentrantMutex::new(())); Pin::new_unchecked(Arc::get_mut_unchecked(&mut m)).init(); Pin::new_unchecked(m) diff --git a/src/librustdoc/formats/cache.rs b/src/librustdoc/formats/cache.rs index d45f277a0a8..1830909d944 100644 --- a/src/librustdoc/formats/cache.rs +++ b/src/librustdoc/formats/cache.rs @@ -22,7 +22,7 @@ use crate::html::render::IndexItem; /// /// This structure purposefully does not implement `Clone` because it's intended /// to be a fairly large and expensive structure to clone. Instead this adheres -/// to `Send` so it may be stored in a `Arc` instance and shared among the various +/// to `Send` so it may be stored in an `Arc` instance and shared among the various /// rendering threads. #[derive(Default)] crate struct Cache { diff --git a/src/test/ui/async-await/issues/issue-53249.rs b/src/test/ui/async-await/issues/issue-53249.rs index e9079bfdd85..3a33af2d2ee 100644 --- a/src/test/ui/async-await/issues/issue-53249.rs +++ b/src/test/ui/async-await/issues/issue-53249.rs @@ -8,7 +8,7 @@ use std::future::Future; use std::marker::Unpin; use std::pin::Pin; -// This is a regression test for a ICE/unbounded recursion issue relating to async-await. +// This is a regression test for an ICE/unbounded recursion issue relating to async-await. #[derive(Debug)] #[must_use = "futures do nothing unless polled"] diff --git a/src/test/ui/consts/cast-discriminant-zst-enum.rs b/src/test/ui/consts/cast-discriminant-zst-enum.rs index 66b76627c02..e59ae297da1 100644 --- a/src/test/ui/consts/cast-discriminant-zst-enum.rs +++ b/src/test/ui/consts/cast-discriminant-zst-enum.rs @@ -1,5 +1,5 @@ // run-pass -// Test a ZST enum whose dicriminant is ~0i128. This caused an ICE when casting to a i32. +// Test a ZST enum whose dicriminant is ~0i128. This caused an ICE when casting to an i32. #![feature(bench_black_box)] use std::hint::black_box; diff --git a/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs b/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs index 1983e13db0a..ebea6d3d9d1 100644 --- a/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs +++ b/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs @@ -1,4 +1,4 @@ -// This test enumerates various cases of interest where a ADT or tuple is +// This test enumerates various cases of interest where an ADT or tuple is // partially initialized and then used in some way that is wrong *even* // after rust-lang/rust#54987 is implemented. // diff --git a/src/tools/rustfmt/src/visitor.rs b/src/tools/rustfmt/src/visitor.rs index 3f251bf7c16..770693d165b 100644 --- a/src/tools/rustfmt/src/visitor.rs +++ b/src/tools/rustfmt/src/visitor.rs @@ -36,7 +36,7 @@ pub(crate) struct SnippetProvider { big_snippet: Lrc, /// A position of the start of `big_snippet`, used as an offset. start_pos: usize, - /// A end position of the file that this snippet lives. + /// An end position of the file that this snippet lives. end_pos: usize, } -- cgit 1.4.1-3-g733a5 From 2396fad0950980cd3bf53bc825cdfa79ec7fd85f Mon Sep 17 00:00:00 2001 From: Frank Steffahn Date: Sun, 22 Aug 2021 17:27:18 +0200 Subject: Fix more “a”/“an” typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compiler/rustc_infer/src/infer/nll_relate/mod.rs | 2 +- compiler/rustc_infer/src/infer/undo_log.rs | 2 +- compiler/rustc_lexer/src/lib.rs | 2 +- compiler/rustc_lint/src/nonstandard_style.rs | 2 +- compiler/rustc_middle/src/query/mod.rs | 2 +- compiler/rustc_middle/src/ty/util.rs | 2 +- compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs | 4 ++-- compiler/rustc_mir/src/borrow_check/mod.rs | 2 +- compiler/rustc_mir/src/monomorphize/partitioning/default.rs | 2 +- compiler/rustc_mir/src/transform/check_consts/ops.rs | 2 +- compiler/rustc_mir_build/src/thir/pattern/usefulness.rs | 2 +- compiler/rustc_parse/src/parser/attr_wrapper.rs | 2 +- compiler/rustc_resolve/src/lib.rs | 2 +- compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs | 2 +- library/core/src/char/methods.rs | 2 +- src/test/ui/lint/lint-nonstandard-style-unicode-1.rs | 2 +- src/tools/clippy/clippy_lints/src/formatting.rs | 2 +- src/tools/clippy/clippy_lints/src/non_copy_const.rs | 4 ++-- 18 files changed, 20 insertions(+), 20 deletions(-) (limited to 'compiler/rustc_resolve/src') diff --git a/compiler/rustc_infer/src/infer/nll_relate/mod.rs b/compiler/rustc_infer/src/infer/nll_relate/mod.rs index 0939946ae73..042e6159aff 100644 --- a/compiler/rustc_infer/src/infer/nll_relate/mod.rs +++ b/compiler/rustc_infer/src/infer/nll_relate/mod.rs @@ -307,7 +307,7 @@ where /// relations between `'0` and `'a`). /// /// The variable `pair` can be either a `(vid, ty)` or `(ty, vid)` - /// -- in other words, it is always a (unresolved) inference + /// -- in other words, it is always an (unresolved) inference /// variable `vid` and a type `ty` that are being related, but the /// vid may appear either as the "a" type or the "b" type, /// depending on where it appears in the tuple. The trait diff --git a/compiler/rustc_infer/src/infer/undo_log.rs b/compiler/rustc_infer/src/infer/undo_log.rs index 5ad2519a93c..89db8f464b4 100644 --- a/compiler/rustc_infer/src/infer/undo_log.rs +++ b/compiler/rustc_infer/src/infer/undo_log.rs @@ -96,7 +96,7 @@ impl Default for InferCtxtUndoLogs<'_> { } /// The UndoLogs trait defines how we undo a particular kind of action (of type T). We can undo any -/// action that is convertable into a UndoLog (per the From impls above). +/// action that is convertable into an UndoLog (per the From impls above). impl<'tcx, T> UndoLogs for InferCtxtUndoLogs<'tcx> where UndoLog<'tcx>: From, diff --git a/compiler/rustc_lexer/src/lib.rs b/compiler/rustc_lexer/src/lib.rs index b5e6d256a99..b64a891cb25 100644 --- a/compiler/rustc_lexer/src/lib.rs +++ b/compiler/rustc_lexer/src/lib.rs @@ -489,7 +489,7 @@ impl Cursor<'_> { // Start is already eaten, eat the rest of identifier. self.eat_while(is_id_continue); // Known prefixes must have been handled earlier. So if - // we see a prefix here, it is definitely a unknown prefix. + // we see a prefix here, it is definitely an unknown prefix. match self.first() { '#' | '"' | '\'' => UnknownPrefix, _ => Ident, diff --git a/compiler/rustc_lint/src/nonstandard_style.rs b/compiler/rustc_lint/src/nonstandard_style.rs index 7f71923c91a..03344973bb3 100644 --- a/compiler/rustc_lint/src/nonstandard_style.rs +++ b/compiler/rustc_lint/src/nonstandard_style.rs @@ -118,7 +118,7 @@ fn to_camel_case(s: &str) -> String { }) .fold((String::new(), None), |(acc, prev): (String, Option), next| { // separate two components with an underscore if their boundary cannot - // be distinguished using a uppercase/lowercase case distinction + // be distinguished using an uppercase/lowercase case distinction let join = if let Some(prev) = prev { let l = prev.chars().last().unwrap(); let f = next.chars().next().unwrap(); diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 85b1274da10..551b2914682 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -648,7 +648,7 @@ rustc_queries! { } } - /// HACK: when evaluated, this reports a "unsafe derive on repr(packed)" error. + /// HACK: when evaluated, this reports an "unsafe derive on repr(packed)" error. /// /// Unsafety checking is executed for each method separately, but we only want /// to emit this error once per derive. As there are some impls with multiple diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs index 9ba85e58018..a78206034f0 100644 --- a/compiler/rustc_middle/src/ty/util.rs +++ b/compiler/rustc_middle/src/ty/util.rs @@ -681,7 +681,7 @@ impl<'tcx> ty::TyS<'tcx> { } /// Checks whether values of this type `T` implement the `Freeze` - /// trait -- frozen types are those that do not contain a + /// trait -- frozen types are those that do not contain an /// `UnsafeCell` anywhere. This is a language concept used to /// distinguish "true immutability", which is relevant to /// optimization as well as the rules around static values. Note diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs index 76de010d139..f40a2db330a 100644 --- a/compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs +++ b/compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs @@ -606,7 +606,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { /// Checks if a borrowed value was captured by a trait object. We do this by /// looking forward in the MIR from the reserve location and checking if we see - /// a unsized cast to a trait object on our data. + /// an unsized cast to a trait object on our data. fn was_captured_by_trait_object(&self, borrow: &BorrowData<'tcx>) -> bool { // Start at the reserve location, find the place that we want to see cast to a trait object. let location = borrow.reserve_location; @@ -666,7 +666,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { } _ => {} }, - // If we see a unsized cast, then if it is our data we should check + // If we see an unsized cast, then if it is our data we should check // whether it is being cast to a trait object. Rvalue::Cast(CastKind::Pointer(PointerCast::Unsize), operand, ty) => { match operand { diff --git a/compiler/rustc_mir/src/borrow_check/mod.rs b/compiler/rustc_mir/src/borrow_check/mod.rs index fa081adfb21..1dcb0676562 100644 --- a/compiler/rustc_mir/src/borrow_check/mod.rs +++ b/compiler/rustc_mir/src/borrow_check/mod.rs @@ -2003,7 +2003,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { } if let Some((prefix, mpi)) = shortest_uninit_seen { - // Check for a reassignment into a uninitialized field of a union (for example, + // Check for a reassignment into an uninitialized field of a union (for example, // after a move out). In this case, do not report an error here. There is an // exception, if this is the first assignment into the union (that is, there is // no move out from an earlier location) then this is an attempt at initialization diff --git a/compiler/rustc_mir/src/monomorphize/partitioning/default.rs b/compiler/rustc_mir/src/monomorphize/partitioning/default.rs index 541c825416c..a559a6ce415 100644 --- a/compiler/rustc_mir/src/monomorphize/partitioning/default.rs +++ b/compiler/rustc_mir/src/monomorphize/partitioning/default.rs @@ -455,7 +455,7 @@ fn mono_item_visibility( def_id } else { return if export_generics && is_generic { - // If it is a upstream monomorphization and we export generics, we must make + // If it is an upstream monomorphization and we export generics, we must make // it available to downstream crates. *can_be_internalized = false; default_visibility(tcx, def_id, true) diff --git a/compiler/rustc_mir/src/transform/check_consts/ops.rs b/compiler/rustc_mir/src/transform/check_consts/ops.rs index ddca22aebd2..8923d989b29 100644 --- a/compiler/rustc_mir/src/transform/check_consts/ops.rs +++ b/compiler/rustc_mir/src/transform/check_consts/ops.rs @@ -86,7 +86,7 @@ impl NonConstOp for FnCallNonConst { } } -/// A call to a `#[unstable]` const fn or `#[rustc_const_unstable]` function. +/// A call to an `#[unstable]` const fn or `#[rustc_const_unstable]` function. /// /// Contains the name of the feature that would allow the use of this function. #[derive(Debug)] diff --git a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs index 5d4eb75155a..344006e9fb4 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs @@ -762,7 +762,7 @@ impl<'p, 'tcx> SubPatSet<'p, 'tcx> { for i in 0..*alt_count { let sub_set = subpats.get(&i).unwrap_or(&SubPatSet::Empty); if sub_set.is_empty() { - // Found a unreachable subpattern. + // Found an unreachable subpattern. spans.push(expanded[i].span); } else { fill_spans(sub_set, spans); diff --git a/compiler/rustc_parse/src/parser/attr_wrapper.rs b/compiler/rustc_parse/src/parser/attr_wrapper.rs index 909e1fa4ffa..9f06bdcc135 100644 --- a/compiler/rustc_parse/src/parser/attr_wrapper.rs +++ b/compiler/rustc_parse/src/parser/attr_wrapper.rs @@ -486,7 +486,7 @@ fn make_token_stream( if let AttrAnnotatedTokenTree::Token(last_token) = last_token { let unglued_first = last_token.kind.break_two_token_op().unwrap().0; - // A 'unglued' token is always two ASCII characters + // An 'unglued' token is always two ASCII characters let mut first_span = last_token.span.shrink_to_lo(); first_span = first_span.with_hi(first_span.lo() + rustc_span::BytePos(1)); diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 5df2f22b789..2e6af822043 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -3161,7 +3161,7 @@ impl<'a> Resolver<'a> { } } - /// This function adds a suggestion to remove a unnecessary binding from an import that is + /// This function adds a suggestion to remove an unnecessary binding from an import that is /// nested. In the following example, this function will be invoked to remove the `a` binding /// in the second use statement: /// diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs b/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs index bb80f0879a4..f9b7bb8ea99 100644 --- a/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs +++ b/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs @@ -743,7 +743,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // possibly be referring to the current closure, // because we haven't produced the `Closure` for // this closure yet; this is exactly why the other - // code is looking for a self type of a unresolved + // code is looking for a self type of an unresolved // inference variable. ty::PredicateKind::ClosureKind(..) => None, ty::PredicateKind::TypeWellFormedFromEnv(..) => None, diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs index e5af22c8fbb..0dadbdd1bd0 100644 --- a/library/core/src/char/methods.rs +++ b/library/core/src/char/methods.rs @@ -958,7 +958,7 @@ impl char { /// Returns an iterator that yields the uppercase mapping of this `char` as one or more /// `char`s. /// - /// If this `char` does not have a uppercase mapping, the iterator yields the same `char`. + /// If this `char` does not have an uppercase mapping, the iterator yields the same `char`. /// /// If this `char` has a one-to-one uppercase mapping given by the [Unicode Character /// Database][ucd] [`UnicodeData.txt`], the iterator yields that `char`. diff --git a/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs b/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs index 527d0ea9432..7c45c099304 100644 --- a/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs +++ b/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs @@ -30,7 +30,7 @@ struct 对__否; struct ヒ__χ; //~^ ERROR type `ヒ__χ` should have an upper camel case name -// also cannot have lowercase letter next to a underscore. +// also cannot have lowercase letter next to an underscore. // so this triggers the lint: struct Hello_你好; diff --git a/src/tools/clippy/clippy_lints/src/formatting.rs b/src/tools/clippy/clippy_lints/src/formatting.rs index b4cf1971d78..4dd0ffe77ea 100644 --- a/src/tools/clippy/clippy_lints/src/formatting.rs +++ b/src/tools/clippy/clippy_lints/src/formatting.rs @@ -164,7 +164,7 @@ fn check_unop(cx: &EarlyContext<'_>, expr: &Expr) { if !differing_macro_contexts(lhs.span, rhs.span) && !lhs.span.from_expansion(); // span between BinOp LHS and RHS let binop_span = lhs.span.between(rhs.span); - // if RHS is a UnOp + // if RHS is an UnOp if let ExprKind::Unary(op, ref un_rhs) = rhs.kind; // from UnOp operator to UnOp operand let unop_operand_span = rhs.span.until(un_rhs.span); diff --git a/src/tools/clippy/clippy_lints/src/non_copy_const.rs b/src/tools/clippy/clippy_lints/src/non_copy_const.rs index 6c2563358ca..3f9110295fc 100644 --- a/src/tools/clippy/clippy_lints/src/non_copy_const.rs +++ b/src/tools/clippy/clippy_lints/src/non_copy_const.rs @@ -122,7 +122,7 @@ fn is_unfrozen<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool { // Ignore types whose layout is unknown since `is_freeze` reports every generic types as `!Freeze`, // making it indistinguishable from `UnsafeCell`. i.e. it isn't a tool to prove a type is // 'unfrozen'. However, this code causes a false negative in which - // a type contains a layout-unknown type, but also a unsafe cell like `const CELL: Cell`. + // a type contains a layout-unknown type, but also an unsafe cell like `const CELL: Cell`. // Yet, it's better than `ty.has_type_flags(TypeFlags::HAS_TY_PARAM | TypeFlags::HAS_PROJECTION)` // since it works when a pointer indirection involves (`Cell<*const T>`). // Making up a `ParamEnv` where every generic params and assoc types are `Freeze`is another option; @@ -266,7 +266,7 @@ impl<'tcx> LateLintPass<'tcx> for NonCopyConst { // in other words, lint consts whose value *could* be unfrozen, not definitely is. // This feels inconsistent with how the lint treats generic types, // which avoids linting types which potentially become unfrozen. - // One could check whether a unfrozen type have a *frozen variant* + // One could check whether an unfrozen type have a *frozen variant* // (like `body_id_opt.map_or_else(|| !has_frozen_variant(...), ...)`), // and do the same as the case of generic types at impl items. // Note that it isn't sufficient to check if it has an enum -- cgit 1.4.1-3-g733a5