Skip to content

Commit

Permalink
Rollup merge of #129907 - saethlin:solid-io-error, r=WaffleLapkin
Browse files Browse the repository at this point in the history
Fix compile error in solid's remove_dir_all

Before this PR, `x check library/std --target=aarch64-kmc-solid_asp3` will fail with:
```
error[E0382]: use of partially moved value: `result`
   --> std/src/sys/pal/solid/fs.rs:544:20
    |
541 |         if let Err(err) = result
    |                    --- value partially moved here
...
544 |             return result;
    |                    ^^^^^^ value used here after partial move
    |
    = note: partial move occurs because value has type `io::error::Error`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
    |
541 |         if let Err(ref err) = result
    |                    +++

```

cc `@kawadakk` I think this will clear up https://solid-rs.github.io/toolstate/ :)
  • Loading branch information
matthiaskrgr authored Sep 2, 2024
2 parents b1b8e3e + 8be9fed commit d6298d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/solid/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ pub fn remove_dir_all(path: &Path) -> io::Result<()> {
}
};
// ignore internal NotFound errors
if let Err(err) = result
if let Err(err) = &result
&& err.kind() != io::ErrorKind::NotFound
{
return result;
Expand Down

0 comments on commit d6298d3

Please sign in to comment.