Fix some typos in comments

Signed-off-by: TechVest <techdashen@qq.com>
This commit is contained in:
TechVest 2024-04-17 15:05:56 +08:00
parent b7581490aa
commit 45df09b7de
7 changed files with 8 additions and 8 deletions

View File

@ -992,7 +992,7 @@ fn lower_variant(
.inspect(|f| {
has_unnamed_fields |= f.ident.name == kw::Underscore;
// We only check named ADT here because anonymous ADTs are checked inside
// the nammed ADT in which they are defined.
// the named ADT in which they are defined.
if !is_anonymous {
field_uniqueness_check_ctx.check_field(f);
}

View File

@ -43,7 +43,7 @@ pub struct Std {
/// This shouldn't be used from other steps; see the comment on [`Rustc`].
crates: Vec<String>,
/// When using download-rustc, we need to use a new build of `std` for running unit tests of Std itself,
/// but we need to use the downloaded copy of std for linking to rustdoc. Allow this to be overriden by `builder.ensure` from other steps.
/// but we need to use the downloaded copy of std for linking to rustdoc. Allow this to be overridden by `builder.ensure` from other steps.
force_recompile: bool,
extra_rust_args: &'static [&'static str],
is_for_mir_opt_tests: bool,

View File

@ -417,7 +417,7 @@ warning: 1 warning emitted
This lint is **warn-by-default**. It detects explicit links that are the same
as computed automatic links.
This usually means the explicit links are removeable. For example:
This usually means the explicit links are removable. For example:
```rust
#![warn(rustdoc::redundant_explicit_links)] // note: unnecessary - warns by default.

View File

@ -187,7 +187,7 @@ declare_rustdoc_lint! {
declare_rustdoc_lint! {
/// This lint is **warn-by-default**. It detects explicit links that are the same
/// as computed automatic links. This usually means the explicit links are removeable.
/// as computed automatic links. This usually means the explicit links are removable.
/// This is a `rustdoc` only lint, see the documentation in the [rustdoc book].
///
/// [rustdoc book]: ../../../rustdoc/lints.html#redundant_explicit_links

View File

@ -1420,7 +1420,7 @@ impl LinkCollector<'_, '_> {
//
// Otherwise, check if 2 links are same, if so, skip the resolve process.
//
// Notice that this algorithm is passive, might possibly miss actual redudant cases.
// Notice that this algorithm is passive, might possibly miss actual redundant cases.
let explicit_link = explicit_link.to_string();
let display_text = ori_link.display_text.as_ref().unwrap();

View File

@ -314,7 +314,7 @@ pub enum StructKind {
/// All [`Id`]'s will point to [`ItemEnum::StructField`]. Private and
/// `#[doc(hidden)]` fields will be given as `None`
Tuple(Vec<Option<Id>>),
/// A struct with nammed fields.
/// A struct with named fields.
///
/// ```rust
/// pub struct PlainStruct { x: i32 }

View File

@ -3,8 +3,8 @@
//
// That manifested as both `rustc_driver` and rustc's "main" (`compiler/rustc`) having their own
// `std::panicking::HOOK` static, and the hook in rustc's main (the default stdlib's) being executed
// when rustc ICEs, instead of the overriden hook from `rustc_driver` (which also displays the query
// stack and information on how to open a GH issue for the encountered ICE).
// when rustc ICEs, instead of the overridden hook from `rustc_driver` (which also displays the
// query stack and information on how to open a GH issue for the encountered ICE).
//
// In this test, we reproduce this setup by installing a panic hook in both the main and an LTOed
// dylib: the last hook set should be the one being executed, the dylib's.