Skip to content
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

Update Rust toolchain to nightly-2020-10-01 #66

Merged
merged 6 commits into from
Oct 2, 2020

Conversation

retrage
Copy link
Contributor

@retrage retrage commented Oct 1, 2020

This pull request updates the Rust toolchain to the latest (nightly-2020-10-01).
There are a few changes to get work:

  1. Update x86_64 crate to 0.12:
    It does not allow function pointers in constant functions
  2. Use lazy_static:
    It does not allow runtime calls in statics.

@retrage retrage force-pushed the nightly-2020-10-01 branch from 6c2a038 to d0e32d6 Compare October 1, 2020 12:46
@josephlr
Copy link
Contributor

josephlr commented Oct 1, 2020

I'd like to avoid depending on lazy_statoc if possible. I think we can fix this without using an external crate, I'll take a look

@josephlr josephlr mentioned this pull request Oct 1, 2020
josephlr added a commit to josephlr/uart_16550 that referenced this pull request Oct 1, 2020
A recent change
(rust-osdev@1d3a8af)
made it so some previous code using `SerialPort::new()` wouldn't
compile if the user was using the default feature set.

Fixing this to just be `default = [ "nightly" ]` sets the same features
for `x86_64`, while preventing breakage.

See: cloud-hypervisor/rust-hypervisor-firmware#66

Signed-off-by: Joe Richey <[email protected]>
@josephlr josephlr force-pushed the nightly-2020-10-01 branch 2 times, most recently from b746e97 to 7464777 Compare October 1, 2020 17:55
@josephlr
Copy link
Contributor

josephlr commented Oct 1, 2020

Also, thanks @retrage for fixing this!!

I updated this PR to set the correct features on the uart_16550 so that we don't need the lazy_static crate. I also changed the const_item_mutation to explicitly create the temporaries instead of just suppressing the warning.

@josephlr josephlr requested a review from rbradford October 1, 2020 18:11
The recent version of Rust cannot build x86_64 crate v0.11 because it
does not allow function pointers in constant functions[1]. This commit
updates the version to fix the build error.

[1] rust-lang/rust#57563

Signed-off-by: Akira Moroo <[email protected]>
Signed-off-by: Joe Richey <[email protected]>
This is Cargo.lock updates regarding previous two commits.

Signed-off-by: Akira Moroo <[email protected]>
Signed-off-by: Joe Richey <[email protected]>
The newer version of Rust (after 2020-07-30) requires the latest
cargo-xbuild v0.6.2[1].

[1]
rust-osdev/cargo-xbuild@400592f

Signed-off-by: Akira Moroo <[email protected]>
CONST_ITEM_MUTATION list[1] warns mutable copy of STDIN and STDOUT when
creating UEFI SystemTable. This commit fixes these warnings.

[1] rust-lang/rust#75573

Signed-off-by: Akira Moroo <[email protected]>
Signed-off-by: Joe Richey <[email protected]>
Clippy suggests that using strip_prefix over str::starts_with and
slicing[1].

[1]
https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip

Signed-off-by: Akira Moroo <[email protected]>
@rbradford
Copy link
Member

Nice! Thanks.

@retrage
Copy link
Contributor Author

retrage commented Oct 3, 2020

Thanks!

@retrage retrage deleted the nightly-2020-10-01 branch March 13, 2021 04:59
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