Skip to content

Nicer hunk headers for rust files #78882

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 9, 2020
Merged

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Nov 8, 2020

I found this trick at https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more

Before the hunk headers for changes in methods would refer to the impl:

diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..fa4264d729b 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -678,7 +678,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
             ref closure_captures,
             ref generator_interior_types,
         } = *self;
-
+        // foo
         hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
             type_dependent_defs.hash_stable(hcx, hasher);
             field_indices.hash_stable(hcx, hasher);

After the hunk headers refer to the actual function signature:

diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..fa4264d729b 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -678,7 +678,7 @@ fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHas
             ref closure_captures,
             ref generator_interior_types,
         } = *self;
-
+        // foo
         hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
             type_dependent_defs.hash_stable(hcx, hasher);
             field_indices.hash_stable(hcx, hasher);

When the function signature is visible, it will use the function
signature of the previous method as hunk header:

diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..63058dfc837 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -992,6 +992,7 @@ pub fn typeck_opt_const_arg(
     }

     pub fn alloc_steal_mir(self, mir: Body<'tcx>) -> &'tcx Steal<Body<'tcx>> {
+        // foo
         self.arena.alloc(Steal::new(mir))
     }

I found this trick at
<https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more>

Before the hunk headers for changes in methods would refer to the impl:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..fa4264d729b 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -678,7 +678,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
             ref closure_captures,
             ref generator_interior_types,
         } = *self;
-
+        // foo
         hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
             type_dependent_defs.hash_stable(hcx, hasher);
             field_indices.hash_stable(hcx, hasher);
```

After the hunk headers refer to the actual function signature:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..fa4264d729b 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -678,7 +678,7 @@ fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHas
             ref closure_captures,
             ref generator_interior_types,
         } = *self;
-
+        // foo
         hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
             type_dependent_defs.hash_stable(hcx, hasher);
             field_indices.hash_stable(hcx, hasher);
```

When the function signature is visible, it will use the function
signature of the previous method as hunk header:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..63058dfc837 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -992,6 +992,7 @@ pub fn typeck_opt_const_arg(
     }

     pub fn alloc_steal_mir(self, mir: Body<'tcx>) -> &'tcx Steal<Body<'tcx>> {
+        // foo
         self.arena.alloc(Steal::new(mir))
     }
```
@rust-highfive
Copy link
Contributor

r? @Mark-Simulacrum

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 8, 2020
@Mark-Simulacrum
Copy link
Member

Hm I guess this seems good, though I do wonder if the impl is really more useful sometimes. I wish we could see both, but doesn't seem like that's really possible.

@bors r+ rollup though

@bors
Copy link
Collaborator

bors commented Nov 8, 2020

📌 Commit 3904617 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 8, 2020
@jyn514
Copy link
Member

jyn514 commented Nov 8, 2020

When the function signature is visible, it will use the function
signature of the previous method as hunk header:

Could it show the impl if the current function is already present? I don't know why I'd want to know what the previous method was.

@jyn514 jyn514 added the A-meta Area: Issues & PRs about the rust-lang/rust repository itself label Nov 8, 2020
@bjorn3
Copy link
Member Author

bjorn3 commented Nov 8, 2020

I don't think that it is possible to show the impl when the current function is already present. According to https://www.git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header it is only possible to define a regex matching the line to use as hunk header. There doesn't seem to be any way to only match it in some cases or customize it. There is a way to specify a completely custom diff command though.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 8, 2020
…imulacrum

Nicer hunk headers for rust files

I found this trick at <https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more>

Before the hunk headers for changes in methods would refer to the impl:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..fa4264d729b 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
`@@` -678,7 +678,7 `@@` impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
             ref closure_captures,
             ref generator_interior_types,
         } = *self;
-
+        // foo
         hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
             type_dependent_defs.hash_stable(hcx, hasher);
             field_indices.hash_stable(hcx, hasher);
```

After the hunk headers refer to the actual function signature:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..fa4264d729b 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
`@@` -678,7 +678,7 `@@` fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHas
             ref closure_captures,
             ref generator_interior_types,
         } = *self;
-
+        // foo
         hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
             type_dependent_defs.hash_stable(hcx, hasher);
             field_indices.hash_stable(hcx, hasher);
