Skip to content

Commit 21d000c

Browse files
authored
Rollup merge of rust-lang#55269 - matthiaskrgr:typos_oct, r=zackmdavis
fix typos in various places
2 parents 1197831 + 4972bea commit 21d000c

Some content is hidden

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

43 files changed

+77
-77
lines changed

src/bootstrap/bootstrap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ def exe_suffix():
594594
return ''
595595

596596
def bootstrap_binary(self):
597-
"""Return the path of the boostrap binary
597+
"""Return the path of the bootstrap binary
598598
599599
>>> rb = RustBuild()
600600
>>> rb.build_dir = "build"

src/etc/lldb_rust_formatters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def print_std_string_val(val, internal_dict):
277277
#=--------------------------------------------------------------------------------------------------
278278

279279
def print_array_of_values(array_name, data_ptr_val, length, internal_dict):
280-
"""Prints a contigous memory range, interpreting it as values of the
280+
"""Prints a contiguous memory range, interpreting it as values of the
281281
pointee-type of data_ptr_val."""
282282

283283
data_ptr_type = data_ptr_val.type

src/liballoc/collections/btree/map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ use self::Entry::*;
7777
/// movie_reviews.insert("Office Space", "Deals with real issues in the workplace.");
7878
/// movie_reviews.insert("Pulp Fiction", "Masterpiece.");
7979
/// movie_reviews.insert("The Godfather", "Very enjoyable.");
80-
/// movie_reviews.insert("The Blues Brothers", "Eye lyked it alot.");
80+
/// movie_reviews.insert("The Blues Brothers", "Eye lyked it a lot.");
8181
///
8282
/// // check for a specific one.
8383
/// if !movie_reviews.contains_key("Les Misérables") {

src/libcore/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ pub unsafe trait GlobalAlloc {
518518
/// The block is described by the given `ptr` pointer and `layout`.
519519
///
520520
/// If this returns a non-null pointer, then ownership of the memory block
521-
/// referenced by `ptr` has been transferred to this alloctor.
521+
/// referenced by `ptr` has been transferred to this allocator.
522522
/// The memory may or may not have been deallocated,
523523
/// and should be considered unusable (unless of course it was
524524
/// transferred back to the caller again via the return value of

src/libcore/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ extern "rust-intrinsic" {
10251025
/// // to avoid problems in case something further down panics.
10261026
/// src.set_len(0);
10271027
///
1028-
/// // The two regions cannot overlap becuase mutable references do
1028+
/// // The two regions cannot overlap because mutable references do
10291029
/// // not alias, and two different vectors cannot own the same
10301030
/// // memory.
10311031
/// ptr::copy_nonoverlapping(src_ptr, dst_ptr, src_len);

src/libcore/pin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub use marker::Unpin;
102102
/// value in place, preventing the value referenced by that pointer from being moved
103103
/// unless it implements [`Unpin`].
104104
///
105-
/// See the [`pin` module] documentation for furthur explanation on pinning.
105+
/// See the [`pin` module] documentation for further explanation on pinning.
106106
///
107107
/// [`Unpin`]: ../../std/marker/trait.Unpin.html
108108
/// [`pin` module]: ../../std/pin/index.html

src/libcore/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
//! underlying object is live and no reference (just raw pointers) is used to
3939
//! access the same memory.
4040
//!
41-
//! These axioms, along with careful use of [`offset`] for pointer arithmentic,
41+
//! These axioms, along with careful use of [`offset`] for pointer arithmetic,
4242
//! are enough to correctly implement many useful things in unsafe code. Stronger guarantees
4343
//! will be provided eventually, as the [aliasing] rules are being determined. For more
4444
//! information, see the [book] as well as the section in the reference devoted

src/librustc/hir/def_id.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl ::std::fmt::Debug for CrateNum {
4040
match self {
4141
CrateNum::Index(id) => write!(fmt, "crate{}", id.private),
4242
CrateNum::Invalid => write!(fmt, "invalid crate"),
43-
CrateNum::BuiltinMacros => write!(fmt, "bultin macros crate"),
43+
CrateNum::BuiltinMacros => write!(fmt, "builtin macros crate"),
4444
CrateNum::ReservedForIncrCompCache => write!(fmt, "crate for decoding incr comp cache"),
4545
}
4646
}
@@ -101,7 +101,7 @@ impl fmt::Display for CrateNum {
101101
match self {
102102
CrateNum::Index(id) => fmt::Display::fmt(&id.private, f),
103103
CrateNum::Invalid => write!(f, "invalid crate"),
104-
CrateNum::BuiltinMacros => write!(f, "bultin macros crate"),
104+
CrateNum::BuiltinMacros => write!(f, "builtin macros crate"),
105105
CrateNum::ReservedForIncrCompCache => write!(f, "crate for decoding incr comp cache"),
106106
}
107107
}

src/librustc/mir/interpret/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ pub fn read_target_uint(endianness: layout::Endian, mut source: &[u8]) -> Result
632632
}
633633

634634
////////////////////////////////////////////////////////////////////////////////
635-
// Methods to faciliate working with signed integers stored in a u128
635+
// Methods to facilitate working with signed integers stored in a u128
636636
////////////////////////////////////////////////////////////////////////////////
637637

638638
pub fn sign_extend(value: u128, size: Size) -> u128 {

src/librustc/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ pub enum BorrowKind {
469469
/// }
470470
///
471471
/// This can't be a shared borrow because mutably borrowing (*x as Some).0
472-
/// should not prevent `if let None = x { ... }`, for example, becase the
472+
/// should not prevent `if let None = x { ... }`, for example, because the
473473
/// mutating `(*x as Some).0` can't affect the discriminant of `x`.
474474
/// We can also report errors with this kind of borrow differently.
475475
Shallow,

src/librustc/traits/error_reporting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
412412
flags.push(("crate_local".to_owned(), None));
413413
}
414414

415-
// Allow targetting all integers using `{integral}`, even if the exact type was resolved
415+
// Allow targeting all integers using `{integral}`, even if the exact type was resolved
416416
if self_ty.is_integral() {
417417
flags.push(("_Self".to_owned(), Some("{integral}".to_owned())));
418418
}

src/librustc_codegen_llvm/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ impl Builder<'a, 'll, 'tcx> {
761761
fty, asm, cons, volatile, alignstack, dia);
762762
Some(self.call(v, inputs, None))
763763
} else {
764-
// LLVM has detected an issue with our constaints, bail out
764+
// LLVM has detected an issue with our constraints, bail out
765765
None
766766
}
767767
}

src/librustc_metadata/cstore_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ macro_rules! provide {
6868

6969
let $cdata = $tcx.crate_data_as_rc_any($def_id.krate);
7070
let $cdata = $cdata.downcast_ref::<cstore::CrateMetadata>()
71-
.expect("CrateStore crated ata is not a CrateMetadata");
71+
.expect("CrateStore created data is not a CrateMetadata");
7272
$compute
7373
})*
7474

src/librustc_mir/const_eval.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub fn op_to_const<'tcx>(
129129
assert!(alloc.bytes.len() as u64 - ptr.offset.bytes() >= op.layout.size.bytes());
130130
let mut alloc = alloc.clone();
131131
alloc.align = align;
132-
// FIXME shouldnt it be the case that `mark_static_initialized` has already
132+
// FIXME shouldn't it be the case that `mark_static_initialized` has already
133133
// interned this? I thought that is the entire point of that `FinishStatic` stuff?
134134
let alloc = ecx.tcx.intern_const_alloc(alloc);
135135
ConstValue::ByRef(ptr.alloc_id, alloc, ptr.offset)

src/librustc_mir/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ fn demo<'a>(s: &'a mut S<'a>) -> &'a mut String { let p = &mut *(*s).data; p }
22792279
22802280
Note that this approach needs a reference to S with lifetime `'a`.
22812281
Nothing shorter than `'a` will suffice: a shorter lifetime would imply
2282-
that after `demo` finishes excuting, something else (such as the
2282+
that after `demo` finishes executing, something else (such as the
22832283
destructor!) could access `s.data` after the end of that shorter
22842284
lifetime, which would again violate the `&mut`-borrow's exclusive
22852285
access.

src/librustc_mir/interpret/eval_context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
556556
)?;
557557
}
558558
} else {
559-
// Uh, that shouln't happen... the function did not intend to return
559+
// Uh, that shouldn't happen... the function did not intend to return
560560
return err!(Unreachable);
561561
}
562562

src/librustc_mir/interpret/memory.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl<'a, 'b, 'c, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> HasDataLayout
9494
}
9595
}
9696

97-
// FIXME: Really we shouldnt clone memory, ever. Snapshot machinery should instad
97+
// FIXME: Really we shouldn't clone memory, ever. Snapshot machinery should instead
9898
// carefully copy only the reachable parts.
9999
impl<'a, 'mir, 'tcx: 'a + 'mir, M: Machine<'a, 'mir, 'tcx>>
100100
Clone for Memory<'a, 'mir, 'tcx, M>
@@ -658,7 +658,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
658658
}
659659

660660
/// It is the caller's responsibility to handle undefined and pointer bytes.
661-
/// However, this still checks that there are no relocations on the *egdes*.
661+
/// However, this still checks that there are no relocations on the *edges*.
662662
#[inline]
663663
fn get_bytes_with_undef_and_ptr(
664664
&self,
@@ -1103,7 +1103,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
11031103
Ok(())
11041104
}
11051105

1106-
/// Error if there are relocations overlapping with the egdes of the
1106+
/// Error if there are relocations overlapping with the edges of the
11071107
/// given memory range.
11081108
#[inline]
11091109
fn check_relocation_edges(&self, ptr: Pointer<M::PointerTag>, size: Size) -> EvalResult<'tcx> {

src/librustc_mir/interpret/operand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -357,14 +357,14 @@ fn from_known_layout<'tcx>(
357357
}
358358

359359
impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
360-
/// Try reading a value in memory; this is interesting particularily for ScalarPair.
360+
/// Try reading a value in memory; this is interesting particularly for ScalarPair.
361361
/// Return None if the layout does not permit loading this as a value.
362362
pub(super) fn try_read_value_from_mplace(
363363
&self,
364364
mplace: MPlaceTy<'tcx, M::PointerTag>,
365365
) -> EvalResult<'tcx, Option<Value<M::PointerTag>>> {
366366
if mplace.layout.is_unsized() {
367-
// Dont touch unsized
367+
// Don't touch unsized
368368
return Ok(None);
369369
}
370370
let (ptr, ptr_align) = mplace.to_scalar_ptr_align();

src/librustc_mir/interpret/validity.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
230230
),
231231
}
232232
}
233-
// non-ZST also have to be dereferencable
233+
// non-ZST also have to be dereferenceable
234234
if size != Size::ZERO {
235235
let ptr = try_validation!(place.ptr.to_ptr(),
236236
"integer pointer in non-ZST reference", path);
@@ -272,7 +272,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
272272
// FIXME: Check if the signature matches
273273
}
274274
// This should be all the primitive types
275-
ty::Never => bug!("Uninhabited type should have been catched earlier"),
275+
ty::Never => bug!("Uninhabited type should have been caught earlier"),
276276
_ => bug!("Unexpected primitive type {}", value.layout.ty)
277277
}
278278
Ok(())

src/librustc_passes/ast_validation.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ impl<'a> AstValidator<'a> {
166166
}
167167
}
168168

169-
/// With eRFC 2497, we need to check whether an expression is ambigious and warn or error
169+
/// With eRFC 2497, we need to check whether an expression is ambiguous and warn or error
170170
/// depending on the edition, this function handles that.
171171
fn while_if_let_ambiguity(&self, expr: &P<Expr>) {
172172
if let Some((span, op_kind)) = self.while_if_let_expr_ambiguity(&expr) {
173173
let mut err = self.err_handler().struct_span_err(
174-
span, &format!("ambigious use of `{}`", op_kind.to_string())
174+
span, &format!("ambiguous use of `{}`", op_kind.to_string())
175175
);
176176

177177
err.note(
@@ -193,22 +193,22 @@ impl<'a> AstValidator<'a> {
193193
}
194194

195195
/// With eRFC 2497 adding if-let chains, there is a requirement that the parsing of
196-
/// `&&` and `||` in a if-let statement be unambigious. This function returns a span and
197-
/// a `BinOpKind` (either `&&` or `||` depending on what was ambigious) if it is determined
198-
/// that the current expression parsed is ambigious and will break in future.
196+
/// `&&` and `||` in a if-let statement be unambiguous. This function returns a span and
197+
/// a `BinOpKind` (either `&&` or `||` depending on what was ambiguous) if it is determined
198+
/// that the current expression parsed is ambiguous and will break in future.
199199
fn while_if_let_expr_ambiguity(&self, expr: &P<Expr>) -> Option<(Span, BinOpKind)> {
200200
debug!("while_if_let_expr_ambiguity: expr.node: {:?}", expr.node);
201201
match &expr.node {
202202
ExprKind::Binary(op, _, _) if op.node == BinOpKind::And || op.node == BinOpKind::Or => {
203203
Some((expr.span, op.node))
204204
},
205205
ExprKind::Range(ref lhs, ref rhs, _) => {
206-
let lhs_ambigious = lhs.as_ref()
206+
let lhs_ambiguous = lhs.as_ref()
207207
.and_then(|lhs| self.while_if_let_expr_ambiguity(lhs));
208-
let rhs_ambigious = rhs.as_ref()
208+
let rhs_ambiguous = rhs.as_ref()
209209
.and_then(|rhs| self.while_if_let_expr_ambiguity(rhs));
210210

211-
lhs_ambigious.or(rhs_ambigious)
211+
lhs_ambiguous.or(rhs_ambiguous)
212212
}
213213
_ => None,
214214
}

src/librustc_target/abi/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ impl Align {
430430
}
431431

432432
/// Lower the alignment, if necessary, such that the given offset
433-
/// is aligned to it (the offset is a multiple of the aligment).
433+
/// is aligned to it (the offset is a multiple of the alignment).
434434
pub fn restrict_for_offset(self, offset: Size) -> Align {
435435
self.min(Align::max_for_offset(offset))
436436
}

src/librustc_typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5198,7 +5198,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
51985198
} else {
51995199
// If no type arguments were provided, we have to infer them.
52005200
// This case also occurs as a result of some malformed input, e.g.
5201-
// a lifetime argument being given instead of a type paramter.
5201+
// a lifetime argument being given instead of a type parameter.
52025202
// Using inference instead of `Error` gives better error messages.
52035203
self.var_for_def(span, param)
52045204
}

src/librustc_typeck/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ fn check_existential_types<'a, 'fcx, 'gcx, 'tcx>(
674674
} // if may_define_existential_type
675675

676676
// now register the bounds on the parameters of the existential type
677-
// so the parameters given by the function need to fulfil them
677+
// so the parameters given by the function need to fulfill them
678678
// ```rust
679679
// existential type Foo<T: Bar>: 'static;
680680
// fn foo<U>() -> Foo<U> { .. *}

src/librustc_typeck/coherence/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ pub fn coerce_unsized_info<'a, 'gcx>(gcx: TyCtxt<'a, 'gcx, 'gcx>,
269269
// exactly one (non-phantom) field has changed its
270270
// type, which we will expect to be the pointer that
271271
// is becoming fat (we could probably generalize this
272-
// to mutiple thin pointers of the same type becoming
272+
// to multiple thin pointers of the same type becoming
273273
// fat, but we don't). In this case:
274274
//
275275
// - `extra` has type `T` before and type `T` after

src/libstd/sync/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
//! - A **multiprocessor** system executing multiple hardware threads
9898
//! at the same time: In multi-threaded scenarios, you can use two
9999
//! kinds of primitives to deal with synchronization:
100-
//! - [memory fences] to ensure memory accesses are made visibile to
100+
//! - [memory fences] to ensure memory accesses are made visible to
101101
//! other CPUs in the right order.
102102
//! - [atomic operations] to ensure simultaneous access to the same
103103
//! memory location doesn't lead to undefined behavior.

src/libstd/sync/once.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ impl Once {
290290
}
291291

292292
/// Returns true if some `call_once` call has completed
293-
/// successfuly. Specifically, `is_completed` will return false in
294-
/// the following situtations:
293+
/// successfully. Specifically, `is_completed` will return false in
294+
/// the following situations:
295295
/// * `call_once` was not called at all,
296296
/// * `call_once` was called, but has not yet completed,
297297
/// * the `Once` instance is poisoned

src/libsyntax/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'a> StripUnconfigured<'a> {
9696
/// when the configuration predicate is true, or otherwise expand into an
9797
/// empty list of attributes.
9898
///
99-
/// Gives a compiler warning when the `cfg_attr` contains no attribtes and
99+
/// Gives a compiler warning when the `cfg_attr` contains no attributes and
100100
/// is in the original source file. Gives a compiler error if the syntax of
101101
/// the attribute is incorrect
102102
fn process_cfg_attr(&mut self, attr: ast::Attribute) -> Vec<ast::Attribute> {
@@ -138,7 +138,7 @@ impl<'a> StripUnconfigured<'a> {
138138
};
139139

140140
// Check feature gate and lint on zero attributes in source. Even if the feature is gated,
141-
// we still compute as if it wasn't, since the emitted error will stop compilation futher
141+
// we still compute as if it wasn't, since the emitted error will stop compilation further
142142
// along the compilation.
143143
match (expanded_attrs.len(), gate_cfg_attr_multi) {
144144
(0, false) => {

src/test/run-pass/issues/issue-18804/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// run-pass
12-
// Test for issue #18804, #[linkage] does not propagate thorugh generic
12+
// Test for issue #18804, #[linkage] does not propagate through generic
1313
// functions. Failure results in a linker error.
1414

1515
// ignore-asmjs no weak symbol support

src/test/ui/block-result/unexpected-return-on-unit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Test that we do some basic error correcton in the tokeniser (and don't spew
11+
// Test that we do some basic error correction in the tokeniser (and don't spew
1212
// too many bogus errors).
1313

1414
fn foo() -> usize {

src/test/ui/conditional-compilation/cfg-attr-multi-false.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Test that cfg_attr doesn't emit any attributes when the
2-
// configuation variable is false. This mirrors `cfg-attr-multi-true.rs`
2+
// configuration variable is false. This mirrors `cfg-attr-multi-true.rs`
33

44
// compile-pass
55

src/test/ui/nll/issue-21232-partial-init-and-use.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<F> R<F> { fn new(f: F) -> Self { R { w: 0, f } } }
6666
// It got pretty monotonous writing the same code over and over, and I
6767
// feared I would forget details. So I abstracted some desiderata into
6868
// macros. But I left the initialization code inline, because that's
69-
// where the errors for #54986 will be emited.
69+
// where the errors for #54986 will be emitted.
7070

7171
macro_rules! use_fully {
7272
(struct $s:expr) => { {

src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// rust-lang/rust#52059: Regardless of whether you are moving out of a
2-
// Drop type or just introducing an inadvertant alias via a borrow of
2+
// Drop type or just introducing an inadvertent alias via a borrow of
33
// one of its fields, it is useful to be reminded of the significance
44
// of the fact that the type implements Drop.
55

src/test/ui/resolve/token-error-correct-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Test that we do some basic error correcton in the tokeniser (and don't ICE).
11+
// Test that we do some basic error correction in the tokeniser (and don't ICE).
1212

1313
fn main() {
1414
if foo {

src/test/ui/resolve/token-error-correct-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// ignore-cloudabi no std::fs support
1212

13-
// Test that we do some basic error correcton in the tokeniser (and don't spew
13+
// Test that we do some basic error correction in the tokeniser (and don't spew
1414
// too many bogus errors).
1515

1616
pub mod raw {

0 commit comments

Comments
 (0)