Skip to content

Commit 3b4151c

Browse files
author
liuzhenyu
committed
fix typos
1 parent 8141873 commit 3b4151c

File tree

22 files changed

+25
-25
lines changed

22 files changed

+25
-25
lines changed

library/alloc/src/rc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,7 @@ impl<T: ?Sized> Unpin for Rc<T> {}
21012101
///
21022102
/// - This function is safe for any argument if `T` is sized, and
21032103
/// - if `T` is unsized, the pointer must have appropriate pointer metadata
2104-
/// aquired from the real instance that you are getting this offset for.
2104+
/// acquired from the real instance that you are getting this offset for.
21052105
unsafe fn data_offset<T: ?Sized>(ptr: *const T) -> isize {
21062106
// Align the unsized value to the end of the `RcBox`.
21072107
// Because it is ?Sized, it will always be the last field in memory.

library/alloc/src/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2255,7 +2255,7 @@ impl<T: ?Sized> Unpin for Arc<T> {}
22552255
///
22562256
/// - This function is safe for any argument if `T` is sized, and
22572257
/// - if `T` is unsized, the pointer must have appropriate pointer metadata
2258-
/// aquired from the real instance that you are getting this offset for.
2258+
/// acquired from the real instance that you are getting this offset for.
22592259
unsafe fn data_offset<T: ?Sized>(ptr: *const T) -> isize {
22602260
// Align the unsized value to the end of the `ArcInner`.
22612261
// Because it is `?Sized`, it will always be the last field in memory.

library/alloc/tests/boxed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn box_clone_and_clone_from_equivalence() {
3737
/// This test might give a false positive in case the box realocates, but the alocator keeps the
3838
/// original pointer.
3939
///
40-
/// On the other hand it won't give a false negative, if it fails than the memory was definitly not
40+
/// On the other hand it won't give a false negative, if it fails than the memory was definitely not
4141
/// reused
4242
#[test]
4343
fn box_clone_from_ptr_stability() {

library/std/src/alloc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ unsafe impl AllocRef for System {
189189
ReallocPlacement::MayMove if layout.size() == 0 => {
190190
let new_layout =
191191
// SAFETY: The new size and layout alignement guarantees
192-
// are transfered to the caller (they come from parameters).
192+
// are transferred to the caller (they come from parameters).
193193
//
194194
// See the preconditions for `Layout::from_size_align` to
195195
// see what must be checked.
@@ -254,7 +254,7 @@ unsafe impl AllocRef for System {
254254
//
255255
// See `GlobalAlloc::realloc` for more informations about the
256256
// guarantees expected by this method. `ptr`, `layout` and
257-
// `new_size` are parameters and the responsability for their
257+
// `new_size` are parameters and the responsibility for their
258258
// correctness is left to the caller.
259259
//
260260
// `realloc` probably checks for `new_size < size` or something

library/std/src/keyword_docs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ mod self_upper_keyword {}
13631363
///
13641364
/// let r1 = &FOO as *const _;
13651365
/// let r2 = &FOO as *const _;
1366-
/// // With a strictly read-only static, references will have the same adress
1366+
/// // With a strictly read-only static, references will have the same address
13671367
/// assert_eq!(r1, r2);
13681368
/// // A static item can be used just like a variable in many cases
13691369
/// println!("{:?}", FOO);

library/std/src/sync/once.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
// see the changes to drop the `Waiter` struct correctly.
8282
// * There is one place where the two atomics `Once.state_and_queue` and
8383
// `Waiter.signaled` come together, and might be reordered by the compiler or
84-
// processor. Because both use Aquire ordering such a reordering is not
84+
// processor. Because both use Acquire ordering such a reordering is not
8585
// allowed, so no need for SeqCst.
8686

8787
use crate::cell::Cell;

src/librustc_infer/infer/combine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,15 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> {
166166
return self.unify_const_variable(!a_is_expected, vid, a);
167167
}
168168
(ty::ConstKind::Unevaluated(..), _) if self.tcx.lazy_normalization() => {
169-
// FIXME(#59490): Need to remove the leak check to accomodate
169+
// FIXME(#59490): Need to remove the leak check to accommodate
170170
// escaping bound variables here.
171171
if !a.has_escaping_bound_vars() && !b.has_escaping_bound_vars() {
172172
relation.const_equate_obligation(a, b);
173173
}
174174
return Ok(b);
175175
}
176176
(_, ty::ConstKind::Unevaluated(..)) if self.tcx.lazy_normalization() => {
177-
// FIXME(#59490): Need to remove the leak check to accomodate
177+
// FIXME(#59490): Need to remove the leak check to accommodate
178178
// escaping bound variables here.
179179
if !a.has_escaping_bound_vars() && !b.has_escaping_bound_vars() {
180180
relation.const_equate_obligation(a, b);

src/librustc_infer/infer/error_reporting/nice_region_error/static_impl_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
195195
}
196196
}
197197
if let (Some(ident), true) = (override_error_code, fn_returns.is_empty()) {
198-
// Provide a more targetted error code and description.
198+
// Provide a more targeted error code and description.
199199
err.code(rustc_errors::error_code!(E0772));
200200
err.set_primary_message(&format!(
201201
"{} has {} but calling `{}` introduces an implicit `'static` lifetime \

src/librustc_metadata/rmeta/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ impl<'a, 'tcx> SpecializedEncoder<Span> for EncodeContext<'a, 'tcx> {
267267
// real code should never need to care about this.
268268
//
269269
// 2. Using `Span::def_site` or `Span::mixed_site` will not
270-
// include any hygiene information associated with the defintion
270+
// include any hygiene information associated with the definition
271271
// site. This means that a proc-macro cannot emit a `$crate`
272272
// identifier which resolves to one of its dependencies,
273273
// which also should never come up in practice.

src/librustc_middle/ty/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ struct OpaqueTypeExpander<'tcx> {
585585
found_recursion: bool,
586586
/// Whether or not to check for recursive opaque types.
587587
/// This is `true` when we're explicitly checking for opaque type
588-
/// recursion, and 'false' otherwise to avoid unecessary work.
588+
/// recursion, and 'false' otherwise to avoid unnecessary work.
589589
check_recursion: bool,
590590
tcx: TyCtxt<'tcx>,
591591
}

src/librustc_mir/transform/promote_consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ impl<'tcx> Validator<'_, 'tcx> {
524524
// The `is_empty` predicate is introduced to exclude the case
525525
// where the projection operations are [ .field, * ].
526526
// The reason is because promotion will be illegal if field
527-
// accesses preceed the dereferencing.
527+
// accesses precede the dereferencing.
528528
// Discussion can be found at
529529
// https://github.com/rust-lang/rust/pull/74945#discussion_r463063247
530530
// There may be opportunity for generalization, but this needs to be

src/librustc_mir_build/thir/pattern/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ crate enum PatKind<'tcx> {
133133
var: hir::HirId,
134134
ty: Ty<'tcx>,
135135
subpattern: Option<Pat<'tcx>>,
136-
/// Is this the leftmost occurance of the binding, i.e., is `var` the
136+
/// Is this the leftmost occurrence of the binding, i.e., is `var` the
137137
/// `HirId` of this pattern?
138138
is_primary: bool,
139139
},

src/librustc_session/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
17171717
}
17181718

17191719
// `-Z instrument-coverage` implies:
1720-
// * `-Z symbol-mangling-version=v0` - to ensure consistent and reversable name mangling.
1720+
// * `-Z symbol-mangling-version=v0` - to ensure consistent and reversible name mangling.
17211721
// Note, LLVM coverage tools can analyze coverage over multiple runs, including some
17221722
// changes to source code; so mangled names must be consistent across compilations.
17231723
// * `-C link-dead-code` - so unexecuted code is still counted as zero, rather than be

src/librustc_session/parse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl GatedSpans {
6363

6464
#[derive(Default)]
6565
pub struct SymbolGallery {
66-
/// All symbols occurred and their first occurrance span.
66+
/// All symbols occurred and their first occurrence span.
6767
pub symbols: Lock<BTreeMap<Symbol, Span>>,
6868
}
6969

src/librustc_span/hygiene.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ impl UseSpecializedDecodable for ExpnId {}
891891

892892
#[derive(Default)]
893893
pub struct HygieneEncodeContext {
894-
/// All `SyntaxContexts` for which we have writen `SyntaxContextData` into crate metadata.
894+
/// All `SyntaxContexts` for which we have written `SyntaxContextData` into crate metadata.
895895
/// This is `None` after we finish encoding `SyntaxContexts`, to ensure
896896
/// that we don't accidentally try to encode any more `SyntaxContexts`
897897
serialized_ctxts: Lock<FxHashSet<SyntaxContext>>,
@@ -961,7 +961,7 @@ pub struct HygieneDecodeContext {
961961
// Maps serialized `SyntaxContext` ids to a `SyntaxContext` in the current
962962
// global `HygieneData`. When we deserialize a `SyntaxContext`, we need to create
963963
// a new id in the global `HygieneData`. This map tracks the ID we end up picking,
964-
// so that multiple occurences of the same serialized id are decoded to the same
964+
// so that multiple occurrences of the same serialized id are decoded to the same
965965
// `SyntaxContext`
966966
remapped_ctxts: Lock<Vec<Option<SyntaxContext>>>,
967967
// The same as `remapepd_ctxts`, but for `ExpnId`s

src/librustc_typeck/check/coercion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
456456
//
457457
// Both of these trigger a special `CoerceUnsized`-related error (E0376)
458458
//
459-
// We can take advantage of this fact to avoid performing unecessary work.
459+
// We can take advantage of this fact to avoid performing unnecessary work.
460460
// If either `source` or `target` is a type variable, then any applicable impl
461461
// would need to be generic over the self-type (`impl<T> CoerceUnsized<SomeType> for T`)
462462
// or generic over the `CoerceUnsized` type parameter (`impl<T> CoerceUnsized<T> for

src/test/ui/consts/const_in_pattern/warn_corner_cases.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// const-evaluator computes a value that *does* meet the conditions for
1111
// structural-match, but the const expression itself has abstractions (like
1212
// calls to const functions) that may fit better with a type-based analysis
13-
// rather than a committment to a specific value.
13+
// rather than a commitment to a specific value.
1414

1515
#![warn(indirect_structural_match)]
1616

src/test/ui/consts/issue-73976-polymorphic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This test is from #73976. We previously did not check if a type is monomorphized
2-
// before calculating its type id, which leads to the bizzare behaviour below that
2+
// before calculating its type id, which leads to the bizarre behaviour below that
33
// TypeId of a generic type does not match itself.
44
//
55
// This test case should either run-pass or be rejected at compile time.

src/test/ui/lint/lint-nonstandard-style-unicode-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct _ヒb;
2323
struct __χa;
2424
//~^ ERROR type `__χa` should have an upper camel case name
2525

26-
// Besides this, we cannot have two continous underscores in the middle.
26+
// Besides this, we cannot have two continuous underscores in the middle.
2727

2828
struct 对__否;
2929
//~^ ERROR type `对__否` should have an upper camel case name

src/test/ui/lint/lint-nonstandard-style-unicode-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn 编程() {}
1818
fn Ц() {}
1919
//~^ ERROR function `Ц` should have a snake case name
2020

21-
// besides this, you cannot use continous underscores in the middle
21+
// besides this, you cannot use continuous underscores in the middle
2222

2323
fn 分__隔() {}
2424
//~^ ERROR function `分__隔` should have a snake case name

src/test/ui/proc-macro/crt-static.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Test proc-macro crate can be built without addtional RUSTFLAGS
1+
// Test proc-macro crate can be built without additional RUSTFLAGS
22
// on musl target
33
// override -Ctarget-feature=-crt-static from compiletest
44
// compile-flags: -Ctarget-feature=

src/tools/clippy/tests/ui/formatting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn main() {
149149
1 + 2, 3
150150
- 4, 5
151151
];
152-
// lint if it doesnt
152+
// lint if it doesn't
153153
let _ = &[
154154
-1
155155
-4,

0 commit comments

Comments
 (0)