```

When the function signature is visible, it will use the function
signature of the previous method as hunk header:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..63058dfc837 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
`@@` -992,6 +992,7 `@@` pub fn typeck_opt_const_arg(
     }

     pub fn alloc_steal_mir(self, mir: Body<'tcx>) -> &'tcx Steal<Body<'tcx>> {
+        // foo
         self.arena.alloc(Steal::new(mir))
     }
```
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 9, 2020
Rollup of 12 pull requests

Successful merges:

 - rust-lang#77640 (Refactor IntErrorKind to avoid "underflow" terminology)
 - rust-lang#78026 (Define `fs::hard_link` to not follow symlinks.)
 - rust-lang#78114 (Recognize `private_intra_doc_links` as a lint)
 - rust-lang#78228 (Promote aarch64-unknown-linux-gnu to Tier 1)
 - rust-lang#78345 (Fix handling of item names for HIR)
 - rust-lang#78437 (BTreeMap: stop mistaking node for an orderly place)
 - rust-lang#78476 (fix some incorrect aliasing in the BTree)
 - rust-lang#78674 (inliner: Use substs_for_mir_body)
 - rust-lang#78748 (Implement destructuring assignment for tuples)
 - rust-lang#78868 (Fix tab focus on restyled switches)
 - rust-lang#78878 (Avoid overlapping cfg attributes when both macOS and aarch64)
 - rust-lang#78882 (Nicer hunk headers for rust files)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 92adac9 into rust-lang:master Nov 9, 2020
@rustbot rustbot added this to the 1.49.0 milestone Nov 9, 2020
@bjorn3 bjorn3 deleted the nicer_hunk_headers branch November 9, 2020 08:12
ojeda added a commit to Rust-for-Linux/linux that referenced this pull request May 31, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
asahilina pushed a commit to AsahiLinux/linux that referenced this pull request Jul 14, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Jul 19, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Jul 20, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Jul 23, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Jul 23, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Jul 25, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Jul 27, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Jul 28, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Jul 30, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Jul 30, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Aug 3, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Aug 9, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Aug 9, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Aug 9, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Aug 12, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Aug 12, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Aug 16, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Aug 16, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Aug 17, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Aug 23, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Aug 31, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Sep 2, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Sep 7, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
herrnst pushed a commit to herrnst/linux-asahi that referenced this pull request Sep 14, 2023
Git supports a builtin Rust diff driver [1] since v2.23.0 (2019).

It improves the choice of hunk headers in some cases, such as
diffs within methods, since those are indented in Rust within
an `impl` block, and therefore the default diff driver would
pick the outer `impl` block instead (rather than the method
where the changed code is).

