Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

bradjc
Copy link
Contributor

@bradjc bradjc commented Oct 26, 2020

Pull Request Overview

This pull request updates the rust nightly version to 2020-10-25.

I had to add a feature in two places. I have no idea why or what changed, but the compiler instructed me to add them.

Two issues:

error[E0658]: mutable references are not allowed in constant functions
  --> chips/lowrisc/src/hmac.rs:87:21
   |
87 |             digest: Cell::new(None),
   |                     ^^^^^^^^^^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: mutable references are not allowed in constant functions
  --> chips/lowrisc/src/hmac.rs:87:31
   |
87 |             digest: Cell::new(None),
   |                               ^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `lowrisc`

and

error[E0658]: mutable references are not allowed in constant functions
  --> libraries/tock-cells/src/take_cell.rs:21:18
   |
21 |             val: Cell::new(None),
   |                  ^^^^^^^^^^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: mutable references are not allowed in constant functions
  --> libraries/tock-cells/src/take_cell.rs:21:28
   |
21 |             val: Cell::new(None),
   |                            ^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `tock-cells`

Testing Strategy

This pull request was tested by travis.

TODO or Help Wanted

n/a

Documentation Updated

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

Formatting

  • Ran make prepush.

@alistair23
Copy link
Contributor

Should we just change the new() to not be a const and not add the new feature?

@hudson-ayers
Copy link
Contributor

Should we just change the new() to not be a const and not add the new feature?

We can't do this because new() has to be const in order to initialize a pub static mut Hmac (or, similarly, to use TakeCell in any pub static mut object). Once my peripheral instantiation PRs are merged we can make that change.

alistair23
alistair23 previously approved these changes Oct 26, 2020
@hudson-ayers
Copy link
Contributor

Pushed a fix so that clippy passes, using the guide here: https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html for correctly implementing PartialOrd on a type that manually implements Ord

@hudson-ayers
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 4, 2020

Build failed:

@bradjc bradjc merged commit 6dd6570 into master Nov 4, 2020
@bors bors bot deleted the rust-2020-10 branch November 4, 2020 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants