Update Rust from nightly-2023-12-01 to nightly-2024-03-01 (#598)

* Update Rust from nightly-2023-12-01 to nightly-2024-03-01

* Run clippy

* Update binaries
This commit is contained in:
Vincent Ollivier 2024-03-16 14:12:21 +01:00 committed by GitHub
parent 4d0c956a0e
commit 6175fae3f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 14 additions and 21 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2023-12-01"
channel = "nightly-2024-03-01"
components = ["rust-src", "llvm-tools-preview"]

View File

@ -1,7 +1,5 @@
use crate::api::syscall;
use core::convert::From;
#[derive(Copy, Clone, PartialEq, Eq)]
#[repr(u8)]
pub enum ExitCode {

View File

@ -1,6 +1,5 @@
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use core::convert::From;
use core::ops::RangeBounds;
// See "A Regular Expression Matcher" by Rob Pike and Brian Kernighan (2007)

View File

@ -35,7 +35,7 @@ impl TryFrom<&[u8]> for DeviceType {
type Error = ();
fn try_from(buf: &[u8]) -> Result<Self, Self::Error> {
match buf.get(0).ok_or(())? {
match buf.first().ok_or(())? {
0 => Ok(DeviceType::Null),
1 => Ok(DeviceType::File),
2 => Ok(DeviceType::Console),

View File

@ -9,7 +9,6 @@ use crate::sys;
use alloc::boxed::Box;
use alloc::string::String;
use core::convert::From;
#[derive(Debug, Clone)]
pub struct Dir {

View File

@ -1,7 +1,9 @@
use super::dir::Dir;
use super::{dirname, filename, realpath, FileType};
use alloc::string::String;
use alloc::vec::Vec;
use core::convert::TryInto;
#[derive(Clone)]
pub struct DirEntry {
@ -176,8 +178,6 @@ impl FileInfo {
}
}
use core::convert::From;
use core::convert::TryInto;
impl From<&[u8]> for FileInfo {
fn from(buf: &[u8]) -> Self {
let kind = match buf[0] {

View File

@ -6,7 +6,6 @@ use super::{dirname, filename, realpath, FileIO, IO};
use alloc::boxed::Box;
use alloc::string::{String, ToString};
use alloc::vec;
use core::convert::From;
pub enum SeekFrom {
Start(u32),

View File

@ -4,7 +4,6 @@ use super::dir_entry::DirEntry;
use super::FileType;
use alloc::string::String;
use core::convert::From;
use core::convert::TryInto;
pub struct ReadDir {

View File

@ -1,3 +1,4 @@
use core::ptr::addr_of;
use lazy_static::lazy_static;
use x86_64::instructions::segmentation::{Segment, CS, DS};
use x86_64::instructions::tables::load_tss;
@ -17,19 +18,19 @@ lazy_static! {
let mut tss = TaskStateSegment::new();
tss.privilege_stack_table[0] = {
static mut STACK: [u8; STACK_SIZE] = [0; STACK_SIZE];
VirtAddr::from_ptr(unsafe { &STACK }) + STACK_SIZE as u64
VirtAddr::from_ptr(unsafe { addr_of!(STACK) }) + STACK_SIZE as u64
};
tss.interrupt_stack_table[DOUBLE_FAULT_IST as usize] = {
static mut STACK: [u8; STACK_SIZE] = [0; STACK_SIZE];
VirtAddr::from_ptr(unsafe { &STACK }) + STACK_SIZE as u64
VirtAddr::from_ptr(unsafe { addr_of!(STACK) }) + STACK_SIZE as u64
};
tss.interrupt_stack_table[PAGE_FAULT_IST as usize] = {
static mut STACK: [u8; STACK_SIZE] = [0; STACK_SIZE];
VirtAddr::from_ptr(unsafe { &STACK }) + STACK_SIZE as u64
VirtAddr::from_ptr(unsafe { addr_of!(STACK) }) + STACK_SIZE as u64
};
tss.interrupt_stack_table[GENERAL_PROTECTION_FAULT_IST as usize] = {
static mut STACK: [u8; STACK_SIZE] = [0; STACK_SIZE];
VirtAddr::from_ptr(unsafe { &STACK }) + STACK_SIZE as u64
VirtAddr::from_ptr(unsafe { addr_of!(STACK) }) + STACK_SIZE as u64
};
tss
};

View File

@ -12,7 +12,6 @@ use alloc::vec::Vec;
use lazy_static::lazy_static;
use littlewing::chess::*;
use littlewing::color::*;
use littlewing::fen::FEN;
use spin::Mutex;
lazy_static! {

View File

@ -2,7 +2,6 @@ use crate::api::clock;
use crate::api::console::Style;
use crate::api::process::ExitCode;
use crate::api::syscall;
use crate::debug;
use crate::sys::console;
use crate::sys::net;
use crate::usr::shell;

View File

@ -121,7 +121,7 @@ impl Game {
let color = Style::color("Black").with_background(bg);
let reset = Style::reset();
let stats = format!("GEN: {:04} | POP: {:04}", gen, pop);
let size = (self.cols as usize) - stats.len();
let size = self.cols - stats.len();
format!("\n{}{:n$}{}{}", color, title, stats, reset, n = size)
}
}

View File

@ -337,7 +337,7 @@ fn cmd_unalias(args: &[&str], config: &mut Config) -> Result<(), ExitCode> {
return Err(ExitCode::UsageError);
}
if config.aliases.remove(&args[1].to_string()).is_none() {
if config.aliases.remove(args[1]).is_none() {
error!("Could not unalias '{}'", args[1]);
return Err(ExitCode::Failure);
}
@ -373,7 +373,7 @@ fn cmd_unset(args: &[&str], config: &mut Config) -> Result<(), ExitCode> {
return Err(ExitCode::UsageError);
}
if config.env.remove(&args[1].to_string()).is_none() {
if config.env.remove(args[1]).is_none() {
error!("Could not unset '{}'", args[1]);
return Err(ExitCode::Failure);
}

View File

@ -6,7 +6,7 @@ use crate::api::syscall;
use crate::sys::console;
use crate::sys::fs::OpenFlag;
use crate::sys::net::SocketStatus;
use crate::{debug, usr};
use crate::usr;
use alloc::format;
use alloc::vec;

View File

@ -1,6 +1,6 @@
{
"llvm-target": "x86_64-unknown-none",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
"arch": "x86_64",
"target-endian": "little",
"target-pointer-width": "64",