Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: static_mut_refs lint from rustc
Braces are needed to hinder clippy lint and compact in single line. Fefer to what I posted on URLO for an example: https://users.rust-lang.org/t/static-mut-refs-lint-is-amusing/123439 --------------------------------------------------------------------------- Raw static_mut_refs lint outputs: warning: creating a mutable reference to mutable static is discouraged --> src/lib.rs:208:17 | 208 | COMMAND_PORT.write(CMOS_DISABLE_NMI | register); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives = note: `#[warn(static_mut_refs)]` on by default warning: creating a mutable reference to mutable static is discouraged --> src/lib.rs:209:17 | 209 | DATA_PORT.read() | ^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives warning: creating a mutable reference to mutable static is discouraged --> src/lib.rs:215:17 | 215 | COMMAND_PORT.write(CMOS_DISABLE_NMI | register); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives warning: creating a mutable reference to mutable static is discouraged --> src/lib.rs:216:17 | 216 | DATA_PORT.write(value) | ^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
- Loading branch information