Skip to content

Commit 8109c3b

Browse files
committed
fix few comment typos in compiler
1 parent cdb89d6 commit 8109c3b

File tree

30 files changed

+36
-36
lines changed

30 files changed

+36
-36
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ impl Expr {
12011201
}
12021202
}
12031203

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

compiler/rustc_borrowck/src/diagnostics/opaque_suggestions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
3131
diag: &mut Diag<'_>,
3232
) {
3333
// We look at all the locals. Why locals? Because it's the best thing
34-
// I could think of that's correlated with the *instantiated* higer-ranked
34+
// I could think of that's correlated with the *instantiated* higher-ranked
3535
// binder for calls, since we don't really store those anywhere else.
3636
for ty in self.body.local_decls.iter().map(|local| local.ty) {
3737
if !ty.has_opaque_types() {

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
@@ -3030,7 +3030,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
30303030
// Supported architecture names can be found in the source:
30313031
// https://github.com/apple-oss-distributions/ld64/blob/ld64-951.9/src/abstraction/MachOFileAbstraction.hpp#L578-L648
30323032
//
3033-
// Intentially verbose to ensure that the list always matches correctly
3033+
// Intentionally verbose to ensure that the list always matches correctly
30343034
// with the list in the source above.
30353035
let ld64_arch = match llvm_arch {
30363036
"armv7k" => "armv7k",
@@ -3098,7 +3098,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
30983098
// We do not currently know the actual SDK version though, so we have a few options:
30993099
// 1. Use the minimum version supported by rustc.
31003100
// 2. Use the same as the deployment target.
3101-
// 3. Use an arbitary recent version.
3101+
// 3. Use an arbitrary recent version.
31023102
// 4. Omit the version.
31033103
//
31043104
// 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
@@ -68,7 +68,7 @@ fn check_validity_requirement_strict<'tcx>(
6868
// require dereferenceability also require non-null, we don't actually get any false negatives
6969
// due to this.
7070
// The value we are validating is temporary and discarded at the end of this function, so
71-
// there is no point in reseting provenance and padding.
71+
// there is no point in resetting provenance and padding.
7272
Ok(cx
7373
.validate_operand(
7474
&allocated.into(),

compiler/rustc_data_structures/src/vec_cache.rs

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

compiler/rustc_errors/src/emitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,7 @@ impl HumanEmitter {
25222522
buffer.puts(*row_num, max_line_num_len + 1, "+ ", Style::Addition);
25232523
}
25242524
[] => {
2525-
// FIXME: needed? Doesn't get excercised in any test.
2525+
// FIXME: needed? Doesn't get exercised in any test.
25262526
self.draw_col_separator_no_space(buffer, *row_num, max_line_num_len + 1);
25272527
}
25282528
_ => {

compiler/rustc_errors/src/markdown/parse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ fn parse_with_end_pat<'a>(
346346
None
347347
}
348348

349-
/// Resturn `(match, residual)` to end of line. The EOL is returned with the
349+
/// Return `(match, residual)` to end of line. The EOL is returned with the
350350
/// residual.
351351
fn parse_to_newline(buf: &[u8]) -> (&[u8], &[u8]) {
352352
buf.iter().position(|ch| *ch == b'\n').map_or((buf, &[]), |pos| buf.split_at(pos))
@@ -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),

0 commit comments

Comments
 (0)