For instance, with the default diff driver:

    @@ -455,6 +455,8 @@ impl fmt::Write for RawFormatter {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

With the Rust diff driver:

    @@ -455,6 +455,8 @@ fn write_str(&mut self, s: &str) -> fmt::Result {
             // Amount that we can copy. `saturating_sub` ensures we get 0 if `pos` goes past `end`.
             let len_to_copy = core::cmp::min(pos_new, self.end).saturating_sub(self.pos);

    +        test_diff_driver();
    +
             if len_to_copy > 0 {
                 // SAFETY: If `len_to_copy` is non-zero, then we know `pos` has not gone past `end`
                 // yet, so it is valid for write per the type invariants.

Thus set the `rust` diff driver for `*.rs` source files.

The Rust repository also does so since 2020 [2].

Link: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header [1]
Link: rust-lang/rust#78882 [2]
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230418233048.335281-1-ojeda@kernel.org
[ Added link to Rust repository ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
sambacha added a commit to sambacha/foundry that referenced this pull request Dec 27, 2024
This has to be explicitly enabled for git to utilize its enhanced rust diffing, evidently. 

ref: rust-lang/rust#78882
zerosnacks added a commit to foundry-rs/foundry that referenced this pull request Jan 3, 2025
This has to be explicitly enabled for git to utilize its enhanced rust diffing, evidently. 

ref: rust-lang/rust#78882

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
MBerguer added a commit to matter-labs/foundry-zksync that referenced this pull request Jan 29, 2025
* Update incorrect documentation in the READ.me (#9538)

Update README.md

* fix(`anvil`): set `best_number` to `state.block.number` if greater (#9543)

fix(`anvil`): set `best_number` correctly while loading state with fork activated

* fix(`cast`): reset `env.tx.caller` for impersonated txs (#9544)

* fix(`cast`): reset `env.tx.caller` for impersonated txs

* test

* chore: Add GH attestation for foundry binaries (#9546)

Add GH attestation

* fix(release): allow contents write permission, run attestation after release created (#9550)

fix(release): allow contents write permission, run attestation after release published

* chore: bump compilers (#9554)

* chore: bump compilers

* clippy

* fix: account for impersonated tx in configure_tx_env (#9553)

* chore: account for impersonated tx in configure_tx_env

* nit

* fix: read rpc config when using fork cheatcodes (#9547)

* read rpc config when using fork cheatcodes

* attempt to resolve failed environment variables again

* nit: refactor

* nit: refactor

* fix clippy errors

* fix rustfmt errors

* run cargofmt

* set auth header for fork

* remove redundant clone()

* Update crates/cheatcodes/src/config.rs

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* chore(deps): weekly `cargo update` (#9560)

* feat(cast): add support for beacon proxies in cast impl (#9567)

* feat(cast): add support for beacon proxies in cast impl

* test: pin test to current block

* feat(`cheatcodes`): count assertion for `expectEmit` (#9405)

* introduce ExpectEmitTracker

* cheats

* account for emit accounts + simple testNoEmit

* tests: expectCountEmits from specific address

* fix

* failure tests

* fix

* fix: account for log data

* LogCountMap

* fix

* nit

* test

* fix

* fix

* fix: instantiate log count map in tracker only if log satisfies the checks

* nit

* nit

* nits

* doc nits

* helper fn

* nit

* nits

* fix

* fix

* nit

* refactor count tests

* fix

* fix

* fix

* fix(release): check `env.IS_NIGHTLY` as string (#9568)

fix(release): check IS_NIGHTLY as string

* Run release workflow on stable tag push (#9575)

* chore: update release notes template (#9577)

- feat / fixes category per binaries
- breaking changes and perf category
- restrict summary to max 60 days / max 100 PRs, add full diff and contributors

* chore: add contributors in release changelog (#9578)

* feat(foundryup): allow multiple installed versions (#9551)

* feat(foundryup): allow multiple installed versions

* Changes after review: new line after version, -v renamed as -i, create version dir on untar

* Update foundryup link repo and contribute URL

* Fix --one-top-level not avail in bsd tar

* Fix --one-top-level not avail in bsd tar

* update docs

* Err if no version provided to use

---------

Co-authored-by: zerosnacks <zerosnacks@protonmail.com>

* chore: bump workspace version to `0.3.0` (#9580)

bump to 0.3.0

* Update CI workflow template to unpin from `nightly` explicitly, relying on `foundry-toolchain` default (#9573)

* default CI workflow template to stable as opposed to nightly, related: foundry-rs/foundry-toolchain#60

* remove pinning to stable in workflow file, rely on default in foundry-toolchain - now being nightly, becoming stable

* chore: testFail* deprecation warning (#9581)

* chore: testFail* deprecation warning

* test

* fix

* chore(tests): bump forge-std version (#9584)

* chore: bump forge-std version used for tests

* run CI

* fix tests

* fix gas

---------

Co-authored-by: DaniPopes <DaniPopes@users.noreply.github.com>
Co-authored-by: zerosnacks <zerosnacks@protonmail.com>

* chore(`foundryup`): default to stable if no specific version is passed in (#9585)

* default to stable if no specific version is passed in

* update mention, defaults to stable now

* chore(deps): weekly `cargo update` (#9588)

* feat(cast): pretty print other receipt fields (#9589)

* fix(cast): pretty print other receipt fields

Signed-off-by: jsvisa <delweng@gmail.com>

* feat(cast): add other receipt fields pretty test

Signed-off-by: jsvisa <delweng@gmail.com>

* fix(ui): receipt column length 20

Signed-off-by: jsvisa <delweng@gmail.com>

* fmt

Signed-off-by: jsvisa <delweng@gmail.com>

* fix receipt indent test

Signed-off-by: jsvisa <delweng@gmail.com>

* fix test case /2

Signed-off-by: jsvisa <delweng@gmail.com>

* fix revert reason indent

Signed-off-by: jsvisa <delweng@gmail.com>

---------

Signed-off-by: jsvisa <delweng@gmail.com>

* chore(deps): weekly `cargo update` (#9599)

Locking 29 packages to latest compatible versions
    Updating alloy-chains v0.1.49 -> v0.1.51
    Updating alloy-trie v0.7.6 -> v0.7.7
    Updating anyhow v1.0.94 -> v1.0.95
    Updating aws-config v1.5.11 -> v1.5.12
    Updating aws-runtime v1.5.1 -> v1.5.2
    Updating aws-sdk-kms v1.52.0 -> v1.53.0
    Updating aws-sdk-sso v1.51.0 -> v1.52.0
    Updating aws-sdk-ssooidc v1.52.0 -> v1.53.0
    Updating aws-sdk-sts v1.52.0 -> v1.53.0
    Updating aws-smithy-async v1.2.2 -> v1.2.3
    Updating aws-smithy-runtime v1.7.5 -> v1.7.6
    Updating aws-smithy-types v1.2.10 -> v1.2.11
    Updating bon v3.3.0 -> v3.3.2
    Updating bon-macros v3.3.0 -> v3.3.2
    Updating cc v1.2.5 -> v1.2.6
    Updating gix-date v0.9.2 -> v0.9.3
    Updating glob v0.3.1 -> v0.3.2
    Updating jiff v0.1.15 -> v0.1.16
    Updating nybbles v0.2.1 -> v0.3.0
    Updating quote v1.0.37 -> v1.0.38
    Updating reqwest v0.12.9 -> v0.12.11
    Updating rustversion v1.0.18 -> v1.0.19
    Updating scc v2.2.6 -> v2.3.0
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating tracing-tracy v0.11.3 -> v0.11.4
    Updating tracy-client v0.17.6 -> v0.18.0
    Updating unicase v2.8.0 -> v2.8.1
note: pass `--verbose` to see 13 unchanged dependencies behind latest

Co-authored-by: mattsse <19890894+mattsse@users.noreply.github.com>

* chore: make clippy happy (#9601)

* chore: make clippy happy

* allow literals tring with formatting args global

* chore(fmt): tx fields indent with the same whitespaces (#9603)

chore(fmt): follow the same indent rules of other fields

Signed-off-by: jsvisa <delweng@gmail.com>

* chore: fix flaky inline config test (#9591)

* feat: update revm 19 alloy 09 (#9605)

* feat: update revm 19 alloy 09

* clippy

* updata test

* add back max data gas check

* chore(deps): bump alloys (#9613)

* add comment to `-r` option about default value (#9571)

add comment to -r option about default value

* fix(anvil): ipc append a newline (#9608)

* fix(anvil): ipc append a newline

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

* use put_u8 instead of extend from slice

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

---------

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

* chore: dedup errors in eyre handler (#9612)

* fix(`evm`):  P256Verify address (#9618)

* typo: EtherScan -> Etherscan (#9607)

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* chore(git): enhance rust diffing (#9596)

This has to be explicitly enabled for git to utilize its enhanced rust diffing, evidently. 

ref: rust-lang/rust#78882

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

* chore(deps): weekly `cargo update` (#9623)

Locking 56 packages to latest compatible versions
    Updating alloy-chains v0.1.51 -> v0.1.52
    Updating alloy-consensus v0.9.1 -> v0.9.2
    Updating alloy-consensus-any v0.9.1 -> v0.9.2
    Updating alloy-contract v0.9.1 -> v0.9.2
    Updating alloy-dyn-abi v0.8.16 -> v0.8.18
    Updating alloy-eips v0.9.1 -> v0.9.2
    Updating alloy-genesis v0.9.1 -> v0.9.2
    Updating alloy-json-abi v0.8.16 -> v0.8.18
    Updating alloy-json-rpc v0.9.1 -> v0.9.2
    Updating alloy-network v0.9.1 -> v0.9.2
    Updating alloy-network-primitives v0.9.1 -> v0.9.2
    Updating alloy-node-bindings v0.9.1 -> v0.9.2
    Updating alloy-primitives v0.8.16 -> v0.8.18
    Updating alloy-provider v0.9.1 -> v0.9.2
    Updating alloy-pubsub v0.9.1 -> v0.9.2
    Updating alloy-rpc-client v0.9.1 -> v0.9.2
    Updating alloy-rpc-types v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-anvil v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-any v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-debug v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-engine v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-eth v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-trace v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-txpool v0.9.1 -> v0.9.2
    Updating alloy-serde v0.9.1 -> v0.9.2
    Updating alloy-signer v0.9.1 -> v0.9.2
    Updating alloy-signer-aws v0.9.1 -> v0.9.2
    Updating alloy-signer-gcp v0.9.1 -> v0.9.2
    Updating alloy-signer-ledger v0.9.1 -> v0.9.2
    Updating alloy-signer-local v0.9.1 -> v0.9.2
    Updating alloy-signer-trezor v0.9.1 -> v0.9.2
    Updating alloy-sol-macro v0.8.16 -> v0.8.18
    Updating alloy-sol-macro-expander v0.8.16 -> v0.8.18
    Updating alloy-sol-macro-input v0.8.16 -> v0.8.18
    Updating alloy-sol-type-parser v0.8.16 -> v0.8.18
    Updating alloy-sol-types v0.8.16 -> v0.8.18
    Updating alloy-transport v0.9.1 -> v0.9.2
    Updating alloy-transport-http v0.9.1 -> v0.9.2
    Updating alloy-transport-ipc v0.9.1 -> v0.9.2
    Updating alloy-transport-ws v0.9.1 -> v0.9.2
    Updating async-trait v0.1.83 -> v0.1.84
    Updating aws-config v1.5.12 -> v1.5.13
    Updating aws-runtime v1.5.2 -> v1.5.3
    Updating aws-sdk-kms v1.53.0 -> v1.54.0
    Updating aws-sdk-sso v1.52.0 -> v1.53.0
    Updating aws-sdk-ssooidc v1.53.0 -> v1.54.0
    Updating aws-sdk-sts v1.53.0 -> v1.54.0
    Updating bstr v1.11.1 -> v1.11.3
    Updating cc v1.2.6 -> v1.2.7
    Removing diff v0.1.13
    Removing hex-literal v0.4.1
    Updating instability v0.3.5 -> v0.3.6
    Updating jiff v0.1.18 -> v0.1.21
    Removing pretty_assertions v1.4.1
    Updating schnellru v0.2.3 -> v0.2.4
    Updating syn v2.0.93 -> v2.0.94
    Updating syn-solidity v0.8.16 -> v0.8.18
    Updating tempfile v3.14.0 -> v3.15.0
    Updating winnow v0.6.21 -> v0.6.22
note: pass `--verbose` to see 12 unchanged dependencies behind latest

Co-authored-by: mattsse <19890894+mattsse@users.noreply.github.com>

* chore(`config`): use solar for inline config parsing (#9615)

* chore(`bind-json`): replace solang with solar (#9616)

* chore(deps): bump solar 0.1.1 (#9627)

* chore(forge): remove `forge debug` subcommand (#9606)

forge: rm subcommand debug

Co-authored-by: 9547 <nivefive9547@gmail.com>
Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

* feat(test): add repro issue8566 testcase (#9617)

* feat(test): add Issue8566 testcase

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

* bump alloy to 0.8.18

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

---------

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

* chore: standardize use of `opts` / `args` (#9629)

* globalopts -> globalargs

* consistently use opts for configurations, args for command line arguments

* fix: re-remove forge `debug` file (#9631)

fix re-remove debug file

* feat: remove ethers (#9412)

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* cargo updated iself

* compiles

* Fixing the tests

* fix: upstream 5e72c69 fix tests (#869)

* Rolling back the filtering in the nextest

* alloy-zksync back to versioning

* Rollback

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>
Co-authored-by: Jacob T Firek <106350168+jtfirek@users.noreply.github.com>
Co-authored-by: Yash Atreya <44857776+yash-atreya@users.noreply.github.com>
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
Co-authored-by: anukul <44864521+anukul@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: W <public_double_v@protonmail.com>
Co-authored-by: zerosnacks <zerosnacks@protonmail.com>
Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
Co-authored-by: DaniPopes <DaniPopes@users.noreply.github.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: mattsse <19890894+mattsse@users.noreply.github.com>
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Co-authored-by: zhiqiangxu <652732310@qq.com>
Co-authored-by: Marquis Shanahan <29431502+9547@users.noreply.github.com>
Co-authored-by: sam bacha <sam@manifoldfinance.com>
Co-authored-by: 9547 <nivefive9547@gmail.com>
Co-authored-by: Nisheeth Barthwal <nbaztec@gmail.com>
Jrigada pushed a commit to matter-labs/foundry-zksync that referenced this pull request Jan 29, 2025
* Update incorrect documentation in the READ.me (#9538)

Update README.md

* fix(`anvil`): set `best_number` to `state.block.number` if greater (#9543)

fix(`anvil`): set `best_number` correctly while loading state with fork activated

* fix(`cast`): reset `env.tx.caller` for impersonated txs (#9544)

* fix(`cast`): reset `env.tx.caller` for impersonated txs

* test

* chore: Add GH attestation for foundry binaries (#9546)

Add GH attestation

* fix(release): allow contents write permission, run attestation after release created (#9550)

fix(release): allow contents write permission, run attestation after release published

* chore: bump compilers (#9554)

* chore: bump compilers

* clippy

* fix: account for impersonated tx in configure_tx_env (#9553)

* chore: account for impersonated tx in configure_tx_env

* nit

* fix: read rpc config when using fork cheatcodes (#9547)

* read rpc config when using fork cheatcodes

* attempt to resolve failed environment variables again

* nit: refactor

* nit: refactor

* fix clippy errors

* fix rustfmt errors

* run cargofmt

* set auth header for fork

* remove redundant clone()

* Update crates/cheatcodes/src/config.rs

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* chore(deps): weekly `cargo update` (#9560)

* feat(cast): add support for beacon proxies in cast impl (#9567)

* feat(cast): add support for beacon proxies in cast impl

* test: pin test to current block

* feat(`cheatcodes`): count assertion for `expectEmit` (#9405)

* introduce ExpectEmitTracker

* cheats

* account for emit accounts + simple testNoEmit

* tests: expectCountEmits from specific address

* fix

* failure tests

* fix

* fix: account for log data

* LogCountMap

* fix

* nit

* test

* fix

* fix

* fix: instantiate log count map in tracker only if log satisfies the checks

* nit

* nit

* nits

* doc nits

* helper fn

* nit

* nits

* fix

* fix

* nit

* refactor count tests

* fix

* fix

* fix

* fix(release): check `env.IS_NIGHTLY` as string (#9568)

fix(release): check IS_NIGHTLY as string

* Run release workflow on stable tag push (#9575)

* chore: update release notes template (#9577)

- feat / fixes category per binaries
- breaking changes and perf category
- restrict summary to max 60 days / max 100 PRs, add full diff and contributors

* chore: add contributors in release changelog (#9578)

* feat(foundryup): allow multiple installed versions (#9551)

* feat(foundryup): allow multiple installed versions

* Changes after review: new line after version, -v renamed as -i, create version dir on untar

* Update foundryup link repo and contribute URL

* Fix --one-top-level not avail in bsd tar

* Fix --one-top-level not avail in bsd tar

* update docs

* Err if no version provided to use

---------

Co-authored-by: zerosnacks <zerosnacks@protonmail.com>

* chore: bump workspace version to `0.3.0` (#9580)

bump to 0.3.0

* Update CI workflow template to unpin from `nightly` explicitly, relying on `foundry-toolchain` default (#9573)

* default CI workflow template to stable as opposed to nightly, related: foundry-rs/foundry-toolchain#60

* remove pinning to stable in workflow file, rely on default in foundry-toolchain - now being nightly, becoming stable

* chore: testFail* deprecation warning (#9581)

* chore: testFail* deprecation warning

* test

* fix

* chore(tests): bump forge-std version (#9584)

* chore: bump forge-std version used for tests

* run CI

* fix tests

* fix gas

---------

Co-authored-by: DaniPopes <DaniPopes@users.noreply.github.com>
Co-authored-by: zerosnacks <zerosnacks@protonmail.com>

* chore(`foundryup`): default to stable if no specific version is passed in (#9585)

* default to stable if no specific version is passed in

* update mention, defaults to stable now

* chore(deps): weekly `cargo update` (#9588)

* feat(cast): pretty print other receipt fields (#9589)

* fix(cast): pretty print other receipt fields

Signed-off-by: jsvisa <delweng@gmail.com>

* feat(cast): add other receipt fields pretty test

Signed-off-by: jsvisa <delweng@gmail.com>

* fix(ui): receipt column length 20

Signed-off-by: jsvisa <delweng@gmail.com>

* fmt

Signed-off-by: jsvisa <delweng@gmail.com>

* fix receipt indent test

Signed-off-by: jsvisa <delweng@gmail.com>

* fix test case /2

Signed-off-by: jsvisa <delweng@gmail.com>

* fix revert reason indent

Signed-off-by: jsvisa <delweng@gmail.com>

---------

Signed-off-by: jsvisa <delweng@gmail.com>

* chore(deps): weekly `cargo update` (#9599)

Locking 29 packages to latest compatible versions
    Updating alloy-chains v0.1.49 -> v0.1.51
    Updating alloy-trie v0.7.6 -> v0.7.7
    Updating anyhow v1.0.94 -> v1.0.95
    Updating aws-config v1.5.11 -> v1.5.12
    Updating aws-runtime v1.5.1 -> v1.5.2
    Updating aws-sdk-kms v1.52.0 -> v1.53.0
    Updating aws-sdk-sso v1.51.0 -> v1.52.0
    Updating aws-sdk-ssooidc v1.52.0 -> v1.53.0
    Updating aws-sdk-sts v1.52.0 -> v1.53.0
    Updating aws-smithy-async v1.2.2 -> v1.2.3
    Updating aws-smithy-runtime v1.7.5 -> v1.7.6
    Updating aws-smithy-types v1.2.10 -> v1.2.11
    Updating bon v3.3.0 -> v3.3.2
    Updating bon-macros v3.3.0 -> v3.3.2
    Updating cc v1.2.5 -> v1.2.6
    Updating gix-date v0.9.2 -> v0.9.3
    Updating glob v0.3.1 -> v0.3.2
    Updating jiff v0.1.15 -> v0.1.16
    Updating nybbles v0.2.1 -> v0.3.0
    Updating quote v1.0.37 -> v1.0.38
    Updating reqwest v0.12.9 -> v0.12.11
    Updating rustversion v1.0.18 -> v1.0.19
    Updating scc v2.2.6 -> v2.3.0
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating tracing-tracy v0.11.3 -> v0.11.4
    Updating tracy-client v0.17.6 -> v0.18.0
    Updating unicase v2.8.0 -> v2.8.1
note: pass `--verbose` to see 13 unchanged dependencies behind latest

Co-authored-by: mattsse <19890894+mattsse@users.noreply.github.com>

* chore: make clippy happy (#9601)

* chore: make clippy happy

* allow literals tring with formatting args global

* chore(fmt): tx fields indent with the same whitespaces (#9603)

chore(fmt): follow the same indent rules of other fields

Signed-off-by: jsvisa <delweng@gmail.com>

* chore: fix flaky inline config test (#9591)

* feat: update revm 19 alloy 09 (#9605)

* feat: update revm 19 alloy 09

* clippy

* updata test

* add back max data gas check

* chore(deps): bump alloys (#9613)

* add comment to `-r` option about default value (#9571)

add comment to -r option about default value

* fix(anvil): ipc append a newline (#9608)

* fix(anvil): ipc append a newline

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

* use put_u8 instead of extend from slice

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

---------

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

* chore: dedup errors in eyre handler (#9612)

* fix(`evm`):  P256Verify address (#9618)

* typo: EtherScan -> Etherscan (#9607)

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* chore(git): enhance rust diffing (#9596)

This has to be explicitly enabled for git to utilize its enhanced rust diffing, evidently. 

ref: rust-lang/rust#78882

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

* chore(deps): weekly `cargo update` (#9623)

Locking 56 packages to latest compatible versions
    Updating alloy-chains v0.1.51 -> v0.1.52
    Updating alloy-consensus v0.9.1 -> v0.9.2
    Updating alloy-consensus-any v0.9.1 -> v0.9.2
    Updating alloy-contract v0.9.1 -> v0.9.2
    Updating alloy-dyn-abi v0.8.16 -> v0.8.18
    Updating alloy-eips v0.9.1 -> v0.9.2
    Updating alloy-genesis v0.9.1 -> v0.9.2
    Updating alloy-json-abi v0.8.16 -> v0.8.18
    Updating alloy-json-rpc v0.9.1 -> v0.9.2
    Updating alloy-network v0.9.1 -> v0.9.2
    Updating alloy-network-primitives v0.9.1 -> v0.9.2
    Updating alloy-node-bindings v0.9.1 -> v0.9.2
    Updating alloy-primitives v0.8.16 -> v0.8.18
    Updating alloy-provider v0.9.1 -> v0.9.2
    Updating alloy-pubsub v0.9.1 -> v0.9.2
    Updating alloy-rpc-client v0.9.1 -> v0.9.2
    Updating alloy-rpc-types v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-anvil v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-any v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-debug v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-engine v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-eth v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-trace v0.9.1 -> v0.9.2
    Updating alloy-rpc-types-txpool v0.9.1 -> v0.9.2
    Updating alloy-serde v0.9.1 -> v0.9.2
    Updating alloy-signer v0.9.1 -> v0.9.2
    Updating alloy-signer-aws v0.9.1 -> v0.9.2
    Updating alloy-signer-gcp v0.9.1 -> v0.9.2
    Updating alloy-signer-ledger v0.9.1 -> v0.9.2
    Updating alloy-signer-local v0.9.1 -> v0.9.2
    Updating alloy-signer-trezor v0.9.1 -> v0.9.2
    Updating alloy-sol-macro v0.8.16 -> v0.8.18
    Updating alloy-sol-macro-expander v0.8.16 -> v0.8.18
    Updating alloy-sol-macro-input v0.8.16 -> v0.8.18
    Updating alloy-sol-type-parser v0.8.16 -> v0.8.18
    Updating alloy-sol-types v0.8.16 -> v0.8.18
    Updating alloy-transport v0.9.1 -> v0.9.2
    Updating alloy-transport-http v0.9.1 -> v0.9.2
    Updating alloy-transport-ipc v0.9.1 -> v0.9.2
    Updating alloy-transport-ws v0.9.1 -> v0.9.2
    Updating async-trait v0.1.83 -> v0.1.84
    Updating aws-config v1.5.12 -> v1.5.13
    Updating aws-runtime v1.5.2 -> v1.5.3
    Updating aws-sdk-kms v1.53.0 -> v1.54.0
    Updating aws-sdk-sso v1.52.0 -> v1.53.0
    Updating aws-sdk-ssooidc v1.53.0 -> v1.54.0
    Updating aws-sdk-sts v1.53.0 -> v1.54.0
    Updating bstr v1.11.1 -> v1.11.3
    Updating cc v1.2.6 -> v1.2.7
    Removing diff v0.1.13
    Removing hex-literal v0.4.1
    Updating instability v0.3.5 -> v0.3.6
    Updating jiff v0.1.18 -> v0.1.21
    Removing pretty_assertions v1.4.1
    Updating schnellru v0.2.3 -> v0.2.4
    Updating syn v2.0.93 -> v2.0.94
    Updating syn-solidity v0.8.16 -> v0.8.18
    Updating tempfile v3.14.0 -> v3.15.0
    Updating winnow v0.6.21 -> v0.6.22
note: pass `--verbose` to see 12 unchanged dependencies behind latest

Co-authored-by: mattsse <19890894+mattsse@users.noreply.github.com>

* chore(`config`): use solar for inline config parsing (#9615)

* chore(`bind-json`): replace solang with solar (#9616)

* chore(deps): bump solar 0.1.1 (#9627)

* chore(forge): remove `forge debug` subcommand (#9606)

forge: rm subcommand debug

Co-authored-by: 9547 <nivefive9547@gmail.com>
Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

* feat(test): add repro issue8566 testcase (#9617)

* feat(test): add Issue8566 testcase

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

* bump alloy to 0.8.18

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

---------

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>

* chore: standardize use of `opts` / `args` (#9629)

* globalopts -> globalargs

* consistently use opts for configurations, args for command line arguments

* fix: re-remove forge `debug` file (#9631)

fix re-remove debug file

* feat: remove ethers (#9412)

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* Revert "Merge upstream commit 5e72c69"

This reverts commit 1e8bad0, reversing
changes made to 7b50143.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>
Co-authored-by: Jacob T Firek <106350168+jtfirek@users.noreply.github.com>
Co-authored-by: Yash Atreya <44857776+yash-atreya@users.noreply.github.com>
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
Co-authored-by: anukul <44864521+anukul@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: W <public_double_v@protonmail.com>
Co-authored-by: zerosnacks <zerosnacks@protonmail.com>
Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
Co-authored-by: DaniPopes <DaniPopes@users.noreply.github.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: mattsse <19890894+mattsse@users.noreply.github.com>
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Co-authored-by: zhiqiangxu <652732310@qq.com>
Co-authored-by: Marquis Shanahan <29431502+9547@users.noreply.github.com>
Co-authored-by: sam bacha <sam@manifoldfinance.com>
Co-authored-by: 9547 <nivefive9547@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants