Skip to content

Commit 136ad01

Browse files
committed
fix various typos
1 parent 865b44a commit 136ad01

File tree

122 files changed

+153
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+153
-153
lines changed

config.toml.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
# `0` - no debug info
316316
# `1` - line tables only
317317
# `2` - full debug info with variable and type information
318-
# Can be overriden for specific subsets of Rust code (rustc, std or tools).
318+
# Can be overridden for specific subsets of Rust code (rustc, std or tools).
319319
# Debuginfo for tests run with compiletest is not controlled by this option
320320
# and needs to be enabled separately with `debuginfo-level-tests`.
321321
#debuginfo-level = if debug { 2 } else { 0 }

src/bootstrap/compile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ fn copy_third_party_objects(
141141
copy_and_stamp(&srcdir, "crt1.o");
142142
}
143143

144-
// Copies libunwind.a compiled to be linked wit x86_64-fortanix-unknown-sgx.
144+
// Copies libunwind.a compiled to be linked with x86_64-fortanix-unknown-sgx.
145145
//
146146
// This target needs to be linked to Fortanix's port of llvm's libunwind.
147147
// libunwind requires support for rwlock and printing to stderr,

src/bootstrap/flags.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub struct Flags {
3333
pub rustc_error_format: Option<String>,
3434
pub dry_run: bool,
3535

36-
// This overrides the deny-warnings configuation option,
36+
// This overrides the deny-warnings configuration option,
3737
// which passes -Dwarnings to the compiler invocations.
3838
//
3939
// true => deny, false => warn

src/ci/azure-pipelines/try.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
# The macOS and Windows builds here are currently disabled due to them not being
2222
# overly necessary on `try` builds. We also don't actually have anything that
23-
# consumes the artifacts currently. Perhaps one day we can reenable, but for now
23+
# consumes the artifacts currently. Perhaps one day we can re-enable, but for now
2424
# it helps free up capacity on Azure.
2525
# - job: macOS
2626
# timeoutInMinutes: 600

src/doc/rustdoc/src/unstable-features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ override `ignore`.
453453

454454
### `--runtool`, `--runtool-arg`: program to run tests with; args to pass to it
455455

456-
Using thses options looks like this:
456+
Using these options looks like this:
457457

458458
```bash
459459
$ rustdoc src/lib.rs -Z unstable-options --runtool runner --runtool-arg --do-thing --runtool-arg --do-other-thing

src/doc/unstable-book/src/language-features/marker-trait-attr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ when they'd need to do the same thing for every type anyway).
2121

2222
impl<T: Copy> CheapToClone for T {}
2323

24-
// These could potentally overlap with the blanket implementation above,
24+
// These could potentially overlap with the blanket implementation above,
2525
// so are only allowed because CheapToClone is a marker trait.
2626
impl<T: CheapToClone, U: CheapToClone> CheapToClone for (T, U) {}
2727
impl<T: CheapToClone> CheapToClone for std::ops::Range<T> {}

src/liballoc/collections/btree/node.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl<K, V> Root<K, V> {
306306
/// `NodeRef` could be pointing to either type of node.
307307
/// Note that in case of a leaf node, this might still be the shared root!
308308
/// Only turn this into a `LeafNode` reference if you know it is not the shared root!
309-
/// Shared references must be dereferencable *for the entire size of their pointee*,
309+
/// Shared references must be dereferenceable *for the entire size of their pointee*,
310310
/// so '&LeafNode` or `&InternalNode` pointing to the shared root is undefined behavior.
311311
/// Turning this into a `NodeHeader` reference is always safe.
312312
pub struct NodeRef<BorrowType, K, V, Type> {

src/liballoc/collections/linked_list.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -841,10 +841,10 @@ impl<T> LinkedList<T> {
841841
/// d.push_front(2);
842842
/// d.push_front(3);
843843
///
844-
/// let mut splitted = d.split_off(2);
844+
/// let mut split = d.split_off(2);
845845
///
846-
/// assert_eq!(splitted.pop_front(), Some(1));
847-
/// assert_eq!(splitted.pop_front(), None);
846+
/// assert_eq!(split.pop_front(), Some(1));
847+
/// assert_eq!(split.pop_front(), None);
848848
/// ```
849849
#[stable(feature = "rust1", since = "1.0.0")]
850850
pub fn split_off(&mut self, at: usize) -> LinkedList<T> {

src/liballoc/collections/vec_deque.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2132,7 +2132,7 @@ impl<T> VecDeque<T> {
21322132
// Safety: the following two methods require that the rotation amount
21332133
// be less than half the length of the deque.
21342134
//
2135-
// `wrap_copy` requres that `min(x, cap() - x) + copy_len <= cap()`,
2135+
// `wrap_copy` requires that `min(x, cap() - x) + copy_len <= cap()`,
21362136
// but than `min` is never more than half the capacity, regardless of x,
21372137
// so it's sound to call here because we're calling with something
21382138
// less than half the length, which is never above half the capacity.

src/liballoc/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2894,7 +2894,7 @@ where
28942894
/// The filter test predicate.
28952895
pred: F,
28962896
/// A flag that indicates a panic has occurred in the filter test prodicate.
2897-
/// This is used as a hint in the drop implmentation to prevent consumption
2897+
/// This is used as a hint in the drop implementation to prevent consumption
28982898
/// of the remainder of the `DrainFilter`. Any unprocessed items will be
28992899
/// backshifted in the `vec`, but no further items will be dropped or
29002900
/// tested by the filter predicate.

src/libcore/fmt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ pub struct ArgumentV1<'a> {
255255
formatter: fn(&Opaque, &mut Formatter<'_>) -> Result,
256256
}
257257

258-
// This gurantees a single stable value for the function pointer associated with
258+
// This guarantees a single stable value for the function pointer associated with
259259
// indices/counts in the formatting infrastructure.
260260
//
261261
// Note that a function defined as such would not be correct as functions are

src/libcore/mem/manually_drop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl<T> ManuallyDrop<T> {
9393
/// Instead of using [`ManuallyDrop::drop`] to manually drop the value,
9494
/// you can use this method to take the value and use it however desired.
9595
///
96-
/// Whenever possible, it is preferrable to use [`into_inner`][`ManuallyDrop::into_inner`]
96+
/// Whenever possible, it is preferable to use [`into_inner`][`ManuallyDrop::into_inner`]
9797
/// instead, which prevents duplicating the content of the `ManuallyDrop<T>`.
9898
///
9999
/// # Safety

src/libcore/mem/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub use crate::intrinsics::transmute;
9191
/// Using `ManuallyDrop` here has two advantages:
9292
///
9393
/// * We do not "touch" `v` after disassembling it. For some types, operations
94-
/// such as passing ownership (to a funcion like `mem::forget`) requires them to actually
94+
/// such as passing ownership (to a function like `mem::forget`) requires them to actually
9595
/// be fully owned right now; that is a promise we do not want to make here as we are
9696
/// in the process of transferring ownership to the new `String` we are building.
9797
/// * In case of an unexpected panic, `ManuallyDrop` is not dropped, but if the panic

src/libcore/pin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
//!
313313
//! ## Examples
314314
//!
315-
//! For a type like [`Vec<T>`], both possibilites (structural pinning or not) make sense.
315+
//! For a type like [`Vec<T>`], both possibilities (structural pinning or not) make sense.
316316
//! A [`Vec<T>`] with structural pinning could have `get_pin`/`get_pin_mut` methods to get
317317
//! pinned references to elements. However, it could *not* allow calling
318318
//! [`pop`][Vec::pop] on a pinned [`Vec<T>`] because that would move the (structurally pinned)
@@ -539,7 +539,7 @@ impl<P: Deref> Pin<P> {
539539
/// ```
540540
/// A value, once pinned, must remain pinned forever (unless its type implements `Unpin`).
541541
///
542-
/// Similarily, calling `Pin::new_unchecked` on an `Rc<T>` is unsafe because there could be
542+
/// Similarly, calling `Pin::new_unchecked` on an `Rc<T>` is unsafe because there could be
543543
/// aliases to the same data that are not subject to the pinning restrictions:
544544
/// ```
545545
/// use std::rc::Rc;

src/libcore/ptr/const_ptr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl<T: ?Sized> *const T {
5353
/// all of the following is true:
5454
/// - it is properly aligned
5555
/// - it must point to an initialized instance of T; in particular, the pointer must be
56-
/// "dereferencable" in the sense defined [here].
56+
/// "dereferenceable" in the sense defined [here].
5757
///
5858
/// This applies even if the result of this method is unused!
5959
/// (The part about being initialized is not yet fully decided, but until
@@ -183,7 +183,7 @@ impl<T: ?Sized> *const T {
183183
/// within the same allocated object: [`offset`] is immediate Undefined Behavior when
184184
/// crossing object boundaries; `wrapping_offset` produces a pointer but still leads
185185
/// to Undefined Behavior if that pointer is dereferenced. [`offset`] can be optimized
186-
/// better and is thus preferrable in performance-sensitive code.
186+
/// better and is thus preferable in performance-sensitive code.
187187
///
188188
/// If you need to cross object boundaries, cast the pointer to an integer and
189189
/// do the arithmetic there.
@@ -480,7 +480,7 @@ impl<T: ?Sized> *const T {
480480
/// within the same allocated object: [`add`] is immediate Undefined Behavior when
481481
/// crossing object boundaries; `wrapping_add` produces a pointer but still leads
482482
/// to Undefined Behavior if that pointer is dereferenced. [`add`] can be optimized
483-
/// better and is thus preferrable in performance-sensitive code.
483+
/// better and is thus preferable in performance-sensitive code.
484484
///
485485
/// If you need to cross object boundaries, cast the pointer to an integer and
486486
/// do the arithmetic there.
@@ -535,7 +535,7 @@ impl<T: ?Sized> *const T {
535535
/// within the same allocated object: [`sub`] is immediate Undefined Behavior when
536536
/// crossing object boundaries; `wrapping_sub` produces a pointer but still leads
537537
/// to Undefined Behavior if that pointer is dereferenced. [`sub`] can be optimized
538-
/// better and is thus preferrable in performance-sensitive code.
538+
/// better and is thus preferable in performance-sensitive code.
539539
///
540540
/// If you need to cross object boundaries, cast the pointer to an integer and
541541
/// do the arithmetic there.

src/libcore/ptr/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! * All pointers (except for the null pointer) are valid for all operations of
2020
//! [size zero][zst].
2121
//! * For a pointer to be valid, it is necessary, but not always sufficient, that the pointer
22-
//! be *dereferencable*: the memory range of the given size starting at the pointer must all be
22+
//! be *dereferenceable*: the memory range of the given size starting at the pointer must all be
2323
//! within the bounds of a single allocated object. Note that in Rust,
2424
//! every (stack-allocated) variable is considered a separate allocated object.
2525
//! * All accesses performed by functions in this module are *non-atomic* in the sense

src/libcore/ptr/mut_ptr.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<T: ?Sized> *mut T {
4949
/// memory.
5050
///
5151
/// When calling this method, you have to ensure that if the pointer is
52-
/// non-NULL, then it is properly aligned, dereferencable (for the whole
52+
/// non-NULL, then it is properly aligned, dereferenceable (for the whole
5353
/// size of `T`) and points to an initialized instance of `T`. This applies
5454
/// even if the result of this method is unused!
5555
/// (The part about being initialized is not yet fully decided, but until
@@ -176,7 +176,7 @@ impl<T: ?Sized> *mut T {
176176
/// within the same allocated object: [`offset`] is immediate Undefined Behavior when
177177
/// crossing object boundaries; `wrapping_offset` produces a pointer but still leads
178178
/// to Undefined Behavior if that pointer is dereferenced. [`offset`] can be optimized
179-
/// better and is thus preferrable in performance-sensitive code.
179+
/// better and is thus preferable in performance-sensitive code.
180180
///
181181
/// If you need to cross object boundaries, cast the pointer to an integer and
182182
/// do the arithmetic there.
@@ -224,7 +224,7 @@ impl<T: ?Sized> *mut T {
224224
/// all of the following is true:
225225
/// - it is properly aligned
226226
/// - it must point to an initialized instance of T; in particular, the pointer must be
227-
/// "dereferencable" in the sense defined [here].
227+
/// "dereferenceable" in the sense defined [here].
228228
///
229229
/// This applies even if the result of this method is unused!
230230
/// (The part about being initialized is not yet fully decided, but until
@@ -526,7 +526,7 @@ impl<T: ?Sized> *mut T {
526526
/// within the same allocated object: [`add`] is immediate Undefined Behavior when
527527
/// crossing object boundaries; `wrapping_add` produces a pointer but still leads
528528
/// to Undefined Behavior if that pointer is dereferenced. [`add`] can be optimized
529-
/// better and is thus preferrable in performance-sensitive code.
529+
/// better and is thus preferable in performance-sensitive code.
530530
///
531531
/// If you need to cross object boundaries, cast the pointer to an integer and
532532
/// do the arithmetic there.
@@ -581,7 +581,7 @@ impl<T: ?Sized> *mut T {
581581
/// within the same allocated object: [`sub`] is immediate Undefined Behavior when
582582
/// crossing object boundaries; `wrapping_sub` produces a pointer but still leads
583583
/// to Undefined Behavior if that pointer is dereferenced. [`sub`] can be optimized
584-
/// better and is thus preferrable in performance-sensitive code.
584+
/// better and is thus preferable in performance-sensitive code.
585585
///
586586
/// If you need to cross object boundaries, cast the pointer to an integer and
587587
/// do the arithmetic there.

src/libcore/tests/num/dec2flt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn ordinary() {
4444
#[test]
4545
fn special_code_paths() {
4646
test_literal!(36893488147419103229.0); // 2^65 - 3, triggers half-to-even with even significand
47-
test_literal!(101e-33); // Triggers the tricky underflow case in AlgorithmM (for f32)
47+
test_literal!(101e-33); // Triggers the tricky underflow case in algorithm (for f32)
4848
test_literal!(1e23); // Triggers AlgorithmR
4949
test_literal!(2075e23); // Triggers another path through AlgorithmR
5050
test_literal!(8713e-23); // ... and yet another.

src/libfmt_macros/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pub struct Parser<'a> {
176176
skips: Vec<usize>,
177177
/// Span of the last opening brace seen, used for error reporting
178178
last_opening_brace: Option<InnerSpan>,
179-
/// Wether the source string is comes from `println!` as opposed to `format!` or `print!`
179+
/// Whether the source string is comes from `println!` as opposed to `format!` or `print!`
180180
append_newline: bool,
181181
}
182182

src/libproc_macro/bridge/client.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ macro_rules! define_handles {
1515
}
1616

1717
impl HandleCounters {
18-
// FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
18+
// FIXME(eddyb) use a reference to the `static COUNTERS`, instead of
1919
// a wrapper `fn` pointer, once `const fn` can reference `static`s.
2020
extern "C" fn get() -> &'static Self {
2121
static COUNTERS: HandleCounters = HandleCounters {
@@ -334,7 +334,7 @@ impl Bridge<'_> {
334334
#[repr(C)]
335335
#[derive(Copy, Clone)]
336336
pub struct Client<F> {
337-
// FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
337+
// FIXME(eddyb) use a reference to the `static COUNTERS`, instead of
338338
// a wrapper `fn` pointer, once `const fn` can reference `static`s.
339339
pub(super) get_handle_counters: extern "C" fn() -> &'static HandleCounters,
340340
pub(super) run: extern "C" fn(Bridge<'_>, F) -> Buffer<u8>,

src/librustc/hir/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ impl<'hir> Map<'hir> {
653653
}
654654
}
655655

656-
/// Wether `hir_id` corresponds to a `mod` or a crate.
656+
/// Whether `hir_id` corresponds to a `mod` or a crate.
657657
pub fn is_hir_id_module(&self, hir_id: HirId) -> bool {
658658
match self.lookup(hir_id) {
659659
Some(Entry { node: Node::Item(Item { kind: ItemKind::Mod(_), .. }), .. })

src/librustc/mir/interpret/allocation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
610610
// a naive undef mask copying algorithm would repeatedly have to read the undef mask from
611611
// the source and write it to the destination. Even if we optimized the memory accesses,
612612
// we'd be doing all of this `repeat` times.
613-
// Therefor we precompute a compressed version of the undef mask of the source value and
613+
// Therefore we precompute a compressed version of the undef mask of the source value and
614614
// then write it back `repeat` times without computing any more information from the source.
615615

616616
// A precomputed cache for ranges of defined/undefined bits

src/librustc/ty/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2579,7 +2579,7 @@ where
25792579
if let Some(kind) = pointee.safe {
25802580
attrs.pointee_align = Some(pointee.align);
25812581

2582-
// `Box` (`UniqueBorrowed`) are not necessarily dereferencable
2582+
// `Box` (`UniqueBorrowed`) are not necessarily dereferenceable
25832583
// for the entire duration of the function as they can be deallocated
25842584
// any time. Set their valid size to 0.
25852585
attrs.pointee_size = match kind {

src/librustc/ty/print/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub trait Printer<'tcx>: Sized {
9797
args: &[GenericArg<'tcx>],
9898
) -> Result<Self::Path, Self::Error>;
9999

100-
// Defaults (should not be overriden):
100+
// Defaults (should not be overridden):
101101

102102
fn default_print_def_path(
103103
self,

src/librustc/ty/print/pretty.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ pub trait PrettyPrinter<'tcx>:
221221
/// This is typically the case for all non-`'_` regions.
222222
fn region_should_not_be_omitted(&self, region: ty::Region<'_>) -> bool;
223223

224-
// Defaults (should not be overriden):
224+
// Defaults (should not be overridden):
225225

226226
/// If possible, this returns a global path resolving to `def_id` that is visible
227227
/// from at least one local module, and returns `true`. If the crate defining `def_id` is
@@ -236,7 +236,7 @@ pub trait PrettyPrinter<'tcx>:
236236
/// post-process it into the valid and visible version that
237237
/// accounts for re-exports.
238238
///
239-
/// This method should only be callled by itself or
239+
/// This method should only be called by itself or
240240
/// `try_print_visible_def_path`.
241241
///
242242
/// `callers` is a chain of visible_parent's leading to `def_id`,
@@ -685,7 +685,7 @@ pub trait PrettyPrinter<'tcx>:
685685
if self.tcx().sess.verbose() {
686686
p!(write("{:?}", sz));
687687
} else if let ty::ConstKind::Unevaluated(..) = sz.val {
688-
// do not try to evalute unevaluated constants. If we are const evaluating an
688+
// do not try to evaluate unevaluated constants. If we are const evaluating an
689689
// array length anon const, rustc will (with debug assertions) print the
690690
// constant's path. Which will end up here again.
691691
p!(write("_"));

src/librustc/ty/query/on_disk_cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ impl<'sess> OnDiskCache<'sess> {
425425

426426
//- DECODING -------------------------------------------------------------------
427427

428-
/// A decoder that can read fro the incr. comp. cache. It is similar to the one
428+
/// A decoder that can read from the incr. comp. cache. It is similar to the one
429429
/// we use for crate metadata decoding in that it can rebase spans and eventually
430430
/// will also handle things that contain `Ty` instances.
431431
struct CacheDecoder<'a, 'tcx> {

src/librustc/ty/query/plumbing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ macro_rules! define_queries_inner {
10531053

10541054
impl TyCtxt<$tcx> {
10551055
/// Returns a transparent wrapper for `TyCtxt`, which ensures queries
1056-
/// are executed instead of just returing their results.
1056+
/// are executed instead of just returning their results.
10571057
#[inline(always)]
10581058
pub fn ensure(self) -> TyCtxtEnsure<$tcx> {
10591059
TyCtxtEnsure {

src/librustc/ty/relate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub trait TypeRelation<'tcx>: Sized {
7272
b: &T,
7373
) -> RelateResult<'tcx, T>;
7474

75-
// Overrideable relations. You shouldn't typically call these
75+
// Overridable relations. You shouldn't typically call these
7676
// directly, instead call `relate()`, which in turn calls
7777
// these. This is both more uniform but also allows us to add
7878
// additional hooks for other types in the future if needed

src/librustc_ast/ast.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ impl Expr {
10781078

10791079
// If binary operator is `Add` and both `lhs` and `rhs` are trait bounds,
10801080
// then type of result is trait object.
1081-
// Othewise we don't assume the result type.
1081+
// Otherwise we don't assume the result type.
10821082
ExprKind::Binary(binop, lhs, rhs) if binop.node == BinOpKind::Add => {
10831083
if let (Some(lhs), Some(rhs)) = (lhs.to_bound(), rhs.to_bound()) {
10841084
TyKind::TraitObject(vec![lhs, rhs], TraitObjectSyntax::None)
@@ -2089,7 +2089,7 @@ impl Async {
20892089
if let Async::Yes { .. } = self { true } else { false }
20902090
}
20912091

2092-
/// In ths case this is an `async` return, the `NodeId` for the generated `impl Trait` item.
2092+
/// In this case this is an `async` return, the `NodeId` for the generated `impl Trait` item.
20932093
pub fn opt_return_id(self) -> Option<NodeId> {
20942094
match self {
20952095
Async::Yes { return_impl_trait_id, .. } => Some(return_impl_trait_id),

0 commit comments

Comments
 (0)