Skip to content

Commit 67ee831

Browse files
committed
fix few comment typos in compiler
1 parent f37c190 commit 67ee831

File tree

23 files changed

+27
-27
lines changed

23 files changed

+27
-27
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ impl Expr {
11961196
}
11971197
}
11981198

1199-
/// Returns an expression with (when possible) *one* outter brace removed
1199+
/// Returns an expression with (when possible) *one* outer brace removed
12001200
pub fn maybe_unwrap_block(&self) -> &Expr {
12011201
if let ExprKind::Block(block, None) = &self.kind
12021202
&& let [stmt] = block.stmts.as_slice()

compiler/rustc_codegen_llvm/src/va_arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ fn emit_xtensa_va_arg<'ll, 'tcx>(
365365

366366
// On big-endian, for values smaller than the slot size we'd have to align the read to the end
367367
// of the slot rather than the start. While the ISA and GCC support big-endian, all the Xtensa
368-
// targets supported by rustc are litte-endian so don't worry about it.
368+
// targets supported by rustc are little-endian so don't worry about it.
369369

370370
// if from_regsave {
371371
// unsafe { *regsave_value_ptr }

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3060,7 +3060,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
30603060
// Supported architecture names can be found in the source:
30613061
// https://github.com/apple-oss-distributions/ld64/blob/ld64-951.9/src/abstraction/MachOFileAbstraction.hpp#L578-L648
30623062
//
3063-
// Intentially verbose to ensure that the list always matches correctly
3063+
// Intentionally verbose to ensure that the list always matches correctly
30643064
// with the list in the source above.
30653065
let ld64_arch = match llvm_arch {
30663066
"armv7k" => "armv7k",
@@ -3128,7 +3128,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
31283128
// We do not currently know the actual SDK version though, so we have a few options:
31293129
// 1. Use the minimum version supported by rustc.
31303130
// 2. Use the same as the deployment target.
3131-
// 3. Use an arbitary recent version.
3131+
// 3. Use an arbitrary recent version.
31323132
// 4. Omit the version.
31333133
//
31343134
// The first option is too low / too conservative, and means that users will not get the

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
408408
/// Mach-O files contain information about:
409409
/// - The platform/OS they were built for (macOS/watchOS/Mac Catalyst/iOS simulator etc).
410410
/// - The minimum OS version / deployment target.
411-
/// - The version of the SDK they were targetting.
411+
/// - The version of the SDK they were targeting.
412412
///
413413
/// In the past, this was accomplished using the LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_IPHONEOS,
414414
/// LC_VERSION_MIN_TVOS or LC_VERSION_MIN_WATCHOS load commands, which each contain information

compiler/rustc_codegen_ssa/src/traits/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub trait BuilderMethods<'a, 'tcx>:
8989
//
9090
// This function is opt-in for back ends.
9191
//
92-
// The default implementation calls `self.expect()` before emiting the branch
92+
// The default implementation calls `self.expect()` before emitting the branch
9393
// by calling `self.cond_br()`
9494
fn cond_br_with_expect(
9595
&mut self,

compiler/rustc_const_eval/src/util/check_validity_requirement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn check_validity_requirement_strict<'tcx>(
6969
// require dereferenceability also require non-null, we don't actually get any false negatives
7070
// due to this.
7171
// The value we are validating is temporary and discarded at the end of this function, so
72-
// there is no point in reseting provenance and padding.
72+
// there is no point in resetting provenance and padding.
7373
cx.validate_operand(
7474
&allocated.into(),
7575
/*recursive*/ false,

compiler/rustc_data_structures/src/vec_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ unsafe impl<K: Idx, #[may_dangle] V, I> Drop for VecCache<K, V, I> {
257257
// we are also guaranteed to just need to deallocate any large arrays (not iterate over
258258
// contents).
259259
//
260-
// Confirm no need to deallocate invidual entries. Note that `V: Copy` is asserted on
260+
// Confirm no need to deallocate individual entries. Note that `V: Copy` is asserted on
261261
// insert/lookup but not necessarily construction, primarily to avoid annoyingly propagating
262262
// the bounds into struct definitions everywhere.
263263
assert!(!std::mem::needs_drop::<K>());

compiler/rustc_errors/src/markdown/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ fn normalize<'a>(MdStream(stream): MdStream<'a>, linkdefs: &mut Vec<MdTree<'a>>)
358358
let new_defs = stream.iter().filter(|tt| matches!(tt, MdTree::LinkDef { .. }));
359359
linkdefs.extend(new_defs.cloned());
360360

361-
// Run plaintest expansions on types that need it, call this function on nested types
361+
// Run plaintext expansions on types that need it, call this function on nested types
362362
for item in stream {
363363
match item {
364364
MdTree::PlainText(txt) => expand_plaintext(txt, &mut new_stream, MdTree::PlainText),

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2642,7 +2642,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
26422642

26432643
/// Returns the parameters of a function, with their generic parameters if those are the full
26442644
/// type of that parameter. Returns `None` if the function has no generics or the body is
2645-
/// unavailable (eg is an instrinsic).
2645+
/// unavailable (eg is an intrinsic).
26462646
fn get_hir_param_info(
26472647
&self,
26482648
def_id: DefId,

compiler/rustc_lint/src/if_let_rescope.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl IfLetRescope {
211211
}
212212
}
213213
}
214-
// At this point, any `if let` fragment in the cascade is definitely preceeded by `else`,
214+
// At this point, any `if let` fragment in the cascade is definitely preceded by `else`,
215215
// so a opening bracket is mandatory before each `match`.
216216
add_bracket_to_match_head = true;
217217
if let Some(alt) = alt {

0 commit comments

Comments
 (0)