10000 Update rust-toolchain to nightly of 2023-07-30 by lschuermann · Pull Request #3582 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update rust-toolchain to nightly of 2023-07-30 #3582

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

Merged
merged 1 commit into from
Aug 5, 2023

Conversation

lschuermann
Copy link
Member
@lschuermann lschuermann commented Jul 31, 2023

Pull Request Overview

This version and the time to update is chosen somewhat arbitrarily, as libtock-rs fails to build elf2tab on its current Rust toolchain (2022-06-10). That triggered me to update them in tandem to a recent Rust nightly.

Fixes some new clippy warnings / errors, such as:

error: incorrect implementation of `clone` on a `Copy` type
  --> kernel/src/utilities/static_ref.rs:44:29
   |
44 |       fn clone(&self) -> Self {
   |  _____________________________^
45 | |         StaticRef { ptr: self.ptr }
46 | |     }
   | |_____^ help: change this to: `{ *self }`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_clone_impl_on_copy_type
   = note: `#[deny(clippy::incorrect_clone_impl_on_copy_type)]` on by default

and

error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
   --> capsules/extra/src/can.rs:293:17
    |
293 | /                 self.can_rx
294 | |                     .take()
295 | |                     .map(|dest_buffer| {
296 | |                         self.processes
...   |
325 | |                     })
326 | |                     .unwrap_or(CommandReturn::failure(ErrorCode::NOMEM))
    | |________________________________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
    = note: requested on the command line with `-D clippy::map-unwrap-or`
help: use `map_or(<a>, <f>)` instead
    |
295 ~                     .map_or(CommandReturn::failure(ErrorCode::NOMEM), |dest_buffer| {
296 |                         self.processes
  ...
324 |                             .unwrap_or_else(|err| err.into())
325 ~                     })
    |

Testing Strategy

This pull request was tested by CI.

TODO or Help Wanted

This introduces a warning in the license-checker stage of the make prepush command:
Figured it out, updated workspace.resolver = "2" in the tools/Cargo.toml workspace.

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

@github-actions github-actions bot added kernel tock-libraries This affects libraries supported by the Tock project risc-v RISC-V architecture labels Jul 31, 2023
alistair23
alistair23 previously approved these changes Jul 31, 2023
bradjc
bradjc previously approved these changes Jul 31, 2023
ppannuto
ppannuto previously approved these changes Jul 31, 2023
@@ -292,7 +292,7 @@ impl<'a, Can: can::Can> SyscallDriver for CanCapsule<'a, Can> {
7 => {
self.can_rx
.take()
.map(|dest_buffer| {
.map_or(CommandReturn::failure(ErrorCode::NOMEM), |dest_buffer| {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I think there's anything wrong with this, but what triggered this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clippy, trying to make our code more idiomatic. This was a hard-error in CI. I'm not neither happy about nor opposed to it complaining here.

@lschuermann lschuermann added the blocked Waiting on something, like a different PR or a dependency. label Jul 31, 2023
@lschuermann
Copy link
Member Author

Marking as blocked until I figure the cargo warning out.

This version and the time to update is chosen somewhat arbitrarily, as
libtock-rs fails to build elf2tab on its current Rust toolchain
(2022-06-10). This triggered me to update them in tandem to a recent
Rust nightly.
@lschuermann lschuermann dismissed stale reviews from ppannuto, bradjc, and alistair23 via f04d0c0 August 4, 2023 19:42
@lschuermann lschuermann force-pushed the dev/rust-update-2023-07-30 branch from f0fdd9d to f04d0c0 Compare August 4, 2023 19:42
@lschuermann lschuermann removed the blocked Waiting on something, like a different PR or a dependency. label Aug 4, 2023
@lschuermann
Copy link
Member Author

Figured out the make prepush warning, turns out we maintain a second Cargo workspace in tools/. After updating the resolver = "2" in there this no longer emits warnings. Also rebased & resolved conflicts, this should be good to go now!

@ppannuto ppannuto added the last-call Final review period for a pull request. label Aug 4, 2023
@lschuermann lschuermann added this pull request to the merge queue Aug 5, 2023
Merged via the queue into tock:master with commit b24e1ca Aug 5, 2023
@lschuermann lschuermann deleted the dev/rust-update-2023-07-30 branch August 5, 2023 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel last-call Final review period for a pull request. risc-v RISC-V architecture tock-libraries This affects libraries supported by the Tock project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0