Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in compiler #110153

Merged
merged 3 commits into from
Apr 12, 2023
Merged

Fix typos in compiler #110153

merged 3 commits into from
Apr 12, 2023

Conversation

DaniPopes
Copy link
Contributor

I ran typos -w compiler to fix typos in the compiler directory.

Refs #110150

@rustbot
Copy link
Collaborator

rustbot commented Apr 10, 2023

r? @TaKO8Ki

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Apr 10, 2023
@rustbot
Copy link
Collaborator

rustbot commented Apr 10, 2023

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

These commits modify compiler targets.
(See the Target Tier Policy.)

Some changes occurred in need_type_info.rs

cc @lcnr

@Noratrieb
Copy link
Member

r? Nilstrieb

@rustbot rustbot assigned Noratrieb and unassigned TaKO8Ki Apr 10, 2023
Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is good except for one small change.

Out of curiousity: How much manual work did you have to do here? We've received typo fixing PRs of much lower quality (the quality here was great), so I'm curious to see what you've done differently. I told you to remove some bad cases on the first PR, how many did you have to remove roughly?

compiler/rustc_mir_dataflow/src/framework/graphviz.rs Outdated Show resolved Hide resolved
compiler/rustc_ty_utils/messages.ftl Outdated Show resolved Hide resolved
@Noratrieb
Copy link
Member

And you have to run ./x.py test tests/ui --bless to bless the tests whose error message you changed.

@DaniPopes
Copy link
Contributor Author

How much manual work did you have to do here

Just a matter of excluding false positives; the config ended up like this:

typos.toml

[files]
extend-exclude = [
    "*.json",
    "*.sh",
    "**/benches/**",
    "**/*test*/**",
    "**/*test*.rs",
    "RELEASES.md",
    "**/patches/**",
    "**/archs.rs",
    "compiler/rustc_codegen_cranelift/example/**",
    "library/core/src/unicode/unicode_data.rs",
    "src/ci/docker/**",

    ### manually vetted files
    "src/doc/unstable-book/src/compiler-flags/sanitizer.md",
    "src/doc/rustdoc/src/what-is-rustdoc.md",
    "src/tools/lint-docs/src/lib.rs",
    "library/test/src/term/terminfo/parser/compiled.rs",
    # typos already present in the `winerror.h` header file
    "library/std/src/sys/windows/c/errors.rs",
    # intentional `widnows` typo
    "compiler/rustc_lint_defs/src/builtin.rs",
    # git commit sha
    "compiler/rustc_interface/src/util.rs",

    ### [rustfmt.toml].exclude
    "/build/",
    "/*-build/",
    "/build-*/",
    "/vendor/",

    # tests for now are not formatted, as they are sometimes pretty-printing constrained
    # (and generally rustfmt can move around comments in UI-testing incompatible ways)
    "tests",

    # do not format submodules
    "library/backtrace",
    "library/portable-simd",
    "library/stdarch",
    "compiler/rustc_codegen_gcc",
    "src/doc/book",
    "src/doc/edition-guide",
    "src/doc/embedded-book",
    "src/doc/nomicon",
    "src/doc/reference",
    "src/doc/rust-by-example",
    "src/doc/rustc-dev-guide",
    "src/llvm-project",
    "src/tools/cargo",
    "src/tools/clippy",
    "src/tools/miri",
    "src/tools/rls",
    "src/tools/rust-analyzer",
    "src/tools/rustfmt",
    "src/tools/rust-installer",

    # these are ignored by a standard cargo fmt run
    "compiler/rustc_codegen_cranelift/y.rs", # running rustfmt breaks this file
    "compiler/rustc_codegen_cranelift/example",
    "compiler/rustc_codegen_cranelift/scripts",
]
ignore-parent = true

