Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(xtask): enable clippy for x86_64-uefi #291

Merged
merged 4 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/arch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pub use crate::arch::aarch64::*;
#[cfg(target_arch = "riscv64")]
pub use crate::arch::riscv64::*;
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_os = "none"))]
pub use crate::arch::x86_64::*;

#[cfg(target_arch = "aarch64")]
Expand All @@ -11,5 +11,5 @@ pub mod aarch64;
#[cfg(target_arch = "riscv64")]
pub mod riscv64;

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_os = "none"))]
pub mod x86_64;
2 changes: 2 additions & 0 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/// Adapted from [`std::print`].
///
/// [`std::print`]: https://doc.rust-lang.org/stable/std/macro.print.html
#[cfg(target_os = "none")]
#[macro_export]
macro_rules! print {
($($arg:tt)*) => {{
Expand All @@ -15,6 +16,7 @@ macro_rules! print {
/// Adapted from [`std::println`].
///
/// [`std::println`]: https://doc.rust-lang.org/stable/std/macro.println.html
#[cfg(target_os = "none")]
#[macro_export]
macro_rules! println {
() => {
Expand Down
9 changes: 6 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ mod macros;
#[cfg(target_os = "none")]
mod allocator;
mod arch;
#[cfg(target_os = "none")]
mod console;
#[cfg(target_os = "none")]
mod log;
#[cfg(target_os = "none")]
mod none;
#[cfg(target_os = "uefi")]
mod uefi;

use core::fmt::{self, Write};

#[cfg(target_os = "none")]
#[doc(hidden)]
fn _print(args: fmt::Arguments<'_>) {
fn _print(args: core::fmt::Arguments<'_>) {
use core::fmt::Write;

unsafe {
console::CONSOLE.write_fmt(args).unwrap();
}
Expand Down
3 changes: 1 addition & 2 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,10 @@ impl flags::Clippy {
fn run(self) -> Result<()> {
let sh = Shell::new()?;

// TODO: Enable clippy for x86_64-uefi
// https://github.com/hermitcore/loader/issues/122
for target in [
Target::X86_64,
Target::X86_64Fc,
Target::X86_64Uefi,
Target::AArch64,
Target::Riscv64,
] {
Expand Down