From 65d7c1d2d621c607174f429d5f7553210315dbae Mon Sep 17 00:00:00 2001 From: whosehang Date: Wed, 24 Apr 2024 13:58:51 +0800 Subject: [PATCH 1/5] chore: fix some typos in comments Signed-off-by: whosehang --- compiler/rustc_span/src/hygiene.rs | 2 +- compiler/rustc_type_ir/src/ty_kind.rs | 2 +- library/core/src/fmt/rt.rs | 2 +- src/doc/rustc/src/platform-support/arm64ec-pc-windows-msvc.md | 2 +- src/doc/rustc/src/platform-support/wasm32-wasip1.md | 2 +- src/doc/rustdoc/src/lints.md | 2 +- .../rustdoc/src/write-documentation/linking-to-items-by-name.md | 2 +- src/librustdoc/lint.rs | 2 +- src/rustdoc-json-types/lib.rs | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_span/src/hygiene.rs b/compiler/rustc_span/src/hygiene.rs index 1df2b357ac128..61234a97e16c5 100644 --- a/compiler/rustc_span/src/hygiene.rs +++ b/compiler/rustc_span/src/hygiene.rs @@ -1251,7 +1251,7 @@ struct HygieneDecodeContextInner { // global `HygieneData`. When we deserialize a `SyntaxContext`, we need to create // a new id in the global `HygieneData`. This map tracks the ID we end up picking, // so that multiple occurrences of the same serialized id are decoded to the same - // `SyntaxContext`. This only stores `SyntaxContext`s which are completly decoded. + // `SyntaxContext`. This only stores `SyntaxContext`s which are completely decoded. remapped_ctxts: Vec>, /// Maps serialized `SyntaxContext` ids that are currently being decoded to a `SyntaxContext`. diff --git a/compiler/rustc_type_ir/src/ty_kind.rs b/compiler/rustc_type_ir/src/ty_kind.rs index 397e104512fd7..3be0be83e09e9 100644 --- a/compiler/rustc_type_ir/src/ty_kind.rs +++ b/compiler/rustc_type_ir/src/ty_kind.rs @@ -227,7 +227,7 @@ pub enum TyKind { /// A placeholder type, used during higher ranked subtyping to instantiate /// bound variables. /// - /// It is conventional to render anonymous placeholer types like `!N` or `!U_N`, + /// It is conventional to render anonymous placeholder types like `!N` or `!U_N`, /// where `N` is the placeholder variable's anonymous index (which corresponds /// to the bound variable's index from the binder from which it was instantiated), /// and `U` is the universe index in which it is instantiated, or totally omitted diff --git a/library/core/src/fmt/rt.rs b/library/core/src/fmt/rt.rs index 5e4dac8f49b6c..92626feabf3d7 100644 --- a/library/core/src/fmt/rt.rs +++ b/library/core/src/fmt/rt.rs @@ -153,7 +153,7 @@ impl<'a> Argument<'a> { /// /// # Safety /// - /// This argument must actually be a placeholer argument. + /// This argument must actually be a placeholder argument. /// // FIXME: Transmuting formatter in new and indirectly branching to/calling // it here is an explicit CFI violation. diff --git a/src/doc/rustc/src/platform-support/arm64ec-pc-windows-msvc.md b/src/doc/rustc/src/platform-support/arm64ec-pc-windows-msvc.md index 9fd0ac4988162..2e82753586261 100644 --- a/src/doc/rustc/src/platform-support/arm64ec-pc-windows-msvc.md +++ b/src/doc/rustc/src/platform-support/arm64ec-pc-windows-msvc.md @@ -73,7 +73,7 @@ Tests can be run on AArch64 Windows 11 devices. ## Cross-compilation toolchains and C code -C code can be built using the Arm64-targetting MSVC or Clang toolchain. +C code can be built using the Arm64-targeting MSVC or Clang toolchain. To compile: diff --git a/src/doc/rustc/src/platform-support/wasm32-wasip1.md b/src/doc/rustc/src/platform-support/wasm32-wasip1.md index 77efa9c328211..4faa198873536 100644 --- a/src/doc/rustc/src/platform-support/wasm32-wasip1.md +++ b/src/doc/rustc/src/platform-support/wasm32-wasip1.md @@ -59,7 +59,7 @@ languages compiled to WebAssembly, for example C/C++. Any ABI differences or mismatches are considered bugs that need to be fixed. By default the WASI targets in Rust ship in rustup with a precompiled copy of -[`wasi-libc`] meaning that a WebAssembly-targetting-Clang is not required to +[`wasi-libc`] meaning that a WebAssembly-targeting-Clang is not required to use the WASI targets from Rust. If there is no actual interoperation with C then `rustup target add wasm32-wasip1` is all that's needed to get started with WASI. diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md index 7d573ac950d8e..c05077befdb3a 100644 --- a/src/doc/rustdoc/src/lints.md +++ b/src/doc/rustdoc/src/lints.md @@ -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. diff --git a/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md b/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md index 56c14b1638a6f..1a367b8274b96 100644 --- a/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md +++ b/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md @@ -168,4 +168,4 @@ render differently in this case: ``` `1.` and `2.` will be displayed as is in the rendered documentation (ie, `[a]` and `[b][c]`) -whereas `3.` and `4.` will be replaced by a link targetting `e` for `[d](e)` and `g` for `[f]`. +whereas `3.` and `4.` will be replaced by a link targeting `e` for `[d](e)` and `g` for `[f]`. diff --git a/src/librustdoc/lint.rs b/src/librustdoc/lint.rs index f78743a7917ce..dd2bb47e5926b 100644 --- a/src/librustdoc/lint.rs +++ b/src/librustdoc/lint.rs @@ -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 diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index 89d6f8d67f101..e788069ea804c 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -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>), - /// A struct with nammed fields. + /// A struct with named fields. /// /// ```rust /// pub struct PlainStruct { x: i32 } From 153b1f0421ec0da1d504fa9505acad35503db2ee Mon Sep 17 00:00:00 2001 From: Urgau Date: Wed, 24 Apr 2024 15:34:57 +0200 Subject: [PATCH 2/5] Improve diagnostic for unknown --print request --- compiler/rustc_session/src/config.rs | 9 ++++++--- src/tools/tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/valid-print-requests/Makefile | 4 ---- .../valid-print-requests/valid-print-requests.stderr | 2 -- tests/ui/invalid-compile-flags/print.rs | 1 + tests/ui/invalid-compile-flags/print.stderr | 4 ++++ 6 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 tests/run-make/valid-print-requests/Makefile delete mode 100644 tests/run-make/valid-print-requests/valid-print-requests.stderr create mode 100644 tests/ui/invalid-compile-flags/print.rs create mode 100644 tests/ui/invalid-compile-flags/print.stderr diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index d5b22f841d273..c5ca16ba74416 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -1888,9 +1888,12 @@ fn collect_print_requests( let prints = PRINT_KINDS.iter().map(|(name, _)| format!("`{name}`")).collect::>(); let prints = prints.join(", "); - early_dcx.early_fatal(format!( - "unknown print request `{req}`. Valid print requests are: {prints}" - )); + + let mut diag = + early_dcx.early_struct_fatal(format!("unknown print request: `{req}`")); + #[allow(rustc::diagnostic_outside_of_impl)] + diag.help(format!("valid print requests are: {prints}")); + diag.emit() } }; diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index f0ed0ae806fd8..93188b4fbaebd 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -317,7 +317,6 @@ run-make/unstable-flag-required/Makefile run-make/use-suggestions-rust-2018/Makefile run-make/used-cdylib-macos/Makefile run-make/used/Makefile -run-make/valid-print-requests/Makefile run-make/volatile-intrinsics/Makefile run-make/wasm-exceptions-nostd/Makefile run-make/wasm-override-linker/Makefile diff --git a/tests/run-make/valid-print-requests/Makefile b/tests/run-make/valid-print-requests/Makefile deleted file mode 100644 index 99430e98d1c2d..0000000000000 --- a/tests/run-make/valid-print-requests/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../tools.mk - -all: - $(RUSTC) --print uwu 2>&1 | diff - valid-print-requests.stderr diff --git a/tests/run-make/valid-print-requests/valid-print-requests.stderr b/tests/run-make/valid-print-requests/valid-print-requests.stderr deleted file mode 100644 index 22bb102f9c989..0000000000000 --- a/tests/run-make/valid-print-requests/valid-print-requests.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: unknown print request `uwu`. Valid print requests are: `all-target-specs-json`, `calling-conventions`, `cfg`, `code-models`, `crate-name`, `deployment-target`, `file-names`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `target-spec-json`, `tls-models` - diff --git a/tests/ui/invalid-compile-flags/print.rs b/tests/ui/invalid-compile-flags/print.rs new file mode 100644 index 0000000000000..0d0a9d22750dd --- /dev/null +++ b/tests/ui/invalid-compile-flags/print.rs @@ -0,0 +1 @@ +//@ compile-flags: --print yyyy diff --git a/tests/ui/invalid-compile-flags/print.stderr b/tests/ui/invalid-compile-flags/print.stderr new file mode 100644 index 0000000000000..0a032aabdfe8a --- /dev/null +++ b/tests/ui/invalid-compile-flags/print.stderr @@ -0,0 +1,4 @@ +error: unknown print request: `yyyy` + | + = help: valid print requests are: `all-target-specs-json`, `calling-conventions`, `cfg`, `code-models`, `crate-name`, `deployment-target`, `file-names`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `target-spec-json`, `tls-models` + From 21906002ed01067d4257660696f92b205c72a882 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 24 Apr 2024 13:54:41 +0000 Subject: [PATCH 3/5] Strengthen tracking issue policy with consequences --- .github/ISSUE_TEMPLATE/tracking_issue.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/tracking_issue.md b/.github/ISSUE_TEMPLATE/tracking_issue.md index 5f17f30b3b0b1..598628936112e 100644 --- a/.github/ISSUE_TEMPLATE/tracking_issue.md +++ b/.github/ISSUE_TEMPLATE/tracking_issue.md @@ -28,6 +28,8 @@ Tracking issues are used to record the overall progress of implementation. They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label. +Discussion comments will get marked as off-topic or deleted. +Repeated discussions on the tracking issue may lead to the tracking issue getting locked. ### Steps