[default]
binary = false
locale = "en"
extend-ignore-identifiers-re = [
    # workaround for no way to specify regex flags
    "[nN][tT][oO]",
    "[nN][uU][mM][eE][rR]",
    "[bB][aA][rR][eE]",
    "[pP][rR][eE][vV]",
    "[rR][eE][tT]",
    "[gG][oO][eE][sS]",
    "[oO][tT]",
    "[iI][nN][oO][uU][tT]",
    "[nN][dD]",
    "[tT][hH][nN]",
    "[kK][eE][tT]",
    "[mM][iI][sS]",
    "[oO][pP][tT][iI][nN]",
    "[rR][eE][lL][aA]",
    "[sS][eE][hH]",
    "[wW][tT][hH]",
    "[tT][pP][yY][oO]",
    "[lL][iI][tT][sS]?",
    "RealOLT",
    "OLT",
    "LT",
    "VALUEs",
    "tolen",
    "makro",
    # library/alloc/src/collections/vec_deque/**
    "deques",
    # library/core/src/str/mod.rs
    "pard",
    # https://docs.rs/wasi/latest/wasi/constant.ERRNO_ACCES.html
    "ERRNO_ACCES",
    # /usr/x86_64-w64-mingw32/include/winerror.h
    "ERROR_FILENAME_EXCED_RANGE",
    # drain_unstalled_obligations
    "unstalled",
    "ba",
    "fpr",
    "[fF][oO]",
]

[default.extend-identifiers]
MisMatch = "Mismatch"
FieldMisMatch = "FieldMismatch"

This takes care of most of the simple fixes, while the remaining have to be disambiguated manually which is not that bad since the error messages are pretty detailed with location and possible fixes.

I told you to remove some bad cases on the first PR, how many did you have to remove roughly?

Nothing except the ones you asked me to remove in the initial remove, didn't find anything after double checking.

@Noratrieb
Copy link
Member

@bors r+

We generally have a policy against automated typo fixing PRs because of some bad experiences, which I didn't apply here because the PR was good :).

But we are interested in looking into ways to catch such typos more automatically in CI (and if it's good enough, may want to adopt that), so it you have any ideas on how it could be done with a low enough false positive rate feel free to share that on zulip.

@bors
Copy link
Contributor

bors commented Apr 11, 2023

📌 Commit 40f12c6 has been approved by Nilstrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 11, 2023
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Apr 11, 2023
Fix typos in compiler

I ran [`typos -w compiler`](https://github.com/crate-ci/typos) to fix typos in the `compiler` directory.

Refs rust-lang#110150
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 11, 2023
Fix typos in librustdoc, tools and config files

I used [`typos`](https://github.com/crate-ci/typos) to fix all typos, minus the ones present in rust-lang#110153 and in rust-lang#110154.

Refs rust-lang#110150
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Apr 11, 2023
Fix typos in librustdoc, tools and config files

I used [`typos`](https://github.com/crate-ci/typos) to fix all typos, minus the ones present in rust-lang#110153 and in rust-lang#110154.

Refs rust-lang#110150
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Apr 11, 2023
Fix typos in compiler

I ran [`typos -w compiler`](https://github.com/crate-ci/typos) to fix typos in the `compiler` directory.

Refs rust-lang#110150
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Apr 12, 2023
Fix typos in librustdoc, tools and config files

I used [`typos`](https://github.com/crate-ci/typos) to fix all typos, minus the ones present in rust-lang#110153 and in rust-lang#110154.

Refs rust-lang#110150
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Apr 12, 2023
Fix typos in compiler

I ran [`typos -w compiler`](https://github.com/crate-ci/typos) to fix typos in the `compiler` directory.

Refs rust-lang#110150
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 12, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#110153 (Fix typos in compiler)
 - rust-lang#110165 (rustdoc: use CSS `overscroll-behavior` instead of JavaScript)
 - rust-lang#110175 (Symbol cleanups)
 - rust-lang#110203 (Remove `..` from return type notation)
 - rust-lang#110205 (rustdoc: make settings radio and checks thicker, less contrast)
 - rust-lang#110222 (Improve the error message when forwarding a matched fragment to another macro)
 - rust-lang#110237 (Split out a separate feature gate for impl trait in associated types)
 - rust-lang#110241 (tidy: Issue an error when UI test limits are too high)

Failed merges:

 - rust-lang#110218 (Remove `ToRegionVid`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 331e7c3 into rust-lang:master Apr 12, 2023
@rustbot rustbot added this to the 1.70.0 milestone Apr 12, 2023
@DaniPopes DaniPopes deleted the compiler-typos branch April 12, 2023 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants