Commit aeb88f5c authored by Martin Kröning's avatar Martin Kröning 🦀
Browse files

Enable rust_2018_idioms lint

parent 8ca3b5fa
......@@ -71,7 +71,7 @@ impl BootInfo {
}
impl fmt::Debug for BootInfo {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
writeln!(f, "magic_number 0x{:x}", self.magic_number)?;
writeln!(f, "version 0x{:x}", self.version)?;
writeln!(f, "base 0x{:x}", self.base)?;
......
......@@ -73,7 +73,7 @@ impl BootInfo {
}
impl fmt::Debug for BootInfo {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
writeln!(f, "magic_number 0x{:x}", self.magic_number)?;
writeln!(f, "version 0x{:x}", self.version)?;
writeln!(f, "base 0x{:x}", self.base)?;
......
......@@ -18,17 +18,13 @@
#![feature(const_raw_ptr_deref)]
#![feature(core_intrinsics)]
#![no_std]
#![warn(rust_2018_idioms)]
#![allow(clippy::missing_safety_doc)]
// EXTERNAL CRATES
#[cfg(target_arch = "x86_64")]
#[macro_use]
extern crate bitflags;
extern crate goblin;
#[cfg(target_arch = "x86_64")]
extern crate multiboot;
#[cfg(target_arch = "x86_64")]
extern crate x86;
#[cfg(target_arch = "x86_64")]
use crate::arch::x86_64::paging::{LargePageSize, PageSize};
......@@ -69,7 +65,7 @@ pub unsafe fn sections_init() {
);
}
pub unsafe fn load_kernel(elf: &elf::Elf, elf_start: u64, mem_size: u64) -> (u64, u64) {
pub unsafe fn load_kernel(elf: &elf::Elf<'_>, elf_start: u64, mem_size: u64) -> (u64, u64) {
loaderlog!("start 0x{:x}, size 0x{:x}", elf_start, mem_size);
if !elf.libraries.is_empty() {
panic!(
......@@ -148,7 +144,7 @@ pub unsafe fn load_kernel(elf: &elf::Elf, elf_start: u64, mem_size: u64) -> (u64
(address, elf.entry + address)
}
pub fn check_kernel_elf_file(elf: &elf::Elf) -> u64 {
pub fn check_kernel_elf_file(elf: &elf::Elf<'_>) -> u64 {
if !elf.libraries.is_empty() {
panic!(
"Error: file depends on following libraries: {:?}",
......
......@@ -9,11 +9,9 @@
#![no_std] // don't link the Rust standard library
#![cfg_attr(not(test), no_main)] // disable all Rust-level entry points
#![cfg_attr(test, allow(dead_code, unused_macros, unused_imports))]
#![warn(rust_2018_idioms)]
#![allow(clippy::missing_safety_doc)]
extern crate goblin;
extern crate rusty_loader;
use goblin::elf;
use rusty_loader::arch;
use rusty_loader::*;
......
......@@ -11,7 +11,7 @@
use core::panic::PanicInfo;
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
fn panic(info: &PanicInfo<'_>) -> ! {
loaderlog!("PANIC: ");
if let Some(location) = info.location() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment