We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
get_arch_vcpu
There is a clippy waring exiss in vcpu's get_arch_vcpu function.
/// Get the architecture-specific vcpu. pub fn get_arch_vcpu(&self) -> &mut A { unsafe { &mut *self.arch_vcpu.get() } }
Warning:
➜ axvcpu git:(ci) cargo clippy --all-features Checking axvcpu v0.1.0 (/home/hky/workspace/arceos/arceos-crates/axvcpu) error: mutable borrow from immutable input(s) --> src/vcpu.rs:188:36 | 188 | pub fn get_arch_vcpu(&self) -> &mut A { | ^^^^^^ | note: immutable borrow here --> src/vcpu.rs:188:26 | 188 | pub fn get_arch_vcpu(&self) -> &mut A { | ^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mut_from_ref = note: `#[deny(clippy::mut_from_ref)]` on by default warning: unsafe function's docs miss `# Safety` section --> src/vcpu.rs:250:1 | 250 | pub unsafe fn set_current_vcpu<A: AxArchVCpu>(vcpu: &AxVCpu<A>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc = note: `#[warn(clippy::missing_safety_doc)]` on by default warning: `axvcpu` (lib) generated 1 warning error: could not compile `axvcpu` (lib) due to 1 previous error; 1 warning emitted __vsc_update_cwd:printf:1: write error: interrupt ➜ axvcpu git:(ci) ✗
Indeed, get mutable borrow from immutable input is not a good coding style, but this design is related to inter mutability.
I use #[allow(clippy::mut_from_ref)] to decorate this function to bypass this warning for now.
#[allow(clippy::mut_from_ref)]
The text was updated successfully, but these errors were encountered:
It'll be fixed later.
Sorry, something went wrong.
No branches or pull requests
There is a clippy waring exiss in vcpu's
get_arch_vcpu
function.Warning:
Indeed, get mutable borrow from immutable input is not a good coding style, but this design is related to inter mutability.
I use
#[allow(clippy::mut_from_ref)]
to decorate this function to bypass this warning for now.The text was updated successfully, but these errors were encountered: