instance_id stringlengths 10 65 | repo stringlengths 5 59 | pr_number int64 1 313k | task_type stringclasses 1
value | base_commit stringlengths 40 40 | review_commit stringlengths 40 40 | title stringlengths 2 282 | body stringlengths 7 3k | patch stringlengths 202 204k | n_defects int64 1 72 | n_supported int64 1 65 | n_major int64 0 32 | defects stringlengths 140 18.8k | certifier_count int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rust-lang__rust-clippy__16732 | rust-lang/rust-clippy | 16,732 | defect | d82d650272a535bd5758117105054a7221d87266 | f10dc9deff2368584ede6ed7c175e8dc27a7a01c | new module style lint: `inline_modules` | *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust-clippy/pull/16732)*
fixes: rust-lang/rust-clippy#15966
add new module style restriction lint that checks for use of inline modules, with an exception for test module.
changelog: new lint: [`inline_modules`]
| diff --git a/CHANGELOG.md b/CHANGELOG.md
index 45bfb65b2e67..3a9681185240 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6692,6 +6692,7 @@ Released 2018-09-13
[`inline_asm_x86_att_syntax`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_asm_x86_att_syntax
[`inline_asm_x86_intel_syntax`]: https://r... | 15 | 15 | 2 | [{"id": "G0", "claim": "The doc example should be annotated as ignored Rust instead of text (it would not compile as written), use regular comments rather than docstrings, and show `/* module contents */` where the code moves.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced... | null |
rust-lang__rust-clippy__16770 | rust-lang/rust-clippy | 16,770 | defect | e4683d27a98a6e920f0e2c1f401d1711fa51c0c8 | c2cca1aa7fc08f7f821573b54ffb56162e3197cd | Extend `byte_char_slices` to cover arrays | Closes rust-lang/rust-clippy#16759
changelog: [`byte_char_slices`] enhance to cover arrays
| diff --git a/clippy_lints/src/byte_char_slices.rs b/clippy_lints/src/byte_char_slices.rs
index 6c023189f69e..c8b27fcad40a 100644
--- a/clippy_lints/src/byte_char_slices.rs
+++ b/clippy_lints/src/byte_char_slices.rs
@@ -1,9 +1,15 @@
-use clippy_utils::diagnostics::span_lint_and_sugg;
-use rustc_ast::ast::{BorrowKind, Ex... | 5 | 4 | 1 | [{"id": "G0", "claim": "When the array's uses adjust and auto-dereference it, the lint should suggest `b\"…\"` without the `*` instead of `*b\"…\"`.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "If the snippet cannot be retrieved, the fallback \"..\" ma... | null |
rust-lang__rust-clippy__16830 | rust-lang/rust-clippy | 16,830 | defect | 49a2f386f9a22afc74b29bbf76bb01f2e73d19cf | bd10abe991bd424da5cab470406f53be52b7bfc1 | Fix `for_kv_map` FN when using `iter` and `iter_mut` | Closes rust-lang/rust-clippy#16822
changelog: [`for_kv_map`] fix FN when using `iter` and `iter_mut`
| diff --git a/clippy_lints/src/loops/for_kv_map.rs b/clippy_lints/src/loops/for_kv_map.rs
index 7fb8e51377a2..6b4256384cf0 100644
--- a/clippy_lints/src/loops/for_kv_map.rs
+++ b/clippy_lints/src/loops/for_kv_map.rs
@@ -23,7 +23,17 @@ pub(super) fn check<'tcx>(
&& pat.len() == 2
{
let arg_span = a... | 2 | 2 | 0 | [{"id": "G0", "claim": "The pull request should also handle the case of destructuring the value as `_` (issue 16822's other half).", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "claim": "The new match arms in for_kv_map.rs should get explanatory comments, ... | null |
rust-lang__rust-clippy__16881 | rust-lang/rust-clippy | 16,881 | defect | effe2357102d0f71c0f05dedd72d7cb2ad7e2b72 | 2d6808aa1107b08b14d4394f431dfa53c91d599c | fix `from_over_into` false positive with conflicting blanket From impl | fixes rust-lang/rust-clippy#16823
This is my first contribution to Clippy, happy to make changes if the approach isn't quite right
changelog: [`from_over_into`]: don't lint when a blanket `From` impl would cause a coherence conflict
| diff --git a/clippy_lints/src/from_over_into.rs b/clippy_lints/src/from_over_into.rs
index 841d561b371c..fdb816fcb7e7 100644
--- a/clippy_lints/src/from_over_into.rs
+++ b/clippy_lints/src/from_over_into.rs
@@ -10,11 +10,11 @@ use rustc_errors::Applicability;
use rustc_hir::intravisit::{Visitor, walk_path};
use rustc... | 1 | 1 | 0 | [{"id": "G0", "claim": "The `From` impl lookup can use `cx.tcx.non_blanket_impls_for_ty` instead of iterating over all `From` impls.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__rust-clippy__16888 | rust-lang/rust-clippy | 16,888 | defect | 0c71cf8104db541c5cf6b6fb1aadc924070cd170 | 06a62f94fc6d9ecad6cc75fe18b6a8c6669ba0e3 | Extend `zst_offset` lint to detect NonNull<T> offset calculations | Fixes rust-lang/rust-clippy#16887
The `zst_offset` lint previously only checked raw pointers (`*mut T` / `*const T`) for offset calculations on zero-sized types. `NonNull<T>` also provides `add`, `sub`, and `offset` methods that are equally no-ops on ZSTs, but were not flagged.
The PR extends the lint to also che... | diff --git a/clippy_lints/src/methods/zst_offset.rs b/clippy_lints/src/methods/zst_offset.rs
index 102fa7bc8953..a7853fcd142a 100644
--- a/clippy_lints/src/methods/zst_offset.rs
+++ b/clippy_lints/src/methods/zst_offset.rs
@@ -1,13 +1,21 @@
use clippy_utils::diagnostics::span_lint;
+use clippy_utils::res::MaybeDef;
u... | 1 | 1 | 0 | [{"id": "G0", "claim": "There is no need for a `Some` wrapper which is immediately discarded; the match should bind the pointee type directly and return early in the default arm, as the reviewer's suggestion block proposes.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"... | null |
rust-lang__rust-clippy__16949 | rust-lang/rust-clippy | 16,949 | defect | 377417cf68ab671a67af222a551623ce228ce540 | a4f78d5630e4ba812fea7ca71e42b75f54a17a0f | fix: incompatibility of `non_canonical_clone_impl` and `implicit_return` | *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust-clippy/pull/16949)*
changelog: fix [`non_canonical_clone_impl`] incompatibility with [`implicit_return`]
Fixes rust-lang/rust-clippy#16945
<!-- TRIAGEBOT_START -->
<!-- TRIAGEBOT_CONCERN-ISSUE_START -->
> [!NOTE]
> # Concerns (0... | diff --git a/clippy_lints/src/non_canonical_impls.rs b/clippy_lints/src/non_canonical_impls.rs
index 46d1be80b50a..7c438edf2996 100644
--- a/clippy_lints/src/non_canonical_impls.rs
+++ b/clippy_lints/src/non_canonical_impls.rs
@@ -1,10 +1,10 @@
use clippy_utils::diagnostics::{span_lint_and_sugg, span_lint_and_then};
... | 2 | 2 | 1 | [{"id": "G0", "claim": "check_clone_on_copy should take a `block_expr: &Expr<'_>` instead of the `block` parameter (the caller can pass `body.value`), and the lint should be emitted at `body_expr.span` instead of `body.span`.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id... | null |
rust-lang__rust-clippy__16952 | rust-lang/rust-clippy | 16,952 | defect | 377417cf68ab671a67af222a551623ce228ce540 | 2cdd96d91df1c09677d2623b71530c62df411ddc | fix: [needless_return_with_question_mark] trigger in async functions | fixes rust-lang/rust-clippy#16950
lint should now also trigger over async fns.
changelog: [`needless_return_with_question_mark`]: fix false negative in async fn bodies.
| diff --git a/clippy_lints/src/returns/needless_return_with_question_mark.rs b/clippy_lints/src/returns/needless_return_with_question_mark.rs
index c47a3ef21e86..7c55150db10d 100644
--- a/clippy_lints/src/returns/needless_return_with_question_mark.rs
+++ b/clippy_lints/src/returns/needless_return_with_question_mark.rs
@... | 1 | 1 | 1 | [{"id": "G0", "claim": "The PR's fix should also cover async blocks, not just async functions, e.g. `return Err(())?` inside an `async { ... }.await` block.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
rust-lang__rust-clippy__16966 | rust-lang/rust-clippy | 16,966 | defect | 6310134fe4b53e384e82245a9edf317eb288d577 | 2171cbe7ce2a26889a31b3e52447b4c50a591f9a | test: Prepare tests for new Cargo build-dir layout | This PR prepares the clippy testsuite to work with the new Cargo `build-dir` layout tracked in https://github.com/rust-lang/cargo/pull/16807.
Context: In https://github.com/rust-lang/rust/pull/155439 we attempt to enable the new Cargo `build-dir` layout in rust-lang/rust and I am working through all of the build fai... | diff --git a/Cargo.toml b/Cargo.toml
index 234478eadbf9..f3af37720e7e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -34,7 +34,7 @@ anstream = "0.6.18"
[dev-dependencies]
cargo_metadata = "0.23"
-ui_test = "0.30.2"
+ui_test = "0.30.5"
regex = "1.5.5"
serde = { version = "1.0.145", features = ["derive"] }
serde_json... | 2 | 1 | 1 | [{"id": "G0", "claim": "In the test harness, a leftover `deps` directory from the old Cargo layout would still take precedence over the new build-dir layout even once it is obsolete.", "category": "testing", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "With `CARGO_UNSTABLE_BUIL... | null |
rust-lang__rust-clippy__9760 | rust-lang/rust-clippy | 9,760 | defect | 37d338c1efd7840fa96c5eaeaa5785094efdab07 | 1f930452b9483612bc7dabbc38281170f0c9e747 | Add new lint [`let_underscore_future`] | This closes #9721
---
changelog: add new lint [`let_underscore_future`] | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 35864e85673a..8813a4569768 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3979,6 +3979,7 @@ Released 2018-09-13
[`len_zero`]: https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
[`let_and_return`]: https://rust-lang.github.io/rust-clippy/master/index.htm... | 3 | 2 | 0 | [{"id": "G0", "claim": "The lint's doc examples should not be marked `rust,ignore`; compiling them would make sure the code shown is correct.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The `let` keyword in the lint's message strings — 'non-bin... | null |
rust-lang__rust__100168 | rust-lang/rust | 100,168 | defect | 1f5d8d49eb6111931091f700d07518cd2b80bc18 | 743ad07c4b267bc5806a455b51ff07b3012591cc | Improve diagnostics for `const a: = expr;` | Adds a suggestion to write a type when there is a colon, but the type is not present.
I've also shrunk spans a little, so the suggestions are a little nicer.
Resolves #100146
r? @compiler-errors | diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs
index 2c1e5807aa7f9..0d175c5c89323 100644
--- a/compiler/rustc_parse/src/parser/item.rs
+++ b/compiler/rustc_parse/src/parser/item.rs
@@ -1179,10 +1179,11 @@ impl<'a> Parser<'a> {
// Parse the type of a `const` or ... | 3 | 1 | 0 | [{"id": "G0", "claim": "The new `match colon_present { ... }` matches on a plain bool, which reads poorly and would be better expressed differently.", "category": "design", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The reworked missing-type suggestion reads oddly because i... | null |
rust-lang__rust__119505 | rust-lang/rust | 119,505 | defect | 88d69b72b4ccfd4e4b64451a7a5d9fd23d2249a3 | 9a4ac5e0085e22f86c027f42e82ef0c941a481a0 | Don't synthesize host effect params for trait associated functions marked const | Fixes #113378.
r? fee1-dead or compiler | diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs
index 3848f3b778298..a9f362cba3164 100644
--- a/compiler/rustc_ast_lowering/src/item.rs
+++ b/compiler/rustc_ast_lowering/src/item.rs
@@ -1254,11 +1254,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
coroutine_kind: Opt... | 2 | 2 | 0 | [{"id": "G0", "claim": "Keep the Const::No recovery for trait associated functions and additionally turn the pre-existing bug!() on a duplicate host effect param into a span_delayed_bug, since the delayed bug alone can lead to weird extra diagnostics such as a bogus const-parameter mismatch.", "category": "correctness"... | null |
rust-lang__rust__130064 | rust-lang/rust | 130,064 | defect | d678b81485b05680801554d744ea2696949f0135 | 46115fd6d3be8a868ebfdabb20d44673ab47ab60 | fix ICE in CMSE type validation | fixes #129983
tracking issue: https://github.com/rust-lang/rust/issues/81391
r? @compiler-errors | diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/cmse.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/cmse.rs
index 1b73cecd6664b..dd519fb92d951 100644
--- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/cmse.rs
+++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/cmse.rs
@@ -18,6 +18,9 @@ pub(crate... | 2 | 1 | 0 | [{"id": "G0", "claim": "Change `is_valid_cmse_inputs` back to taking `ty::PolyFnSig` and do the binder instantiation (`instantiate_bound_regions_with_erased`) inside the function instead of converting to `FnSig` at the caller.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"i... | null |
rust-lang__rust__141633 | rust-lang/rust | 141,633 | defect | 105354db48223b7bf799b05d4dd3a412aca7bd05 | abf5c8c5b998f371da864846013abd9e2dd5384d | Suggest to bind `self.x` to `x` when field `x` may be in format string | <!-- homu-ignore:start -->
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/141633)*
<!-- homu-ignore:end -->
Fixes rust-lang/rust#141350
I added the new test in the first commit, and committed the changes in the second one.
r? @fmease
cc @mejrs | diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs
index ca25cdc9563d9..b98bf146dde9e 100644
--- a/compiler/rustc_resolve/src/late/diagnostics.rs
+++ b/compiler/rustc_resolve/src/late/diagnostics.rs
@@ -766,14 +766,15 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutio... | 4 | 1 | 1 | [{"id": "G0", "claim": "Changing the help message is not an improvement and the pull request should instead attempt a structured suggestion that the user add a `, foo = self.foo` argument to the format macro where the error originates.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduc... | null |
rust-lang__rust__149637 | rust-lang/rust | 149,637 | defect | 83e49b75e7daf827e4390ae0ccbcb0d0e2c96493 | 25d41934a63b51e1b810451b4f90a21db093a940 | Do not run jump-threading for GPUs | <!-- homu-ignore:start -->
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/149637)*
<!-- homu-ignore:end -->
GPU targets have convergent operations that must not be duplicated or
moved in or out of control-flow.
An example convergent operation is a barrier/syncthreads.
T... | diff --git a/compiler/rustc_codegen_llvm/src/allocator.rs b/compiler/rustc_codegen_llvm/src/allocator.rs
index de0b85ebb63b8..ede713b5ac0b2 100644
--- a/compiler/rustc_codegen_llvm/src/allocator.rs
+++ b/compiler/rustc_codegen_llvm/src/allocator.rs
@@ -176,6 +176,15 @@ fn create_wrapper_function(
None
};
... | 5 | 4 | 2 | [{"id": "G0", "claim": "Apply the convergent attribute by pushing it into the existing `attrs` vector in `declare_raw_fn` instead of a separate `apply_to_llfn` call.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Use the existing `is_like_gpu` target fie... | null |
rust-lang__rust__149937 | rust-lang/rust | 149,937 | defect | 8afe9ff1caa97654c31fb8c259dac9fdf67d6302 | dc1d3bc40094ab74bcdaf5531be58f8eb22c2fab | split out `linker-info` from `linker-messages` | *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/149937)*
Helps with https://github.com/rust-lang/rust/issues/136096.
<!-- homu-ignore:start -->
<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue... | diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index c8109db86e2f2..6db37fcdfe8a6 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -21,6 +21,7 @@ use rustc_errors::{DiagCtxtHandle, LintDiagnostic};
use ... | 5 | 1 | 1 | [{"id": "G0", "claim": "There is still an issue with macOS (rust-lang/rust#151970), so the linker warning lint should not be enabled yet.", "category": "correctness", "verdict": "opposed", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "`is_windows_gnu_ld` matches both `windows-gnu` and `windows-gnullv... | null |
rust-lang__rust__152277 | rust-lang/rust | 152,277 | defect | c58d9f9f82ead734d73d99a64e910718f5f464d3 | 4483628d4bf62e74f5decb2b74d123362eda4be5 | Validate source snippet when format input is raw string | <!-- homu-ignore:start -->
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/152277)*
<!-- homu-ignore:end -->
Fixes rust-lang/rust#114865
The issue occurred because the user's proc macro respanned the format arg to an unrelated multi-byte string and we ICE'd by landing in t... | diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs
index 3d8b97b2fde38..7323ac25dd49a 100644
--- a/compiler/rustc_parse_format/src/lib.rs
+++ b/compiler/rustc_parse_format/src/lib.rs
@@ -307,24 +307,45 @@ impl<'input> Parser<'input> {
let (is_source_literal, end_of_s... | 4 | 4 | 2 | [{"id": "G0", "claim": "Replace the issue number in the regression test's header comment with a link to the GitHub issue.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "`foo!(r字字);` causes an ICE with the pull request's implementation at this line... | null |
rust-lang__rust__153536 | rust-lang/rust | 153,536 | defect | ea5573a6c6e5e932f917ec4a8e6d8efdeb9f394d | 6dbf4949892142adc6f68c95143deb7bdd2f4e37 | Add `const_param_ty_unchecked` gate | <!-- homu-ignore:start -->
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/153536)*
<!-- homu-ignore:end -->
Add `const_param_ty_unchecked` internal feature gate to skip `ConstParamTy_` trait enforcement on type. Provides an escape hatch for writing tests and examples that us... | diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs
index 3b15183be0b2d..2e9785dfc195d 100644
--- a/compiler/rustc_feature/src/unstable.rs
+++ b/compiler/rustc_feature/src/unstable.rs
@@ -229,6 +229,8 @@ declare_features! (
(internal, cfg_target_has_reliable_f16_f128, "1.88... | 2 | 2 | 1 | [{"id": "G0", "claim": "Skipping the `ConstParamTy` impl check in coherence is not what was wanted: the feature gate should avoid checking that the types of const generics implement `ConstParamTy` at all, so that e.g. floats can be used in const generics even though orphan rules prevent writing the impl.", "category": ... | null |
rust-lang__rust__154506 | rust-lang/rust | 154,506 | defect | 64d5cb603b9caf9063d27d64fdfa61fa7af3b98f | 5e889dfc97d7ab122212d3eb94ac0155dc2182e0 | Migrate some tests from `tests/ui/issues` to appropriate directories | The following changes have been made in the pull request:
- `tests/ui/issues/issue-25746-bool-transmute.rs` ➝ `tests/ui/transmute/transmute-bool-u8.rs`
- `tests/ui/issues/issue-32377.{rs,stderr}` ➝ `tests/ui/intrinsics/transmute-phantomdata-generic-unequal-size.{rs,stderr}`
The issue links have also been added ... | diff --git a/tests/ui/issues/issue-25746-bool-transmute.rs b/tests/ui/transmute/transmute-bool-vice-versa.rs
similarity index 77%
rename from tests/ui/issues/issue-25746-bool-transmute.rs
rename to tests/ui/transmute/transmute-bool-vice-versa.rs
index 046dcf83f62d6..b04c9b762adfc 100644
--- a/tests/ui/issues/issue-2574... | 3 | 3 | 0 | [{"id": "G0", "claim": "The bool-transmute test should use `//@ build-pass` instead of `//@ run-pass`, and the change should be made in this PR rather than deferred to the audit issue.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "Rename the test fil... | null |
rust-lang__rust__155189 | rust-lang/rust | 155,189 | defect | d32e620a107b5b3dccd9ddb53fa124956a92b589 | d7ab69561a799848e3f7ca6671ab6671b92475f6 | simd_reduce_min/max: remove float support | <!-- homu-ignore:start -->
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/155189)*
<!-- homu-ignore:end -->
LLVM currently doesn't have an intrinsic with the right semantics here (see https://github.com/llvm/llvm-project/issues/185827). The only remaining user of this intrin... | diff --git a/compiler/rustc_codegen_gcc/src/builder.rs b/compiler/rustc_codegen_gcc/src/builder.rs
index 3cffd862b9b98..065ed43be8cfe 100644
--- a/compiler/rustc_codegen_gcc/src/builder.rs
+++ b/compiler/rustc_codegen_gcc/src/builder.rs
@@ -2313,67 +2313,10 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
sel... | 4 | 2 | 2 | [{"id": "G0", "claim": "The GCC backend's vector_reduce_fmin implementation was completely wrong under any conceivable semantics: for input [0.0, NaN, 1.0, 2.0] it would return 1.0.", "category": "correctness", "verdict": "uncertain", "priority": "P0", "scope": "pre_existing"}, {"id": "G1", "claim": "Doc comments still... | null |
rust-lang__rust__155215 | rust-lang/rust | 155,215 | defect | dab8d9d1066c4c95008163c7babf275106ce3f32 | f468cef3db009c36fec8f97aa911e90e8738850d | Clean up `AttributeLintKind` and refactor diagnostic attribute linting | There was a fair amount of duplication here, and thanks to the proliferation of new diagnostic attributes these days, it was threatening to grow bigger.
| diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs
index f68bed620f1b3..0e64135951664 100644
--- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs
@@ -40,... | 2 | 1 | 0 | [{"id": "G0", "claim": "The `matches!(mode, Mode::RustcOnUnimplemented)` check in the `duplicate` macro should be replaced by a method such as `mode.should_error()` containing an exhaustive match, so a future diagnostic attribute cannot be forgotten.", "category": "design", "verdict": "opposed", "priority": "P2", "scop... | null |
rust-lang__rust__155431 | rust-lang/rust | 155,431 | defect | 1b8f2e46e14b08208a53585570edd9206374aae8 | e0ef87f8808a094339605fc5e859ac5baa810c0b | Add temporary scope to assert_matches | Addresses https://github.com/rust-lang/rust/issues/154406 in part. `assert_eq` will be done in a separate PR.
<!-- homu-ignore:start -->
<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue... | diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs
index 33397e56b86c5..08a12b6447e61 100644
--- a/library/core/src/macros/mod.rs
+++ b/library/core/src/macros/mod.rs
@@ -168,7 +168,7 @@ macro_rules! assert_ne {
#[allow_internal_unstable(panic_internals)]
#[rustc_macro_transparency = "semiop... | 2 | 2 | 1 | [{"id": "G0", "claim": "Consider adding a backlink to https://github.com/rust-lang/rust/issues/154406 in the test for extra context.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Since the expansions with and without a format string are defined s... | null |
rust-lang__rust__155692 | rust-lang/rust | 155,692 | defect | 92c7010294007f9bb819f0ddd9d9e9b5ccd5714a | e087ea077652d7287d0269343a44f336a64bc510 | disable naked-dead-code-elimination test if no RET mnemonic is available | <!-- homu-ignore:start -->
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/155692)*
<!-- homu-ignore:end -->
this test emit x86_64 specific ret asm instruction and should not be compiled on any other arch.
<!-- homu-ignore:start -->
<!--
If this PR is related to an unsta... | diff --git a/tests/run-make/naked-dead-code-elimination/rmake.rs b/tests/run-make/naked-dead-code-elimination/rmake.rs
index 1be22de367c99..5ffe2b9471806 100644
--- a/tests/run-make/naked-dead-code-elimination/rmake.rs
+++ b/tests/run-make/naked-dead-code-elimination/rmake.rs
@@ -1,5 +1,6 @@
//@ ignore-cross-compile
... | 1 | 1 | 1 | [{"id": "G0", "claim": "Gating the test with `only-x86_64` cuts test coverage unnecessarily: it should at least also run on aarch64 (which has `ret`), ideally via a `needs-ret-mnemonic`-style directive instead of a blanket architecture restriction.", "category": "correctness", "verdict": "supported", "priority": "P1", ... | null |
rust-lang__rust__155821 | rust-lang/rust | 155,821 | defect | 68ffae46b581747074413e4242ab0c6ecc4db4a9 | 2538ff29439361bcea3b497e95725820ca44861a | c-variadic: document `Clone` and `Drop` instances and require `VaArgSafe: Copy` | tracking issue: https://github.com/rust-lang/rust/issues/44930
Fixing some things that came up in the stabilization PR
r? tgross35
cc @kpreid | diff --git a/library/core/src/ffi/va_list.rs b/library/core/src/ffi/va_list.rs
index 0a35dc32ef19c..7a9876342056c 100644
--- a/library/core/src/ffi/va_list.rs
+++ b/library/core/src/ffi/va_list.rs
@@ -249,6 +249,9 @@ impl VaList<'_> {
}
}
+/// Clone the [`VaList`] producing a second independent cursor into the ... | 4 | 3 | 1 | [{"id": "G0", "claim": "The doc comment on the `Clone` impl should be moved from the `impl` to the `fn` so rustdoc and rust-analyzer show it as the function's documentation.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The `Clone` doc comment sh... | null |
rust-lang__rust__155939 | rust-lang/rust | 155,939 | defect | 03c609abb6638f9d7f49f34326d4137d07f5cd61 | 711ae3e4628a6ab0ee8d0cfe96a84651f827766f | Add feature gate for view_types experiment | <!-- homu-ignore:start -->
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/155939)*
<!-- homu-ignore:end -->
<!-- homu-ignore:start -->
<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you... | diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs
index 3bb4bc863def2..9712879fce6f7 100644
--- a/compiler/rustc_feature/src/unstable.rs
+++ b/compiler/rustc_feature/src/unstable.rs
@@ -723,6 +723,8 @@ declare_features! (
(internal, unsized_fn_params, "1.49.0", Some(48055... | 2 | 2 | 2 | [{"id": "G0", "claim": "Add a known-bug annotation linking to the tracking issue to tests/ui/feature-gates/feature-gate-view-types.rs.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The feature-gate test should not rely on the syntax not parsing: the PR... | null |
rust-lang__rust__155948 | rust-lang/rust | 155,948 | defect | 03c609abb6638f9d7f49f34326d4137d07f5cd61 | 21b1458aceb846c5795bd0ddb38c0e2ab04caafd | Fix order-dependent visibility diagnostics | <!-- homu-ignore:start -->
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/155948)*
<!-- homu-ignore:end -->
Fixes rust-lang/rust#40066.
Fixes https://github.com/rust-lang/rust/issues/109657.
Delay visibility path diagnostics until module collection has finished, so paths t... | diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs
index 6310155154b95..ba322931c9f48 100644
--- a/compiler/rustc_resolve/src/build_reduced_graph.rs
+++ b/compiler/rustc_resolve/src/build_reduced_graph.rs
@@ -35,9 +35,10 @@ use crate::imports::{ImportData,... | 6 | 6 | 1 | [{"id": "G0", "claim": "Visibility resolution failures should be delayed unconditionally, storing the actual VisResolutionError in the delayed error so a later successful resolution reports the stashed error and a later failure reports the new error, since the current conditional delay can report an error (and return V... | null |
rust-lang__rust__156001 | rust-lang/rust | 156,001 | defect | 4ddb0b7f8ecda9dbdbcbc0519c9988badbd65d1c | 702e0b72f9084875f33d89f641ece79838259bb9 | ssa-range-prop: fix ICE when encountering self-domiating bb | - **Add `strictly_dominates` method**
- **fix ice in ssa-range-prop**
Fixes rust-lang/rust#155836
r? dianqk
| diff --git a/compiler/rustc_data_structures/src/graph/dominators/mod.rs b/compiler/rustc_data_structures/src/graph/dominators/mod.rs
index 53ff67f60e379..b7ddd52e9ac13 100644
--- a/compiler/rustc_data_structures/src/graph/dominators/mod.rs
+++ b/compiler/rustc_data_structures/src/graph/dominators/mod.rs
@@ -386,6 +386,... | 2 | 2 | 0 | [{"id": "G0", "claim": "The new regression test should use the `//@ build-pass` directive instead of `//@ check-pass`.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new test file name has a tiny typo (`self-domiation` should be `self-domination`)."... | null |
rust-lang__rust__156059 | rust-lang/rust | 156,059 | defect | 9620eae30ab7614dcb72d44c4ce1dac497f6ae18 | 36b7394a584bca4547e9f9886509c4ae977aefd5 | compiler: Print valid `-Zmir-enable-passes` names if invalid name is used | If a user passes an invalid name to `-Zmir-enable-passes`, print the valid names as a note.
To avoid the annoyance of having to keep blessing test output, completely normalize away the list of names in the test.
The diagnostic is duplicated, but that is not introduced by this commit. In other words, we don't make... | diff --git a/compiler/rustc_mir_transform/src/errors.rs b/compiler/rustc_mir_transform/src/errors.rs
index 77dea3ae1003b..17aaeadb498df 100644
--- a/compiler/rustc_mir_transform/src/errors.rs
+++ b/compiler/rustc_mir_transform/src/errors.rs
@@ -120,6 +120,12 @@ pub(crate) struct UnknownPassName<'a> {
pub(crate) na... | 1 | 1 | 0 | [{"id": "G0", "claim": "The new ValidPassNames diagnostic should not hold an allocated String for the pass-name list; the reviewer asks that the valid pass names be borrowed (&str, e.g. Vec<&'a str>) instead.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__rust__156073 | rust-lang/rust | 156,073 | defect | f19e850f592889c49010b008b8c12e501eb2936e | 1f59167baba1de56e2b290a64a76c8ac5d308339 | [rustdoc] Fix `doc_cfg` feature on reexports | Part of rust-lang/rust#150268.
I don't mark the issue as fixed as I need to check the third case described in the issue. First commit comes from https://github.com/rust-lang/rust/pull/156020, will need to rebase this PR once the original is merged.
r? @Urgau | diff --git a/src/librustdoc/passes/propagate_doc_cfg.rs b/src/librustdoc/passes/propagate_doc_cfg.rs
index 1334595272f60..570117fd43e35 100644
--- a/src/librustdoc/passes/propagate_doc_cfg.rs
+++ b/src/librustdoc/passes/propagate_doc_cfg.rs
@@ -78,8 +78,10 @@ impl CfgPropagator<'_, '_> {
// We need to merge an... | 1 | 1 | 1 | [{"id": "G0", "claim": "The stability expected for `SubBanana` is missing the `not(feature = \"yoyo\")` condition and the test should mention it, since the item is exported via `#[cfg(not(feature = \"yoyo\"))] pub use self::banana::*;`.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "in... | null |
rust-lang__rust__80592 | rust-lang/rust | 80,592 | defect | a609fb45efad59dfd459c76e50899be9f0583b5a | 91f436b456130561d514c5e7050486cb0768996f | Suggest renaming or escaping when fixing non-snake-case identifiers which would conflict with keywords | Fixes #80575 | diff --git a/compiler/rustc_lint/src/nonstandard_style.rs b/compiler/rustc_lint/src/nonstandard_style.rs
index 6d61b86f32ef9..39cebe7f96936 100644
--- a/compiler/rustc_lint/src/nonstandard_style.rs
+++ b/compiler/rustc_lint/src/nonstandard_style.rs
@@ -275,10 +275,24 @@ impl NonSnakeCase {
// We ha... | 1 | 1 | 0 | [{"id": "G0", "claim": "When suggesting a fix for a non-snake-case identifier that cannot be a raw identifier (e.g. `super`), the lint may emit a note like `super cannot be used as a raw identifier` so users do not fruitlessly try that conversion.", "category": "design", "verdict": "supported", "priority": "P2", "scope... | null |
rust-lang__rustc-perf__2119 | rust-lang/rustc-perf | 2,119 | defect | 148104da4315ee693660dbb9b3cf3c0477e13d11 | cde5cabe15ef6bf0a5b574f6d30f914c913ae4c9 | Infra - wire up database for test | I've added a Makefile too so we can spin it up and down locally. | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 70122d338c..f9991c7bd7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,7 +33,7 @@ jobs:
key: linux
- name: Run unit tests
- run: cargo test --all
+ run: make test
- name: Lint ch... | 7 | 5 | 1 | [{"id": "G0", "claim": "The `create_commit` helper copied from the load.rs tests should be moved into a shared `test_utils.rs` to avoid duplication.", "category": "maintainability", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The repeated `db.connection().await` calls in the a... | null |
rust-lang__rustc-perf__2163 | rust-lang/rustc-perf | 2,163 | defect | 5236fe90d9df597354a4124b091bd22510d6f430 | 18a4e0fa265cdd829e3c014420219bac38203974 | Feat - cron queue for master commits | - Toggle the cron running using `RUN_CRON` environment variable
- Change the frequency of the cron using environment variable `QUEUE_UPDATE_INTERVAL_SECONDS`
- Every `30` seconds by default would populate the `benchmark_requests` table with master commits | diff --git a/database/src/lib.rs b/database/src/lib.rs
index 7797edc0d6..60b9aa7cbe 100644
--- a/database/src/lib.rs
+++ b/database/src/lib.rs
@@ -798,3 +798,154 @@ pub struct ArtifactCollection {
pub duration: Duration,
pub end_time: DateTime<Utc>,
}
+
+#[derive(Debug)]
+pub enum BenchmarkRequestCommitType ... | 19 | 16 | 3 | [{"id": "G0", "claim": "The `Queued` and `InProgress` variants of `BenchmarkRequestStatus` describe mostly the same state, so `Queued` should be dropped and `waiting_for_parent` used as the default insert status before switching to `in_progress`.", "category": "design", "verdict": "supported", "priority": "P2", "scope"... | null |
rust-lang__rustc-perf__2166 | rust-lang/rustc-perf | 2,166 | defect | 39fab1ae472ae58a6e7d3bd2a54cb5493869179e | 28ad8cc0b824b46b9ef447a9ae5b8ee7c5e6a110 | Feat: Logic for finding the next request to be processed and tests | Tees up the next request in the `benchmark_request` table (does not create jobs in what will be the `job_queue` table.
- Tests for database
- Tests for the sorting
- On sorting; I did implement the sorting logic in SQL - it's probably more performant however it's about 60ish lines and would be fairly difficult t... | diff --git a/database/src/lib.rs b/database/src/lib.rs
index 90dfb87aca..7eaf60a977 100644
--- a/database/src/lib.rs
+++ b/database/src/lib.rs
@@ -799,7 +799,7 @@ pub struct ArtifactCollection {
pub end_time: DateTime<Utc>,
}
-#[derive(Debug)]
+#[derive(Debug, Clone, PartialEq)]
pub enum BenchmarkRequestStatus... | 9 | 8 | 2 | [{"id": "G0", "claim": "Rename `enqueue_master_commits` to something like `create_master_commit_requests`, because the PR uses `enqueue` for putting things into the job queue, not into `benchmark_request`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", ... | null |
rust-lang__rustc-perf__2252 | rust-lang/rustc-perf | 2,252 | defect | 0a42de6ea95dbb46b4abda1019f6418c4f6e2915 | 49a1c4b91bd8be34f2acad013dfbe21b297dfd2e | Do not use the benchmark index when computing benchmark request queue | This removes one half of the usage of the benchmark index. Now when loading the status page or computing the queue for deciding which requests to enqueue, we only load pending requests from the database, together with the information whether their parent is completed or not, and we no longer have to load all completed ... | diff --git a/database/src/lib.rs b/database/src/lib.rs
index 9633044bcd..b39b433163 100644
--- a/database/src/lib.rs
+++ b/database/src/lib.rs
@@ -1037,12 +1037,9 @@ impl BenchmarkRequest {
}
/// Cached information about benchmark requests in the DB
-/// FIXME: only store non-try requests here
pub struct Benchmark... | 2 | 1 | 0 | [{"id": "G0", "claim": "Capitalize the SQL keywords in the artifact insert query (INSERT INTO ... VALUES) for readability and consistency with the style used in the new queries.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "pre_existing"}, {"id": "G1", "claim": "The last remaining... | null |
rust-lang__rustc-perf__2257 | rust-lang/rustc-perf | 2,257 | defect | 85d4fe5ed5d372f5053f67e1a594cd598a825b49 | 3dc9baf1f0b7d51517aee14492019d886972dc7f | Fix; enqueuing a job that has already been enqueued | Fixes the error message below which happens when trying to enqueue a job that has already been enqueued. We only use the return value from this query in tests.
```
[2025-09-24T08:51:57Z ERROR site::job_queue] Cron job failed to execute: failed to insert benchmark_job
Caused by:
query returned an une... | diff --git a/database/src/pool.rs b/database/src/pool.rs
index 2eeea29794..273524c8ed 100644
--- a/database/src/pool.rs
+++ b/database/src/pool.rs
@@ -224,7 +224,7 @@ pub trait Connection: Send + Sync {
commit_date: DateTime<Utc>,
) -> anyhow::Result<()>;
- /// Add a benchmark job to the job queue an... | 1 | 1 | 0 | [{"id": "G0", "claim": "The `enqueue_benchmark_job` doc comment should still document the return value, saying it returns the job's ID if it was not already in the DB previously.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__rustc-perf__2264 | rust-lang/rustc-perf | 2,264 | defect | edb9c07cee73a97711997ddccf15ffd048bdbeb7 | 9c2f4def0db701672aa6048e2fbc96b98de16d99 | Fix; Runtime & Rustc benchmarks to run once | Adds a `kind` column to the `job_queue` for compiletime, runtime and rustc then removes those as BenchmarkSetMembers.
This is to fix running them multiple times for when jobs are created through a Cartesian product. | diff --git a/collector/src/benchmark_set/mod.rs b/collector/src/benchmark_set/mod.rs
index 337bb1f4a4..baf521accc 100644
--- a/collector/src/benchmark_set/mod.rs
+++ b/collector/src/benchmark_set/mod.rs
@@ -29,11 +29,6 @@ impl BenchmarkSetId {
pub enum BenchmarkSetMember {
/// Benchmark a specific compile-time be... | 2 | 1 | 1 | [{"id": "G0", "claim": "Enqueue the Rustc benchmark job only for LLVM on x64 and runtime benchmark jobs only for LLVM, instead of enqueuing both for every requested backend, since multiple codegen backends are not supported for either at the moment.", "category": "correctness", "verdict": "supported", "priority": "P1",... | null |
rust-lang__rustc-perf__2313 | rust-lang/rustc-perf | 2,313 | defect | 12083592e9e114a5ec6f69def7b65a2ece4b812b | 29c3b842672ce7e1c4bd0e861a4f452385c6505c | Change error handling for creating parent jobs | I missed this comment: `// This will return zero rows if the job already exists`, we used `query_one` in the parent version of the enqueue job function, which was failing if the parent job was already in the DB.
Rather than having two separate functions whose functionality can slightly diverge, I unified the logic i... | diff --git a/database/src/pool.rs b/database/src/pool.rs
index 5269be392a..daaf851179 100644
--- a/database/src/pool.rs
+++ b/database/src/pool.rs
@@ -15,6 +15,14 @@ use tokio::sync::{OwnedSemaphorePermit, Semaphore};
pub mod postgres;
pub mod sqlite;
+#[derive(Debug)]
+pub enum JobEnqueueResult {
+ JobCreated(u... | 4 | 1 | 0 | [{"id": "G0", "claim": "The error check in the new JobEnqueueResult::unwrap test helper is unnecessary, since job_queue.id is a SERIAL PRIMARY KEY and the id cannot possibly be absent.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The commit an... | null |
rust-lang__rustc-perf__2342 | rust-lang/rustc-perf | 2,342 | defect | ac90432cdefe074a52a8586957c1d75822d3a23b | 084675fb7bef05a83acd3ab7e813a97fdf43e768 | Allow for optional jobs not interfering which benchmark completion | EDIT: Original comment cleared up below.
I see a problem with this;
If a benchmark request (req1) is marked as `complete` while it still has unfinished optional jobs, and a subsequent benchmark request (req2) is marked as `in_progress`, then any optional jobs belonging to req1 will be skipped.
If this were i... | diff --git a/database/src/lib.rs b/database/src/lib.rs
index 12cc2f808f..121acf7692 100644
--- a/database/src/lib.rs
+++ b/database/src/lib.rs
@@ -1164,6 +1164,7 @@ pub struct BenchmarkJob {
status: BenchmarkJobStatus,
deque_counter: u32,
kind: BenchmarkJobKind,
+ is_optional: bool,
}
impl Benchma... | 4 | 4 | 0 | [{"id": "G0", "claim": "The PR should not prefer non-optional (mandatory) jobs over optional ones in the dequeue ORDER BY ranking, since a single collector should only ever do one kind of job.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The builder se... | null |
rust-lang__rustc-perf__2352 | rust-lang/rustc-perf | 2,352 | defect | bc7d28001d3d819370155b93a504d724c99d495c | 485921258c4bef232cffcc8f1a917725080ad0aa | Add `target` for GitHub commands | Creates `targets=<...>` functionality, defaulting to `x86_64-unknown-linux-gnu` in the database. | diff --git a/database/schema.md b/database/schema.md
index 3aaf5cfaf9..f99191006f 100644
--- a/database/schema.md
+++ b/database/schema.md
@@ -276,6 +276,7 @@ Columns:
* `completed`: Completed request.
* **backends** (`text NOT NULL`): Comma-separated list of codegen backends to benchmark. If empty, the default set... | 5 | 5 | 1 | [{"id": "G0", "claim": "The `targets` field of `BenchmarkRequest` should not be an `Option<String>`; making it a plain `String` would be consistent with how `backends` and `profiles` are handled.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The helper ... | null |
rust-lang__rustc-perf__55 | rust-lang/rustc-perf | 55 | defect | 2ee36364ed9202568726a0cca1864b73927c46d1 | c512a2b7ce3e2580a8a145b2ea7619c956ef2d0a | Declare structs for entire API in api.rs. | Excludes on_push handler due to unknown true request.
Modules for each API endpoint are created; declaring the
Request/Response relationship. Both requests and responses are
serializable and deserializable to allow tests to serialize requests.
Responses are currently never deserialized, but the derive is included
for ... | diff --git a/rs-backend/src/api.rs b/rs-backend/src/api.rs
new file mode 100644
index 0000000000..5dc61f6d50
--- /dev/null
+++ b/rs-backend/src/api.rs
@@ -0,0 +1,167 @@
+// Types implement both serialize and deserialize despite conceptually needing
+// only one for testing.
+
+pub mod summary {
+ use std::collection... | 6 | 6 | 0 | [{"id": "G0", "claim": "Add the copyright blurb to the top of the new rs-backend/src/api.rs.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The comment \"Types implement both serialize and deserialize despite conceptually needing only one for test... | null |
rust-lang__rustfmt__5205 | rust-lang/rustfmt | 5,205 | defect | 8b0b213cddb23a9bbe421b717d1a0e5fb3982712 | f975b88d946fe5bdb8a22359f1210b24bb8a193a | fallback to dir_path when relative external mod resolution fails | We only want to fall back if two conditions are met:
1) Initial module resolution is performed relative to some nested directory.
2) Module resolution fails because of a ``ModError::FileNotFound`` error.
When these conditions are met we can try to fallback to searching for the module's file relative to the ``dir... | diff --git a/src/parse/session.rs b/src/parse/session.rs
index 624fed0d2de..fb9182152d1 100644
--- a/src/parse/session.rs
+++ b/src/parse/session.rs
@@ -12,6 +12,7 @@ use rustc_span::{
use crate::config::file_lines::LineRange;
use crate::ignore_path::IgnorePathSet;
+use crate::parse::parser::{ModError, ModulePathSu... | 3 | 2 | 0 | [{"id": "G0", "claim": "The author should check how these changes handle similar open mod-resolution issues (label a-mods), since this project has a history of fixes that reintroduce other bugs.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The copied ... | null |
rust-lang__rustfmt__5243 | rust-lang/rustfmt | 5,243 | defect | 89ca3f3a100456d652b156b1a62b8e244e526c4e | b766add622a42348346bd371d7f4edbe4daab91e | Improve mod resolution error for mods with multiple candidate files | Fixes #5167
When ``a.rs`` and ``a/mod.rs`` are both present we would emit an error
message telling the user that the module couldn't be found. However,
this behavior is misleading because we're dealing with an ambiguous
module path, not a "file not found" error.
Is the file ``a.rs`` or is it ``a/mod.rs``? Rust... | diff --git a/src/modules.rs b/src/modules.rs
index 70b937b0283..da6b1e0826c 100644
--- a/src/modules.rs
+++ b/src/modules.rs
@@ -81,6 +81,7 @@ pub struct ModuleResolutionError {
pub(crate) kind: ModuleResolutionErrorKind,
}
+/// Defines variants similar to those of [rustc_expand::module::ModError]
#[derive(Deb... | 3 | 2 | 1 | [{"id": "G0", "claim": "Add a test that still triggers the file-not-found variant (easiest via a `path` attribute on the mod import pointing to a non-existent file) so the variants have consistent test coverage.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "cla... | null |
rust-lang__rustfmt__5387 | rust-lang/rustfmt | 5,387 | defect | e44380b34167ff554ca7bd6ccd446a511927e8aa | d854403d4f061b50f441bb53df81a6537a78311e | Rename `fn_args_layout` -> `fn_params_layout` | `fn_args_layout` was renamed `fn_params_layout` to better communicate that it affects the layout of parameters in function signatures and not the layout of arguments in function calls.
Because the `fn_args_layout` is a stable option the renamed option is also stable, however users who set `fn_args_layout` will get a... | diff --git a/Configurations.md b/Configurations.md
index 8c84614352c..6bb2f65be84 100644
--- a/Configurations.md
+++ b/Configurations.md
@@ -645,7 +645,7 @@ trailing whitespaces.
## `fn_args_layout`
-Control the layout of arguments in a function
+This option has been renamed to `fn_params_layout` to better communi... | 3 | 3 | 0 | [{"id": "G0", "claim": "The deprecation warning printed for `fn_args_layout` in `set_fn_args_layout` should also mention that the old option has been deprecated, as other such renames do.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The Configur... | null |
rust-lang__rustfmt__5446 | rust-lang/rustfmt | 5,446 | defect | 0cb294f05c421d6b6ef266e3ec01c2d8739194b3 | 9e3337bd33cd34b21b02d4baff10853de4977d98 | Fix/comments inside trait generics gets duplicated | # Fixes #5358
* Now the value of `comment_hi` is equals to the `generic.span.lo` if there actually are any generic parameters, otherwise it will kept the value previously defined. | diff --git a/src/items.rs b/src/items.rs
index 6ab02e7f923..a76e88b77d4 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -1084,7 +1084,11 @@ pub(crate) fn format_trait(
let item_snippet = context.snippet(item.span);
if let Some(lo) = item_snippet.find('/') {
// 1 = `{`
- ... | 1 | 1 | 0 | [{"id": "G0", "claim": "The test description should read `Test /* comment */ inside trait generics does not get duplicated` instead of `gets duplicated`.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__rustfmt__5475 | rust-lang/rustfmt | 5,475 | defect | 7432422008f8be71df989e357d949072c77e9060 | deee04a7385c1697f09f55d454d38bcbf429011a | Don't wrap comments that are part of a table | Closes #4210
This is a trivial cherry-pick of https://github.com/rust-lang/rustfmt/pull/4214 onto the new `master` branch. | diff --git a/src/comment.rs b/src/comment.rs
index 4d565afc1e0..47e2268f09b 100644
--- a/src/comment.rs
+++ b/src/comment.rs
@@ -804,7 +804,8 @@ impl<'a> CommentRewrite<'a> {
let should_wrap_comment = self.fmt.config.wrap_comments()
&& !is_markdown_header_doc_comment
&& unicode_str_wi... | 2 | 2 | 1 | [{"id": "G0", "claim": "The doc comment on is_table_item misspells \"table\" as \"talble\".", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "More test cases should be added before merging: a case with wrap_comments=false, text before the table that ... | null |
rust-lang__rustfmt__5552 | rust-lang/rustfmt | 5,552 | defect | ef91154250977b3b5d05448dafbca524a1168b47 | 934c2104dc73cac097ded2e95898263739127c02 | Handle `dyn*` syntax when rewriting `ast::TyKind::TraitObject` | Resolves #5542
Prior to rust-lang/rust#101212 the `ast::TraitObjectSyntax` enum only had two variants `Dyn` and `None`. The PR that introduced the `dyn*` syntax added a new variant `DynStar`, but did not update the formatting rules to account for the new variant.
Now the new `DynStar` variant is properly handled ... | diff --git a/src/types.rs b/src/types.rs
index 25ad587ba85..f487fbc0f5d 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -664,9 +664,11 @@ impl Rewrite for ast::Ty {
match self.kind {
ast::TyKind::TraitObject(ref bounds, tobj_syntax) => {
// we have to consider 'dyn' keyword is use... | 2 | 1 | 0 | [{"id": "G0", "claim": "Since `dyn*` is still experimental syntax, it might be better for rustfmt to return `None` for a `DynStar` trait object instead of formatting it.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The two `match tobj_syntax` expressions... | null |
rust-lang__rustfmt__5582 | rust-lang/rustfmt | 5,582 | defect | ef91154250977b3b5d05448dafbca524a1168b47 | 128133e3ee88de1d72864a2fee3502fb2ef3368b | Fix for #3805 - wrap macro that starts with nested body blocks | Fixes #3805
For wrapping macros with body block that starts with more than one `{`, i.e. starts with "nested blocks". The issue cause was that the nested block(s) `{` were not considered for calculating the remaining line width. | diff --git a/src/macros.rs b/src/macros.rs
index 1bcb7774c94..517b953201f 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -1219,7 +1219,14 @@ impl MacroBranch {
}
// 5 = " => {"
- let mut result = format_macro_args(context, self.args.clone(), shape.sub_width(5)?)?;
+ let old_body = c... | 5 | 5 | 2 | [{"id": "G0", "claim": "The prefix-width computation could be simplified by hoisting the `has_block_body` declaration up and writing `let prefix_width = if has_block_body { 6 } else { 5 };`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add tes... | null |
rust-lang__rustfmt__5798 | rust-lang/rustfmt | 5,798 | defect | 9386b32f5a72bb276a97461d33aab415314201d8 | a6437b1504a009e6599605d01462c7a7aee65544 | Don't skip semicolon if expressions follow | Fixes #5797
This changes the logic for `semicolon_for_stmt()` to only allow skipping the semicolon on the last expression
Lingering question: I'm not sure when`ast::Stmt` gets used and I don't know of a way to check the docs for `rustc_ast` (doesn't seem to be included in the docs for `cargo doc --open`?), so I ... | diff --git a/src/stmt.rs b/src/stmt.rs
index 0b3854425ea..0148de8190b 100644
--- a/src/stmt.rs
+++ b/src/stmt.rs
@@ -80,13 +80,19 @@ impl<'a> Rewrite for Stmt<'a> {
} else {
ExprType::Statement
};
- format_stmt(context, shape, self.as_ast_node(), expr_type)
+ format_stmt(
+ ... | 1 | 1 | 0 | [{"id": "G0", "claim": "The reviewer asked the author to check which places use the `impl Rewrite for ast::Stmt`, by looking at the compiler errors if the impl were removed, before extending it.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__rustfmt__5834 | rust-lang/rustfmt | 5,834 | defect | cedb7b505885f75b1e073f0a0e6c7f2ce6ce5f9b | 2289dab2c6c3fd1ec7f5d419a51f9cd8de3ede88 | Add option to control trailing zero in floating-point literals | This is my first contribution to rustfmt. Feel free to nitpick :)
Also please tell me if I did the tests right. Three separate test files seem like a lot for such a small feature, but I don't see how else I could check all configurations.
Closes #3187 | diff --git a/Configurations.md b/Configurations.md
index 78545c6187a..b795da5e993 100644
--- a/Configurations.md
+++ b/Configurations.md
@@ -1256,6 +1256,50 @@ Control the case of the letters in hexadecimal literal values
- **Possible values**: `Preserve`, `Upper`, `Lower`
- **Stable**: No (tracking issue: [#5081](ht... | 12 | 10 | 4 | [{"id": "G0", "claim": "Add an example of the Preserve case to the float_literal_trailing_zero configuration documentation.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Check whether Rust parses `2 e10` as a float literal so the implementation d... | null |
rust-lang__rustfmt__5839 | rust-lang/rustfmt | 5,839 | defect | d698bf4e1b2033245d39af85bb5876500c3fbfde | f809481ab72d0a4a0c9fb6ed5bb4bac1f78f944e | fix: reject leading `.`, `)` without prefix as item marker | fix #5835 | diff --git a/src/comment.rs b/src/comment.rs
index 85918ecc116..b0ef924646d 100644
--- a/src/comment.rs
+++ b/src/comment.rs
@@ -484,7 +484,9 @@ impl ItemizedBlock {
// allowed.
for suffix in [". ", ") "] {
if let Some((prefix, _)) = trimmed.split_once(suffix) {
- if prefix... | 4 | 3 | 2 | [{"id": "G0", "claim": "The new two-line condition is hard to grasp at a glance and should be assigned to a meaningfully named variable such as `has_leading_digits`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add the example from issue 5835 ... | null |
rust-lang__rustfmt__5845 | rust-lang/rustfmt | 5,845 | defect | e0e633ef14e85fac498ec68bf68253e8473c23c5 | 981e9ce658a1e2964c622970cd9f8a4e8f1fc46a | refactor ABI formatting | whenever we see an `extern "Rust"` on a function, we don't strip it from the function (which fixes #5701) | diff --git a/src/items.rs b/src/items.rs
index d5bc38303e0..faf4a6b0076 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -248,7 +248,6 @@ impl<'a> Item<'a> {
abi: format_extern(
ast::Extern::from_abi(fm.abi, DUMMY_SP),
config.force_explicit_abi(),
- true,
... | 1 | 1 | 1 | [{"id": "G0", "claim": "The pull request must not change the `force_explicit_abi = false` behavior: rustfmt should keep stripping explicit `extern \"C\"` rather than preserving or adding it, since that is the documented behavior of a stable option that cannot change outside a style edition boundary (otherwise the chang... | null |
rust-lang__rustfmt__5848 | rust-lang/rustfmt | 5,848 | defect | c6d39a22590d7ad3a77a0332c039a498cbda1312 | 8c21f1ac0e35e2672ac87184537dc30f8446f03b | Support non-lifetime binders | Makes it so we stop yeeting non-lifetime binders into the void. Rustfmt already generally supports formatting `ast::GenericParam` anyways, so this just is piggybacking on that formatting.
Fixes #5721 | diff --git a/src/closures.rs b/src/closures.rs
index c95e9a97b43..cf128752919 100644
--- a/src/closures.rs
+++ b/src/closures.rs
@@ -12,7 +12,7 @@ use crate::overflow::OverflowableItem;
use crate::rewrite::{Rewrite, RewriteContext};
use crate::shape::Shape;
use crate::source_map::SpanUtils;
-use crate::types::rewrit... | 4 | 3 | 0 | [{"id": "G0", "claim": "The PR should add test cases covering the other syntax positions where non-lifetime binders can show up, i.e. in `dyn for<T> ..` and `for<T> fn(..)`.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The PR should add a test case fo... | null |
rust-lang__rustfmt__5902 | rust-lang/rustfmt | 5,902 | defect | b6367235ebb7e009faa7c5bfa017c99de11c6381 | 5295d9f669b2ac941c1bf386d3c35376144ef003 | Fix checking if newline is needed before `else` in let-else statement | Fixes #5901 | diff --git a/src/items.rs b/src/items.rs
index 4d82e192b7d..0018c113080 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -75,6 +75,7 @@ impl Rewrite for ast::Local {
false,
)?
};
+ let let_kw_offset = result.len() - "let ".len();
// 4 = "let ".len()
let p... | 6 | 6 | 3 | [{"id": "G0", "claim": "Comments between the attributes and a let-else statement are not handled when checking whether a newline is needed before `else`, so `else` gets wrongly moved onto its own line (demonstrated by M003 for a line comment; M001 also asks about a block comment).", "category": "correctness", "verdict"... | null |
rust-lang__rustfmt__5913 | rust-lang/rustfmt | 5,913 | defect | da7f67810f263351f61f5618c250f7396a5f9bbc | 09ff9b46c9429398d08b5252f9bd8d517e8ff6e1 | Bugfix/comment duplication | Fixes #5871
The issue was in the `rewrite_paren` function.
Since the span on expressions doesn't include attributes and attributes comes before the expression, this caused the attribute to be included in `pre_comment` since the end of the comment span was `subexpr.span.lo()`.
I changed the logic to use the spa... | diff --git a/src/expr.rs b/src/expr.rs
index 450f1476db0..1a49bceca91 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -1453,7 +1453,11 @@ pub(crate) fn rewrite_paren(
let remove_nested_parens = context.config.remove_nested_parens();
loop {
// 1 = "(" or ")"
- pre_span = mk_sp(span.lo() + BytePos... | 1 | 1 | 0 | [{"id": "G0", "claim": "The pull request should reuse the existing `Spanned::span()` utility instead of hand-rolling the attr-aware start position, replacing the inline `expr_lo` computation with `subexpr.span().lo()` as suggested.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "int... | null |
rust-lang__rustfmt__6073 | rust-lang/rustfmt | 6,073 | defect | ead0fc9529ef787bc0e3f7f1b92dccd00cf45915 | d0c780f508ca8c146ed3764e7b5282c6172eb2cb | Fix #6069 | Fixes #6069. @ytmimi | diff --git a/src/items.rs b/src/items.rs
index 8669bdda32b..83b496a7ed7 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -1165,10 +1165,10 @@ pub(crate) fn format_trait(
result.push_str(&generics_str);
// FIXME(#2055): rustfmt fails to format when there are comments between trait bounds.
+ // Retrieve *un... | 2 | 2 | 0 | [{"id": "G0", "claim": "Define `source_ident` inside the `if`-block instead of outside it, closer to where it is used, so it does not sit under and blur the FIXME(#2055) comment.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add an explanatory comment a... | null |
rust-lang__rustfmt__6092 | rust-lang/rustfmt | 6,092 | defect | 21f353a6373126035f9063780bdccb9dd191a2bb | 0b73d9e6492ed7885570bbcb06f69989c70d4552 | Fix failure with `=>` in comment after match `=>` | Fixes #5998
## Background
(1) Comment without arrow `=>`
```rust
fn main() {
match a {
_ =>
// comment with ==
{
println!("A")
}
}
}
```
(2) Comment without arrow `=>`
```rust
fn main() {
match a {
_ =>
// comment with... | diff --git a/src/matches.rs b/src/matches.rs
index 5e36d9e857d..478a76e5d11 100644
--- a/src/matches.rs
+++ b/src/matches.rs
@@ -402,7 +402,16 @@ fn rewrite_match_body(
let arrow_snippet = context.snippet(arrow_span).trim();
// search for the arrow starting from the end of the snippet since there may ... | 2 | 2 | 0 | [{"id": "G0", "claim": "rustfmt already has a `find_last_uncommented` method (the `FindUncommented` trait implemented for `str`); the PR's hand-rolled search for a `=>` outside a single-line comment should be simplified to use it.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"},... | null |
rust-lang__rustfmt__6154 | rust-lang/rustfmt | 6,154 | defect | f781b1b9d34e169a1959feaa79d6cb453dd20aee | b0bda7953801af26d1205f014448eebe77227e0b | Remove lazy_static dependency | Split off from rust-lang/rust#124475. The functionality of the `lazy_static` crate is now available in the standard library as `OnceLock`. Rustfmt can now use this directly and drop the dependency. | diff --git a/Cargo.lock b/Cargo.lock
index 97d3fb48a07..b5032945e7e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -541,7 +541,6 @@ dependencies = [
"getopts",
"ignore",
"itertools",
- "lazy_static",
"regex",
"rustfmt-config_proc_macro",
"serde",
diff --git a/Cargo.toml b/Cargo.toml
index 043c9176a7c..c98200c2... | 3 | 2 | 0 | [{"id": "G0", "claim": "In configuration_snippet.rs, keep referring to the two configuration regexes by name (named bindings like config_name_regex/config_value_regex) instead of defining them inline with the static_regex! macro at each capture site.", "category": "maintainability", "verdict": "supported", "priority": ... | null |
rust-lang__rustfmt__6173 | rust-lang/rustfmt | 6,173 | defect | d5f1200ed6a8e375f963e0c59a8bee45c0018c55 | ce7d05598c8762a7fd045ee8946c4a66e98615a3 | Fix: rustfmt should not remove inner attributes from inline const blocks | fixes #6158
`cargo test` 0 failed
first time contributed on this project🥳
| diff --git a/src/expr.rs b/src/expr.rs
index 6a21d88ac9d..8f00a995f7e 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -3,7 +3,7 @@ use std::cmp::min;
use itertools::Itertools;
use rustc_ast::token::{Delimiter, Lit, LitKind};
-use rustc_ast::{ast, ptr, token, ForLoopKind};
+use rustc_ast::{ast, ptr, token, ForLoopKind... | 2 | 2 | 0 | [{"id": "G0", "claim": "The `HasAttrs` trait import can be avoided by accessing the `expr.attrs` field instead of calling `expr.attrs()`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The duplicated `Some(format!(\"const {}\"))` code in both br... | null |
rust-lang__rustfmt__6187 | rust-lang/rustfmt | 6,187 | defect | c97996fab61fc09432abcf64dbe3ce2d84f4d679 | e428b989840867e42486a2ae49ed59a6ba12b215 | Add repo cloning to check-diff crate | TLDR: Added repo cloning to check-diff. Included sample execution as screenshot.
This PR adds git functionalities to the `check-diff` crate. The current script has a `init_submodules` function. However, it seems that the repos used does not require initialising of submodules. Hence, this function was not converted... | diff --git a/check_diff/src/main.rs b/check_diff/src/main.rs
index 6d07c1b0df6..0f64b6216f2 100644
--- a/check_diff/src/main.rs
+++ b/check_diff/src/main.rs
@@ -1,4 +1,9 @@
use clap::Parser;
+use std::env;
+use std::io::{self, Write};
+use std::path::Path;
+use std::process::Command;
+
/// Inputs for the check_diff s... | 4 | 4 | 2 | [{"id": "G0", "claim": "clone_git_repo should take a strongly typed destination (PathBuf/&Path/AsRef<Path>) instead of a string, return a Result so callers know whether the clone succeeded, and not be responsible for both cloning the repo and cd-ing into it.", "category": "design", "verdict": "supported", "priority": "... | null |
rust-lang__rustfmt__6320 | rust-lang/rustfmt | 6,320 | defect | 182a20378b3a844e3677ff93d96f8ac70b9f009a | bd5873ae1206127011d7d4918d51ffeab5ce4ac0 | subtree-push nightly-2024-09-10 | Bumping the toolchain version as part of a git subtree push
current toolchain (nightly-2024-08-17):
- 1.82.0-nightly (506052d49 2024-08-16)
latest toolchain (nightly-2024-09-10):
- 1.83.0-nightly (c2f74c3f9 2024-09-09)
r? @calebcartwright | diff --git a/rust-toolchain b/rust-toolchain
index 7b7081bfe81..80723123274 100644
--- a/rust-toolchain
+++ b/rust-toolchain
@@ -1,3 +1,3 @@
[toolchain]
-channel = "nightly-2024-08-17"
+channel = "nightly-2024-09-10"
components = ["llvm-tools", "rustc-dev"]
diff --git a/src/attr.rs b/src/attr.rs
index ac57858ef7e..5c... | 1 | 1 | 0 | [{"id": "G0", "claim": "The commented-out `#[macro_use]` / `extern crate tracing;` lines added in src/lib.rs should be removed rather than left commented out.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__rustfmt__6375 | rust-lang/rustfmt | 6,375 | defect | 96cc01b197f50eeb657128946d02b8f61da2d12d | c07bb2591f56a0e7784f529a2b0d4321b914d281 | repair Ord for UseSegment | Fixes https://github.com/rust-lang/rustfmt/issues/6333
Ord for UseSegment was not Transitive, causing `user-provided comparison function does not correctly implement a total order` panic.
e.g. for
let A = DafnyType
let B = _System
let C = truncate
A < B
B < C
but
A > C
| diff --git a/src/imports.rs b/src/imports.rs
index b741dd9b5da..52b6e057a83 100644
--- a/src/imports.rs
+++ b/src/imports.rs
@@ -943,10 +943,10 @@ impl Ord for UseSegment {
version_sort(ia, ib)
} else {
// snake_case < CamelCase < UPPER_SNAKE_CASE
- ... | 3 | 3 | 2 | [{"id": "G0", "claim": "The change may alter the current sort behaviour for segments that do not begin with a letter, no existing test case covers the new behaviour, and a test case should be added, especially for cases where the new sort behaviour differs from what rustfmt used to produce.", "category": "testing", "ve... | null |
rust-lang__rustfmt__6407 | rust-lang/rustfmt | 6,407 | defect | 0a32a02c5913e853863c5484126075fcb14e0f9f | 334a9174b9e50baf5e0d5824bb14b0e5f1bb8fb3 | fix versionsort chunk split on non-ASCII numerics | ## Description
Fixes a bug with 2024 Edition versionsort, where a string chunk will split on _all_ numeric characters. For example, this would cause imports containing non-ASCII numeric characters to be incorrectly sorted.
Unformatted ([Playground link](https://play.rust-lang.org/?version=nightly&mode=debug&editi... | diff --git a/src/sort.rs b/src/sort.rs
index 670f664a119..0cdd937b4f5 100644
--- a/src/sort.rs
+++ b/src/sort.rs
@@ -65,7 +65,7 @@ impl<'a> VersionChunkIter<'a> {
break;
}
- if !c.is_numeric() {
+ if !c.is_ascii_digit() {
continue;
}
... | 3 | 3 | 2 | [{"id": "G0", "claim": "The new test file should keep only its imports, dropping the fn main bodies, println! calls and module functions, while keeping the explanatory comments about '๙', '0' and 'é'.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The t... | null |
rust-lang__rustfmt__6417 | rust-lang/rustfmt | 6,417 | defect | 8a2c07398845420d7951d2f4e83d5f97c4df0875 | 49800992f787279ba3f62734878d0d07e35c22a5 | fix: wrap_comments creating invalid code blocks | Fixes https://github.com/rust-lang/rustfmt/issues/5244
This PR fixes the issue in ~#6416~ (duplicate of https://github.com/rust-lang/rustfmt/issues/5244), I have added both the before and after case of the formatting in `tests/`.
Edit (ytmimi): I updated the description | diff --git a/src/comment.rs b/src/comment.rs
index b7d7a396a67..709031dda44 100644
--- a/src/comment.rs
+++ b/src/comment.rs
@@ -885,6 +885,9 @@ impl<'a> CommentRewrite<'a> {
// Remove space if this is an empty comment or a doc comment.
self.result.pop();
}
+ if... | 2 | 2 | 2 | [{"id": "G0", "claim": "The input from https://github.com/rust-lang/rustfmt/issues/5244 should also be added as a test case, in addition to the tests already in the pull request.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "rustfmt definitely shouldn'... | null |
rust-lang__rustfmt__6457 | rust-lang/rustfmt | 6,457 | defect | 6f7aeed799a764bb22d3cfc5bd4ea56c1ead274b | 2cf961ace71ac0a51720118eebc49724207bc2b8 | Reapply "Initial work on formatting headers" | As per [this comment](https://github.com/rust-lang/rustfmt/pull/6115#issuecomment-1997793358).
This reimplements the header formatting infrastructure to resume porting to this system, if there are comments between header parts, we preserve the original whitespace/comments snippet instead of realigning/reformatting t... | diff --git a/src/header.rs b/src/header.rs
new file mode 100644
index 00000000000..b7604114acd
--- /dev/null
+++ b/src/header.rs
@@ -0,0 +1,111 @@
+//! headers are sets of consecutive keywords and tokens, such as
+//! `pub const unsafe fn foo` and `pub(crate) unsafe trait Bar`.
+//!
+//! This module contains general lo... | 3 | 2 | 0 | [{"id": "G0", "claim": "The `snippet` field should not need to be a `Cow<'static, str>`; make `HeaderPart` hold a `Cow<'a, str>` if lifetimes allow it.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "`HeaderPart::ident` should be implemented in terms of `... | null |
rust-lang__rustfmt__6468 | rust-lang/rustfmt | 6,468 | defect | 054efddd0f388c536aee1402abb1c3277b68da2f | 2b886890a84ee1461d59c10a57edfe15dd48e720 | labels on the closure body block can be disappearing | Fixes #6465
This PR also adds many test cases for labels on the closure body block. | diff --git a/src/closures.rs b/src/closures.rs
index 1f59fbc2960..8dc4bc867a1 100644
--- a/src/closures.rs
+++ b/src/closures.rs
@@ -1,4 +1,4 @@
-use rustc_ast::{ast, ptr};
+use rustc_ast::{Label, ast, ptr};
use rustc_span::Span;
use thin_vec::thin_vec;
use tracing::debug;
@@ -55,7 +55,7 @@ pub(crate) fn rewrite_clo... | 3 | 3 | 0 | [{"id": "G0", "claim": "Instead of passing only the label to rewrite_closure_block, pass the entire body expression, since the Block rewrite code already handles labels.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The added helper functions and macro ... | null |
rust-lang__rustfmt__6492 | rust-lang/rustfmt | 6,492 | defect | c6c8159bbc0a34b921429a57bfaffa7202468625 | 75e196ed1ee0dc807b9c57c7c0ca2f08bf734f55 | Allow also allow literals as first item of single line let chain | Also allow literals as the first item in a single line let chain, not just idents. This will most probably not occur in most real-world code, but it makes things a little bit more consistent. While rustfmt allows any literal type, like also string literals, those will not create valid rust code. Only bool literals will... | diff --git a/src/pairs.rs b/src/pairs.rs
index c50b44755b2..c4b4b7a4737 100644
--- a/src/pairs.rs
+++ b/src/pairs.rs
@@ -266,13 +266,14 @@ struct PairList<'a, 'b, T: Rewrite> {
span: Span,
}
-fn is_ident(expr: &ast::Expr) -> bool {
+fn is_ident_or_lit(expr: &ast::Expr) -> bool {
match &expr.kind {
... | 2 | 1 | 1 | [{"id": "G0", "claim": "The new code should be more explicit that only bool literals may be the first item of a single-line let chain: make the match arm explicit for bool literals and rename `is_ident_or_lit` (e.g. to `is_ident_or_bool_lit`) instead of accepting any literal via `ast::ExprKind::Lit(_)`.", "category": "... | null |
rust-lang__rustfmt__6525 | rust-lang/rustfmt | 6,525 | defect | ee329d33c896da13ae5b08fe6d31724108cbdfcb | 85d2403d6dd86a5414eaf61eef02b7ead037e977 | Add `match_arm_indent` option | Allows to disable the indentation of match arms.
Related issue: #2937 | diff --git a/Configurations.md b/Configurations.md
index 67debec1ddb..795f2af5260 100644
--- a/Configurations.md
+++ b/Configurations.md
@@ -1862,6 +1862,42 @@ fn foo() {
}
```
+## `match_arm_indent`
+
+Controls whether match arms are indented. If disabled, the match patterns will be located on the indentation lev... | 7 | 7 | 0 | [{"id": "G0", "claim": "Revert the trailing-whitespace-only change to the array-width paragraph in Configurations.md since it is unrelated to the match_arm_indent feature.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Instead of adding another ... | null |
rust-lang__rustfmt__6573 | rust-lang/rustfmt | 6,573 | defect | 1443bbac932296a1a5b336a56c31acbf2b238fcd | 831c2bdc67ac3ef6a6d5028288745140a458af75 | fix: #6558 don't try to repair invalid self-imports. | Fix #6558
Current attempts break idempotence.
As the tests show, paths ending with `self` are now untouched, this PR just removes some code (and adds/modifies some tests).
A potential change here would be to keep this part of the code:
```rust
UseSegmentKind::Slf(None) if self.path.is_empty() && self.visib... | diff --git a/src/imports.rs b/src/imports.rs
index cfc2f3bda19..78aa3e5c49f 100644
--- a/src/imports.rs
+++ b/src/imports.rs
@@ -557,20 +557,9 @@ impl UseTree {
self.path = vec![];
return self;
}
- UseSegmentKind::Slf(None) if self.path.is_empty() && self.visibi... | 1 | 1 | 1 | [{"id": "G0", "claim": "The pull request should still normalize `foo::self` -> `foo` (and keep removing `use self;`), special-casing only the stacked `self::self` case so the behavior stays idempotent, rather than dropping the self normalization logic entirely.", "category": "design", "verdict": "supported", "priority"... | null |
rust-lang__rustfmt__6783 | rust-lang/rustfmt | 6,783 | defect | 2d2bb530c9b162dc7cc934dc0e5f28017473edd8 | 55cceb6afd544377296f090d7d160649055aa546 | Check files in parallel with crossbeam | This improves on the current diff check process. It's more efficient to process each file in parallel instead of processing each repo in parallel. Also, a new `worker_threads` option was added to control how many threads we want processing files at the same time.
I tried to break this PR up into logical commits so i... | diff --git a/check_diff/Cargo.lock b/check_diff/Cargo.lock
index 95bdd32567b..e8314b40714 100644
--- a/check_diff/Cargo.lock
+++ b/check_diff/Cargo.lock
@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
-version = 3
+version = 4
[[package]]
name = "aho-cora... | 1 | 1 | 0 | [{"id": "G0", "claim": "The new worker_threads CLI default of 20 should maybe be 16, a more common (multiple of) core count, though it is overridable.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__rustfmt__6784 | rust-lang/rustfmt | 6,784 | defect | 2d2bb530c9b162dc7cc934dc0e5f28017473edd8 | a52c49b9994f8c359befdc50ed1f592802bff962 | Do not merge top-level modules with imports_granularity Module | Fixes https://github.com/rust-lang/rustfmt/issues/6191 . | diff --git a/Configurations.md b/Configurations.md
index c6bcd29927c..45a8b1eba87 100644
--- a/Configurations.md
+++ b/Configurations.md
@@ -2012,6 +2012,7 @@ use qux::{h, i};
#### `Module`:
Merge imports from the same module into a single `use` statement. Conversely, imports from different modules are split into s... | 3 | 2 | 0 | [{"id": "G0", "claim": "The module_prefix helper should have a comment better explaining its logic.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The test file should add the example from rust-lang/rustfmt#6191 — the already-merged top-level impo... | null |
rust-lang__rustfmt__6786 | rust-lang/rustfmt | 6,786 | defect | 2d2bb530c9b162dc7cc934dc0e5f28017473edd8 | 37baf6189e4591f2ac48d7d24a213c67cf94be0d | Fix `use` <2024 identifier sorting transitivity | The sorting tries to create a lowercase>Capital>SCREAMING relation, but does this in a way that causes non-transitive behavior for identifiers starting with `_`. These identifiers are neither Capital nor SCREAMING so they are always compared via lexicographic ASCII matching.
This causes a problem, because `A < _ < a... | diff --git a/src/imports.rs b/src/imports.rs
index f0797516b15..0a224251b4b 100644
--- a/src/imports.rs
+++ b/src/imports.rs
@@ -945,20 +945,16 @@ impl Ord for UseSegment {
let ident_ord = if self.style_edition >= StyleEdition::Edition2024 {
version_sort(ia, ib)
} ... | 2 | 2 | 0 | [{"id": "G0", "claim": "The new test file should also explicitly set `// rustfmt-style_edition: 2021` in addition to `// rustfmt-edition: 2021`.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "It would be nice to add a test case that uses `// rustfmt-edi... | null |
rust-lang__rustfmt__6798 | rust-lang/rustfmt | 6,798 | defect | 53e39cceb48b5e42cbde66162895b6a2148be959 | 50dd8b52fe73bb82d319f4880b6b9b8d5e383770 | fix: properly wrap long `impl trait` function parameters | Fixes #6381
Before we weren't taking the length of `impl ` into account so the trait thought it had more room than it actually did to format itself on a single line. | diff --git a/src/types.rs b/src/types.rs
index 76f176c97c4..4602062f027 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -1016,9 +1016,14 @@ impl Rewrite for ast::Ty {
}
let rw = if context.config.style_edition() <= StyleEdition::Edition2021 {
it.rewrite_result(cont... | 1 | 1 | 0 | [{"id": "G0", "claim": "The magic number 5 passed to offset_left should be written as the expression \"impl \".len() (or .chars().count()) instead of a bare literal plus comment, though the reviewer notes the comment also works.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introd... | null |
rust-lang__rustfmt__6840 | rust-lang/rustfmt | 6,840 | defect | bdab1017c6bf9291654fa5cd15163d011c8194b6 | 756e67c4e905186e9016753977acae8ca7d7695d | fixed formatting of commented single param in 2024 edition | Fixes #6825
- Reordered closing `)` overflow check and last line comment check
- Added regression test | diff --git a/src/items.rs b/src/items.rs
index 775c763e0bd..a2c0e8e0f50 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -2586,13 +2586,13 @@ fn rewrite_fn_base(
.map_or(false, |last_line| last_line.contains("//"));
if context.config.style_edition() >= StyleEdition::Edition2024 {
- if ... | 2 | 2 | 0 | [{"id": "G0", "claim": "Remove the tests/config/issue-6825.toml config file in favor of an inline configuration comment for the test.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add `// rustfmt-edition: 2024` to the top of the test source and... | null |
rust-lang__rustfmt__6855 | rust-lang/rustfmt | 6,855 | defect | 1faf40273eb16f42da0f5e76f635f5348feca914 | 5b938cb6d751d34edfbda6907d9431ee63663bb1 | Rustify `ci/build_and_test.*` scripts | Follow-up of #6817.
I merged both scripts so they are both part of `ci/ci-integration` rust binary. To pick which one to run, you need to pass either `integration` or `build-and-test` command line argument. In the same way, I replaced the `INTEGRATION` environment variable with a command line argument.
cc @jieyou... | diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index a0760d27e2e..aec77f88e49 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -74,7 +74,6 @@ jobs:
- name: run integration tests
env:
- INTEGRATION: ${{ matrix.integration }... | 5 | 1 | 1 | [{"id": "G0", "claim": "The Windows CI `build-and-test` run errors out during the first `cargo build`, apparently because building with a different environment triggers a rebuild of the running `ci-integration.exe`, which the build then fails to replace.", "category": "correctness", "verdict": "supported", "priority": ... | null |
rust-lang__rustlings__1151 | rust-lang/rustlings | 1,151 | defect | d0c7b06eff3e8959b261145e10f1aaa57ba1e4c3 | 0aff5340b5e225b394ac0fdf496824eaa201e19c | Add reset command for a given filename | Closes: #1031
**Changelog**
- Add `reset` command
**How to test**
1. `cargo build`
2. Do some changes to a file, for instance `intro2.rs`
3. `cargo run reset intro2`
4. Observe that only `exercises/intro/intro2.rs` was stashed | diff --git a/src/main.rs b/src/main.rs
index 531533ea39..3610f82736 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,7 +1,10 @@
-use crate::exercise::{Exercise, ExerciseList};
use crate::project::RustAnalyzerProject;
use crate::run::run;
use crate::verify::verify;
+use crate::{
+ exercise::{Exercise, ExerciseList... | 2 | 2 | 0 | [{"id": "G0", "claim": "The imports should be reorganised so that `run` and `reset` are combined into a single `use crate::run::{run, reset};` line near the top instead of the multi-line `use crate::{...}` block.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "... | null |
rust-lang__rustlings__1463 | rust-lang/rustlings | 1,463 | defect | 01fa21f160fdc32aca6396506f3774189feee0f3 | 27b75795666cddd3725c323cbc0b68b206fc150e | feat: add tests4.rs exercise | Added task which teach how to test function that panics
issue #1409 | diff --git a/exercises/tests/tests4.rs b/exercises/tests/tests4.rs
new file mode 100644
index 0000000000..2d8dd1300b
--- /dev/null
+++ b/exercises/tests/tests4.rs
@@ -0,0 +1,40 @@
+// tests4.rs
+// Correct the tests to
+// Do not change Rectangle::new body
+// Execute `rustlings hint tests4` or use the `hint` watch sub... | 6 | 6 | 0 | [{"id": "G0", "claim": "The hint's second sentence should read \"To handle that you need to add a special attribute to the test function.\" (missing articles).", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The hint should link to the specific `#[... | null |
rust-lang__rustlings__422 | rust-lang/rustlings | 422 | defect | 0dd1c6ca6b389789e0972aa955fe17aa15c95f29 | 8ad5f9bf531a4848b1104b7b389a20171624c82f | Show tests prints | This new feature can be accessed by invoking rustlings with `--nocapture`.
closes #262
**_MINOR CHANGES_**:
* Documentation added to source code under [`src`](https://github.com/rust-lang/rustlings/tree/master/src)
* Both unit and integration tests for `--nocapture` have been added.
**_BREAKING CHANG... | diff --git a/info.toml b/info.toml
index 2c871ad28e..2f0884c67f 100644
--- a/info.toml
+++ b/info.toml
@@ -802,7 +802,7 @@ name = "try_from_into"
path = "exercises/conversions/try_from_into.rs"
mode = "test"
hint = """
-Follow the steps provided right before the `From` implementation.
+Follow the steps provided righ... | 1 | 1 | 0 | [{"id": "G0", "claim": "Exercise output handling should be more sophisticated, ideally showing stdout and stderr merged as they would appear on a terminal screen, though the reviewer himself marks it out of scope.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
rust-lang__rustup__2916 | rust-lang/rustup | 2,916 | defect | 6c33197f26d759381f6164be933ce1f1b446daf3 | a850150b4a38d3b7d4938561e5c2d2f94004303f | Provide a more actionable error message when a toolchain is not selected | Fixes #2915. This is my first time dealing with the rustup codebase, so please be gentle. | diff --git a/src/bin/rustup-init.rs b/src/bin/rustup-init.rs
index 0cefd7bd0a2..0991d45467a 100644
--- a/src/bin/rustup-init.rs
+++ b/src/bin/rustup-init.rs
@@ -13,8 +13,6 @@
#![recursion_limit = "1024"]
-use std::path::PathBuf;
-
use anyhow::{anyhow, Result};
use cfg_if::cfg_if;
use rs_tracing::*;
@@ -62,18 +6... | 5 | 5 | 0 | [{"id": "G0", "claim": "The new error message might be too long, and the author could not work out what to cut while preserving the important parts.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The error message should state the state rather than assig... | null |
rust-lang__rustup__3453 | rust-lang/rustup | 3,453 | defect | 94d98a4ff0a3315babdbed1673efa3604503c9c2 | b9d70eb6233a8b18e6752926552ec2d37352820f | Refine suggestions about missing components | Closes #3418. I also cleaned up the current code a bit along the way.
cc #2355 | diff --git a/src/dist/manifestation.rs b/src/dist/manifestation.rs
index fa2e5c92b20..3299304006e 100644
--- a/src/dist/manifestation.rs
+++ b/src/dist/manifestation.rs
@@ -126,23 +126,19 @@ impl Manifestation {
}
// Validate that the requested components are available
- match update.unavaila... | 4 | 4 | 2 | [{"id": "G0", "claim": "Add a doc comment to `component_unavailable_msg` warning that it panics when called with an empty collection of unavailable components.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The changed error-message behaviour ship... | null |
rust-lang__rustup__3673 | rust-lang/rustup | 3,673 | defect | 4f29ff801d613c2742904d7c3272a93d23347577 | 2cdea96ec18e240fe9b29a967ea1507d2f7a3a60 | Fix ambiguous "Proceed with installation" prompt | Changed test and prompt of default prompt in stdout.
Fix #3429 | diff --git a/src/cli/common.rs b/src/cli/common.rs
index 20cbe7d1e16..427c7404821 100644
--- a/src/cli/common.rs
+++ b/src/cli/common.rs
@@ -56,12 +56,18 @@ pub(crate) enum Confirm {
Advanced,
}
-pub(crate) fn confirm_advanced() -> Result<Confirm> {
+pub(crate) fn confirm_advanced(customised_install: &bool) -> ... | 4 | 4 | 0 | [{"id": "G0", "claim": "Omit the unnecessary type annotation on `customised_install` and rename it to `customized_install` to match US English convention.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Avoid the extra prompt line (`one_prompt`) ... | null |
rust-lang__rustup__3703 | rust-lang/rustup | 3,703 | defect | bbb9276d24519f8684cd616b2e46b7596f7dd891 | 8dc8a39f6dd61ff470aa4ddd3ed039a74247bbfa | Change default for RUSTUP_WINDOWS_PATH_ADD_BIN | This changes the default for the RUSTUP_WINDOWS_PATH_ADD_BIN opt-in to fix the issue where adding the `bin` directory on windows was preventing recursive calls to programs like cargo from being able to use the rustup proxies.
There was a call for testing at https://internals.rust-lang.org/t/help-test-windows-behavio... | diff --git a/src/toolchain/toolchain.rs b/src/toolchain/toolchain.rs
index e666041f992..0cab634cd5d 100644
--- a/src/toolchain/toolchain.rs
+++ b/src/toolchain/toolchain.rs
@@ -165,7 +165,7 @@ impl<'a> Toolchain<'a> {
}
if cfg!(target_os = "windows") {
- // Historically rustup has include... | 2 | 2 | 1 | [{"id": "G0", "claim": "The added comment line has a double space in \"rustup included\".", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "cwfitzgerald reports that the change seems to have broken cargo-nextest whenever proc-macro crates are in t... | null |
rust-lang__rustup__3724 | rust-lang/rustup | 3,724 | defect | 6e8769c768990c72678de0f6fe092030474ccbcf | 367c5dfd9d23493b6b725df4e41dc82b5f8218a8 | Fix "component add" error message | Fixes #3721 (cc: @rami3l) | diff --git a/src/toolchain/distributable.rs b/src/toolchain/distributable.rs
index a22b026739f..4920f2faeec 100644
--- a/src/toolchain/distributable.rs
+++ b/src/toolchain/distributable.rs
@@ -439,8 +439,8 @@ impl<'a> DistributableToolchain<'a> {
} else {
// available, not installed, recom... | 1 | 1 | 0 | [{"id": "G0", "claim": "The new test should invoke the documented command `rustup toolchain install nightly` instead of the hidden `rustup install` alias, since the hidden alias's behavior could break in the future.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__rustup__3742 | rust-lang/rustup | 3,742 | defect | 0c501d55c54031a992395078d535b6d2574dc693 | ba6b5d0603ec6396e760a0cba96618a130504aaa | fix(utils): don't use `O_NOFOLLOW` in `open_dir()` | Fixes #3737.
For more context on this particular approach, see https://github.com/rust-lang/rustup/issues/3737#issuecomment-2021842441.
## Concerns
- [x] Testing: can we bake a smoke test to prevent regression? | diff --git a/src/utils/raw.rs b/src/utils/raw.rs
index e4cea9083b..be50dfd585 100644
--- a/src/utils/raw.rs
+++ b/src/utils/raw.rs
@@ -45,11 +45,9 @@ pub fn open_dir(p: &Path) -> std::io::Result<File> {
#[cfg(not(windows))]
pub fn open_dir(p: &Path) -> std::io::Result<File> {
use std::fs::OpenOptions;
- use s... | 2 | 2 | 2 | [{"id": "G0", "claim": "Removing `O_NOFOLLOW` from the Unix `open_dir()` without an explanation may have security implications, and it should be made clear why the code was there in the first place.", "category": "security", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The co... | null |
rust-lang__rustup__3754 | rust-lang/rustup | 3,754 | defect | 3f572994fc42e23760e40fd3baadfd935a5585ef | a267f6f99d1454b80f0e6871b1611a2a8a0cd05d | fix(utils): resolve input path in `delete_dir_contents()` if it's a link | Closes #3344, superseding #3452:
> A better fix is to resolve the link in the calling code and then use remove_dir_contents as before.
_https://github.com/rust-lang/rustup/pull/3753#issue-2218949990_ | diff --git a/src/utils/utils.rs b/src/utils/utils.rs
index e4d7e9adb9..44764255fd 100644
--- a/src/utils/utils.rs
+++ b/src/utils/utils.rs
@@ -611,7 +611,9 @@ where
}
pub(crate) fn delete_dir_contents(dir_path: &Path) {
- match remove_dir_all::remove_dir_contents(dir_path) {
+ use remove_dir_all::RemoveDir;
+... | 2 | 1 | 0 | [{"id": "G0", "claim": "The #[cfg(any(unix, windows))] attribute on the new test may be unnecessary because the condition could be equivalent to all platforms.", "category": "maintainability", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The function (or a non-following variant... | null |
rust-lang__rustup__3770 | rust-lang/rustup | 3,770 | defect | 67b34f075827a2793bbae554ceb1b72654a9e581 | aaabd1211ab0a3039bf1af13cb18d8109b2f9dbf | fix(windows): update `DisplayVersion` on `rustup self update` | Closes #3739.
My daily driver is a Mac (and OpenSSL refuses to cross-build here) so this is pretty much a best-effort blind fix.
cc @ChrisDenton
## Concerns
- [x] ~~Is it necessary to add a test case for this one? If so, how? (Considering the sandboxing requirements, doing this properly might be hard.)~~ A... | diff --git a/src/cli/self_update.rs b/src/cli/self_update.rs
index a868da86ce1..a53d40df90d 100644
--- a/src/cli/self_update.rs
+++ b/src/cli/self_update.rs
@@ -1099,12 +1099,9 @@ pub(crate) fn update(cfg: &Cfg) -> Result<utils::ExitCode> {
match prepare_update()? {
Some(setup_path) => {
- le... | 4 | 3 | 0 | [{"id": "G0", "claim": "Failure to get the new rustup version in `run_update()` should perhaps be a warning rather than an error, since updating `DisplayVersion` is not technically critical to the update process.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "cla... | null |
rust-lang__rustup__3841 | rust-lang/rustup | 3,841 | defect | 2a5a69e0914ff419554d684ca71eb1d72c72bcb3 | 980a552268f5714afe2730485d111173f8995e9f | fix(dist/triple): ensure `dist::triple::known` is up to date with `platforms` | Closes #3783.
By introducing [`platforms`](https://github.com/rustsec/rustsec/tree/main/platforms) as a new dependency, this PR tries to address both the problems that come with generated source files within `src`, as well as the issue that the list of known target triples is a moving target:
- Since `build.rs` alr... | diff --git a/Cargo.lock b/Cargo.lock
index e1b4615daa..7da5bd3f5a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1581,6 +1581,12 @@ version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
+[[package]]
+name = "pl... | 3 | 2 | 1 | [{"id": "G0", "claim": "Don't generate and include the known-triples lists via OUT_DIR in build.rs because it makes things less visible; generate them in an integration test instead (with #[ignore] if CI must not run it).", "category": "maintainability", "verdict": "supported", "priority": "P1", "scope": "introduced"},... | null |
rust-lang__rustup__3892 | rust-lang/rustup | 3,892 | defect | b46ef15b96c3d03ee8243d68a45576903e22481e | 64903ffa19059ad89508b92435b16cd8afdb0fe0 | refactor(toolchain/names): replace `toolchain_sort()` with `ToolchainName`'s `Ord` instance | Closes #3884.
This new implementation also tries to correct the handling of `X.Y`, `X.Y-beta.W` and `X.Y.Z-beta.W` versions' ordering by abusing [`semver::Comparator`](https://docs.rs/semver/latest/semver/struct.Comparator.html)'s `FromStr` implementation. | diff --git a/src/dist/mod.rs b/src/dist/mod.rs
index 2969f700667..1b1486668e6 100644
--- a/src/dist/mod.rs
+++ b/src/dist/mod.rs
@@ -120,7 +120,7 @@ pub enum DistError {
#[derive(Debug, PartialEq)]
struct ParsedToolchainDesc {
- channel: String,
+ channel: ToolchainChannel,
date: Option<String>,
tar... | 5 | 4 | 0 | [{"id": "G0", "claim": "The new enum should be named `Channel` instead of `ToolchainChannel`, since there are no other kinds of channels in rustup to disambiguate from.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The `Ver` variant of the chan... | null |
rust-lang__rustup__3896 | rust-lang/rustup | 3,896 | defect | 605b3c4f2b44f4e270815f1cc961468a6f8af31e | 5164c06df7d8e1517c7cf389ddfaca6a517e419b | Replace `winreg` with `windows-registry` | Closes #3779.
APIs provided by `winreg` crate is not safe, simple and abstract enough. Besides that, it probably also contains protential bugs. Because of that, it is better to replace it with `windows-registry` crate, which is officially published and maintained by Microsoft. | diff --git a/Cargo.lock b/Cargo.lock
index 9d533669d04..23845d8cd9b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1990,8 +1990,9 @@ dependencies = [
"url",
"wait-timeout",
"walkdir",
+ "windows-registry",
+ "windows-result",
"windows-sys 0.52.0",
- "winreg",
"xz2",
"zstd",
]
@@ -2939,6 +2940,25 @@ version =... | 17 | 11 | 3 | [{"id": "G0", "claim": "The rewritten String-based _remove_from_path is buggy (mixing the byte index from .find() with char indexing) and fails windows_uninstall_removes_semicolon_from_path_prefix; the semicolon check should use byte-based access such as .as_bytes().get().", "category": "correctness", "verdict": "suppo... | null |
rust-lang__rustup__3923 | rust-lang/rustup | 3,923 | defect | 044083c9cc58b0ae23eeb1a390ca17ddc6f859d2 | 714a318557ef132ae4d2b779f01455372f97e9da | feat(dist): refine suggestions regarding manifest checksum mismatches | Closes #3885.
> I've made the following update to the error messages nonetheless:
>
> ### Before
>
> ```console
> info: syncing channel updates for 'nightly-aarch64-apple-darwin'
> info: update not yet available, sorry! try again later
> error: toolchain 'nightly-aarch64-apple-darwin' is not in... | diff --git a/src/dist/mod.rs b/src/dist/mod.rs
index 17d5542c164..c5c20d568ba 100644
--- a/src/dist/mod.rs
+++ b/src/dist/mod.rs
@@ -10,6 +10,7 @@ use once_cell::sync::Lazy;
use regex::Regex;
use serde::{Deserialize, Serialize};
use thiserror::Error as ThisError;
+use tracing::{info, warn};
use crate::{
conf... | 3 | 3 | 0 | [{"id": "G0", "claim": "The `Notification::ManifestChecksumFailedHack` variant is used only once, so it should be inlined rather than kept in the notification infrastructure.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "The wording of the pa... | null |
rust-lang__rustup__3924 | rust-lang/rustup | 3,924 | defect | 044083c9cc58b0ae23eeb1a390ca17ddc6f859d2 | 02e0fc8e8c1ed8bb08e5d2152513362570ae1572 | feat(cli): warn when removing the default/active toolchain | Continuation of #3637, addresses the concern 3) in https://github.com/rust-lang/rustup/issues/3319.
Closes #3319. | diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs
index c04c841b29d..069dcd59e0d 100644
--- a/src/cli/rustup_mode.rs
+++ b/src/cli/rustup_mode.rs
@@ -1281,8 +1281,25 @@ async fn toolchain_link(
}
fn toolchain_remove(cfg: &mut Cfg<'_>, opts: UninstallOpts) -> Result<utils::ExitCode> {
+ let default_too... | 2 | 2 | 0 | [{"id": "G0", "claim": "The non-prompt warning should drop the question mark and be reworded from \"it seems that you are removing the active toolchain, is this intentional?\" to something more direct like \"removing the active toolchain\".", "category": "maintainability", "verdict": "supported", "priority": "P2", "sco... | null |
rust-lang__rustup__3939 | rust-lang/rustup | 3,939 | defect | 79ba44c2814fa240cc64d1f4b1b1c324d75709ad | 2936a9f2c8b99815acad19c32390b541d606f6ce | Add help message for missing toolchain | Closes #3573.
This patch adds a suggestion to run `rustup install <toolchain>` for missing toolchain. | diff --git a/src/errors.rs b/src/errors.rs
index 5f4c4c1196a..bf0bc86c9f4 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -86,7 +86,7 @@ pub enum RustupError {
RunningCommand { name: OsString },
#[error("toolchain '{0}' is not installable")]
ToolchainNotInstallable(String),
- #[error("toolchain '{0}... | 4 | 4 | 2 | [{"id": "G0", "claim": "The help message should suggest the full `rustup toolchain install {0}` command rather than `rustup install {0}`.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The integration test `suite::cli_exact::undefined_linked_toolc... | null |
rust-lang__rustup__3980 | rust-lang/rustup | 3,980 | defect | 4207838d962204123f70705ff9f3e73c37b813df | 30f64a76187a35942b6a8371ef3b96ba762f0b82 | fix(config): warn if host is incompatible with the toolchain in `rustup default` | Closes #3972:
> FWIW we do emit this warning for `rustup toolchain install`:
>
> https://github.com/rust-lang/rustup/blob/4207838d962204123f70705ff9f3e73c37b813df/src/cli/rustup_mode.rs#L820-L825
>
> ```console
> > uname -mrs
> Darwin 23.5.0 arm64
>
> > rustup toolchain install stable-unknown-linux-gnu --... | diff --git a/src/cli/common.rs b/src/cli/common.rs
index da703d06ad8..f342fd5abcc 100644
--- a/src/cli/common.rs
+++ b/src/cli/common.rs
@@ -15,17 +15,18 @@ use git_testament::{git_testament, render_testament};
use tracing::{debug, error, info, trace, warn};
use super::self_update;
-use crate::cli::download_tracker... | 6 | 4 | 1 | [{"id": "G0", "claim": "The can_run()-hardcoding based deprecation approach in warn_if_host_is_incompatible() is fragile and not a good way forward; the existing warnings below seem sufficient.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The pull requ... | null |
rust-lang__rustup__3985 | rust-lang/rustup | 3,985 | defect | 5b5ec92726932b280e2f6e60f17df50644803a68 | b3905a53df75963c13a76e1aba1d5f5e0f9104b0 | feat(cli)!: remove implicit toolchain installation | Closes #3943.
As a follow-up of #3983, this PR makes `rustup toolchain install` (or `rustup install`) the only way to ensure the installation of the active toolchain (apart from installing it manually).
When the active toolchain needs to be installed, the existing error messages now come to our rescue:
https:/... | diff --git a/src/cli/proxy_mode.rs b/src/cli/proxy_mode.rs
index 753579aa0cf..de55f9a99ca 100644
--- a/src/cli/proxy_mode.rs
+++ b/src/cli/proxy_mode.rs
@@ -32,6 +32,6 @@ pub async fn main(arg0: &str, current_dir: PathBuf, process: &Process) -> Result
.collect();
let cfg = set_globals(current_dir, false... | 6 | 3 | 0 | [{"id": "G0", "claim": "The removal of the heal_damaged_toolchain test should be put in a separate commit.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The match in resolve_toolchain would read better rewritten with map().transpose().", "categ... | null |
rust-lang__rustup__4141 | rust-lang/rustup | 4,141 | defect | ef631dcded9ac4cb4336e37daef2294cd5766cc7 | d81c19c8de6cab63aa99aa9c542c78ffbcb6080e | fix(cli/rustup-mode): err when trying to show the default/active toolchain but there is none | Closes #4140.
## Concerns
- [ ] When should `rustup show` exit with `1` (https://github.com/rust-lang/rustup/issues/4140#issuecomment-2570016612)? | diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs
index 4ccda4678ae..f6b97fdb410 100644
--- a/src/cli/rustup_mode.rs
+++ b/src/cli/rustup_mode.rs
@@ -753,15 +753,10 @@ async fn default_(
}
}
} else {
- match cfg.get_default()? {
- Some(default_toolchain) => {
- ... | 1 | 1 | 0 | [{"id": "G0", "claim": "The wording of the new \"there isn't an active toolchain\" error should be tweaked to \"there is no active toolchain\" or simply \"no active toolchain\" for consistency with the existing no-active-toolchain error message.", "category": "documentation", "verdict": "supported", "priority": "P2", "... | null |
rust-lang__rustup__4221 | rust-lang/rustup | 4,221 | defect | 5f3b27203d7ba5aaa27e3c53c3fdb611d98421bd | c9cf94f11cac96fa8c33bcd405133ee35b0f8051 | Restore old behaviour for `rustup show active-toolchain` | Fixes #4217
This is a very partial revert of #3225. It only restores the output of `rustup show active-toolchain` and doesn't change `--verbose` or the output of any other commands. | diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs
index 43a867cb1e1..616457f9a8c 100644
--- a/src/cli/rustup_mode.rs
+++ b/src/cli/rustup_mode.rs
@@ -1085,18 +1085,26 @@ fn show_active_toolchain(cfg: &Cfg<'_>, verbose: bool) -> Result<utils::ExitCode
match cfg.find_active_toolchain()? {
Some((t... | 1 | 1 | 0 | [{"id": "G0", "claim": "Inline the `reason` binding, using a `match` on `ActiveReason::Default` cast to `&dyn fmt::Display` instead of the `let reason: &dyn fmt::Display = if ...` shadowing binding.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
rust-lang__rustup__4275 | rust-lang/rustup | 4,275 | defect | 4514d36fcc9c42416176111cd841c86f7ec44b2c | 17b65a77ded86848ad3b88b091f7fdd50189d9dc | Update `CARGO` environment variable if it is set to a rustup proxy | This is done only if we know the absolute path to the real `cargo` and only if we're sure that `CARGO` points to a proxy.
Fixes #4274 | diff --git a/src/toolchain.rs b/src/toolchain.rs
index 9e9006cdf09..5601336ab01 100644
--- a/src/toolchain.rs
+++ b/src/toolchain.rs
@@ -423,6 +423,22 @@ impl<'a> Toolchain<'a> {
};
let mut cmd = Command::new(path);
self.set_env(&mut cmd);
+
+ // If we're running cargo and the `CARGO` ... | 2 | 2 | 1 | [{"id": "G0", "claim": "The reviewer asks whether there is a way to reliably test the new CARGO-environment replacement behaviour, which at S1 has no test coverage at all.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The `.map().unwrap_or(false)` idio... | null |
rust-lang__rustup__4324 | rust-lang/rustup | 4,324 | defect | 8948cd2875d3ef96a12218ca30c6e47db6478492 | a45dd3f45018c640d11476e4387513993736d1f5 | feat(toolchain): consider external `rust-analyzer` when calling a proxy | Closes #3846.
Following the reasoning in https://github.com/rust-lang/rustup/issues/3846#issuecomment-2597469049, this PR make rustup prioritize rustup-hosted RA and only delegates to the outside as a final rescue. This way, it will also close https://github.com/rust-lang/rustup/issues/3299:
```console
> rust-an... | diff --git a/src/test/mock_bin_src.rs b/src/test/mock_bin_src.rs
index ac90a1e1d25..d85b8002cd2 100644
--- a/src/test/mock_bin_src.rs
+++ b/src/test/mock_bin_src.rs
@@ -102,6 +102,10 @@ fn main() {
panic!("CARGO environment variable not set");
}
}
+ Some("--echo-current-exe... | 5 | 4 | 1 | [{"id": "G0", "claim": "Add a log line at the rust-analyzer fallback so it is visible when debugging that rustup special-cased this path.", "category": "logging", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Check the executable bit of a PATH candidate so only executables are... | null |
rust-lang__rustup__4334 | rust-lang/rustup | 4,334 | defect | 7ba0abf4ced87c239393d83971c1df017c45c40a | b895b7fea167711310d98d7f7277fa4d3405dcc2 | refactor(test): add new APIs for easier snapshot testing | This PR is the foundation of #4359.
RA-powered inline snapshot updates seem to work without issues in VSCode with the given demo (thanks @roife!):
<img width="529" alt="image" src="https://github.com/user-attachments/assets/6fa7bc62-6fa8-4efd-9670-107e25af5c76" />
## Concerns
- [ ] Could the API design use ... | diff --git a/Cargo.lock b/Cargo.lock
index 8ef451c8351..7d53f93a738 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2262,6 +2262,7 @@ dependencies = [
"serde",
"sha2",
"sharded-slab",
+ "snapbox",
"strsim",
"tar",
"tempfile",
diff --git a/Cargo.toml b/Cargo.toml
index 31005d56521..7f123c18cd2 100644
--- a/Carg... | 3 | 2 | 0 | [{"id": "G0", "claim": "The PR should figure out how to deprecate the old test APIs while still keeping CI passing, even if that proves challenging.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new 'redactions' API could be renamed to 'replacements... | null |
rust-lang__rustup__4340 | rust-lang/rustup | 4,340 | defect | 7ba0abf4ced87c239393d83971c1df017c45c40a | 6c7e1fc193485311d96d11de686468fb824bbcd9 | rustup check: add exit status and no-self-update logic | First:
```
rustup check: adopt no-self-update logic
The 'self update' subcommand checks whether self updates have been
disabled, but 'check' did not, meaning the check output could include
updates you're powerless to accept.
This adds the logic from self update to check, no longer showing updates
that can't ... | diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs
index 42d4718cffb..9a8d8791d84 100644
--- a/src/cli/rustup_mode.rs
+++ b/src/cli/rustup_mode.rs
@@ -177,7 +177,11 @@ enum RustupSubcmd {
},
/// Check for updates to Rust toolchains and rustup
- Check,
+ Check {
+ /// Don't check for s... | 1 | 1 | 0 | [{"id": "G0", "claim": "CheckOpts should be flattened into the Check variant with #[command(flatten)], like UpdateOpts is flattened into ToolchainSubcmd::Install, instead of inlining the flag fields.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__rustup__4347 | rust-lang/rustup | 4,347 | defect | 14f134ee3195639bd18d27ecc4b88c3e5d59559c | 91f3af0e7120e64672434094c3b6a950a2348345 | feat(custom-toolchains): targets and components are now reported for custom toolchains | Continuation of #4333.
Instead of throwing an error, `rustup target list` and `rustup component list` now display the installed targets and components, respectively, for custom toolchains.
Similar to the previous PR, this assumes that there may not be a manifest file for custom toolchains. As a result, there is a... | diff --git a/src/cli/common.rs b/src/cli/common.rs
index ba415f1922c..9bfdf51b34e 100644
--- a/src/cli/common.rs
+++ b/src/cli/common.rs
@@ -406,6 +406,45 @@ pub(super) fn list_items(
Ok(utils::ExitCode(0))
}
+pub(super) fn list_items_custom(
+ toolchain: Toolchain<'_>,
+ targets: bool,
+ installed_onl... | 3 | 2 | 0 | [{"id": "G0", "claim": "The rewritten test should use the new `.expect()` test API demonstrated in #4343 instead of `expect_ok`/`expect_err`.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new `list_items_custom` duplicates `list_items`' display log... | null |
rust-lang__rustup__4353 | rust-lang/rustup | 4,353 | defect | 06bf5c17a1e6c9caa9dc07453fd0f453db1dcc0b | 211db48d5a5ee1792acae5e1efb9d98fcacac3af | test(cli-inst-interactive): migrate to `.expect()` APIs | Part of #4359.
[_SemanticDiff_](https://app.semanticdiff.com/gh/rust-lang/rustup/pull/4353/commits) | diff --git a/src/test.rs b/src/test.rs
index 879dfd9d52..76786e30b7 100644
--- a/src/test.rs
+++ b/src/test.rs
@@ -28,8 +28,8 @@ pub use crate::cli::self_update::{RegistryGuard, RegistryValueId, USER_PATH, get
mod clitools;
pub use clitools::{
- CliTestContext, Config, SanitizedOutput, Scenario, SelfUpdateTestCo... | 1 | 1 | 0 | [{"id": "G0", "claim": "Add a brief inline or doc comment explaining the purpose and usage of the newly exported Assert in src/test.rs to guide developers during the migration to the .expect() APIs.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.