Skip to content

Rustfmt now support use closures #139692

New issue

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

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

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spastorino
Copy link
Member

This should be merged when rust-lang/rustfmt#6532 is used by CI's rustfmt.

@rustbot
Copy link
Collaborator

rustbot commented Apr 11, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 11, 2025
@rust-log-analyzer

This comment has been minimized.

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 19, 2025
@spastorino spastorino force-pushed the do-not-rustfmt-ignore branch from 6a3d3fe to 4781ecd Compare April 23, 2025 20:30
@rust-log-analyzer

This comment has been minimized.

@spastorino spastorino force-pushed the do-not-rustfmt-ignore branch from 4781ecd to 7b9072d Compare May 15, 2025 19:43
@rust-log-analyzer

This comment has been minimized.

@spastorino spastorino force-pushed the do-not-rustfmt-ignore branch from 7b9072d to 6c3e13e Compare July 2, 2025 15:50
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check-tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
[TIMING] core::build_steps::tool::ToolBuild { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 8.715
[TIMING] core::build_steps::tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
Diff in /checkout/tests/codegen/ergonomic-clones/closure.rs:1:
 //@ compile-flags: -C no-prepopulate-passes -Copt-level=0 -Zmir-opt-level=0
 
 #![crate_type = "lib"]
-
 #![feature(ergonomic_clones)]
 #![allow(incomplete_features)]
 
Diff in /checkout/tests/codegen/ergonomic-clones/closure.rs:11:
     let s = String::from("hi");
 
     // CHECK-NOT: ; call core::clone::impls::<impl core::clone::Clone for String>::clone
-    let cl = use || s;
+    let cl = || s;
     cl()
 }
 
Diff in /checkout/tests/codegen/ergonomic-clones/closure.rs:24:
     let f = Foo;
 
     // CHECK: ; call <closure::Foo as core::clone::Clone>::clone
-    let f1 = use || f;
+    let f1 = || f;
 
     // CHECK: ; call <closure::Foo as core::clone::Clone>::clone
-    let f2 = use || f;
+    let f2 = || f;
 
     f
 }
Diff in /checkout/tests/codegen/ergonomic-clones/closure.rs:36:
     let i = 1;
---
     i
 }
Diff in /checkout/tests/codegen/ergonomic-clones/closure.rs:46:
 
 pub fn ergonomic_clone_closure_use_cloned_generics<T: UseCloned>(f: T) -> T {
     // CHECK-NOT: ; call core::clone::impls::<impl core::clone::Clone for i32>::clone
-    let f1 = use || f;
+    let f1 = || f;
 
     // CHECK-NOT: ; call core::clone::impls::<impl core::clone::Clone for i32>::clone
-    let f2 = use || f;
+    let f2 = || f;
 
     f
 }
Diff in /checkout/tests/mir-opt/ergonomic-clones/closure.rs:10:
     // CHECK-NOT: <String as Clone>::clone
     let s = String::from("hi");
 
-    let cl = use || s;
+    let cl = || s;
     cl()
 }
 
Diff in /checkout/tests/mir-opt/ergonomic-clones/closure.rs:24:
     // CHECK: <Foo as Clone>::clone
     let f = Foo;
 
-    let f1 = use || f;
+    let f1 = || f;
 
-    let f2 = use || f;
+    let f2 = || f;
 
     f
 }
Diff in /checkout/tests/mir-opt/ergonomic-clones/closure.rs:37:
     // CHECK-NOT: <i32 as Clone>::clone
---
+    let i2 = || i;
 
     i
 }
Diff in /checkout/tests/mir-opt/ergonomic-clones/closure.rs:47:
 pub fn ergonomic_clone_closure_use_cloned_generics<T: UseCloned>(f: T) -> T {
     // CHECK-LABEL: fn ergonomic_clone_closure_use_cloned_generics(
     // CHECK: <T as Clone>::clone
-    let f1 = use || f;
+    let f1 = || f;
 
-    let f2 = use || f;
+    let f2 = || f;
 
     f
 }
fmt: checked 6137 files
Build completed unsuccessfully in 0:00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
4 participants