Skip to content

Commit 461c752

Browse files
committed
Various minor fixes for rust 1.79.0
Signed-off-by: Sergio López <[email protected]>
1 parent b79f690 commit 461c752

File tree

9 files changed

+16
-10
lines changed

9 files changed

+16
-10
lines changed

src/arch/src/x86_64/mptable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const MPC_SIGNATURE: [c_char; 4] = char_array!(c_char; 'P', 'C', 'M', 'P');
9090
const MPC_SPEC: i8 = 4;
9191
const MPC_OEM: [c_char; 8] = char_array!(c_char; 'F', 'C', ' ', ' ', ' ', ' ', ' ', ' ');
9292
const MPC_PRODUCT_ID: [c_char; 12] = ['0' as c_char; 12];
93-
const BUS_TYPE_ISA: [u8; 6] = char_array!(u8; 'I', 'S', 'A', ' ', ' ', ' ');
93+
const BUS_TYPE_ISA: [u8; 6] = char_array!(u8; b'I', b'S', b'A', b' ', b' ', b' ');
9494
const IO_APIC_DEFAULT_PHYS_BASE: u32 = 0xfec0_0000; // source: linux/arch/x86/include/asm/apicdef.h
9595
const APIC_DEFAULT_PHYS_BASE: u32 = 0xfee0_0000; // source: linux/arch/x86/include/asm/apicdef.h
9696
const APIC_VERSION: u8 = 0x14;

src/devices/src/virtio/block/worker.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use utils::eventfd::EventFd;
1616
use virtio_bindings::virtio_blk::*;
1717
use vm_memory::{ByteValued, GuestMemoryMmap};
1818

19+
#[allow(dead_code)]
1920
#[derive(Debug)]
2021
pub enum RequestError {
2122
FlushingToDisk(io::Error),

src/devices/src/virtio/fs/filesystem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub trait ZeroCopyReader {
175175
fn copy_to_end(&mut self, f: &mut File, mut off: u64) -> io::Result<usize> {
176176
let mut out = 0;
177177
loop {
178-
match self.read_to(f, ::std::usize::MAX, off) {
178+
match self.read_to(f, usize::MAX, off) {
179179
Ok(0) => return Ok(out),
180180
Ok(n) => {
181181
off = off.saturating_add(n as u64);
@@ -268,7 +268,7 @@ pub trait ZeroCopyWriter {
268268
fn copy_to_end(&mut self, f: &mut File, mut off: u64) -> io::Result<usize> {
269269
let mut out = 0;
270270
loop {
271-
match self.write_from(f, ::std::usize::MAX, off) {
271+
match self.write_from(f, usize::MAX, off) {
272272
Ok(0) => return Ok(out),
273273
Ok(n) => {
274274
off = off.saturating_add(n as u64);

src/devices/src/virtio/fs/linux/passthrough.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,13 +1120,13 @@ impl FileSystem for PassthroughFs {
11201120
attr.st_uid
11211121
} else {
11221122
// Cannot use -1 here because these are unsigned values.
1123-
::std::u32::MAX
1123+
u32::MAX
11241124
};
11251125
let gid = if valid.contains(SetattrValid::GID) {
11261126
attr.st_gid
11271127
} else {
11281128
// Cannot use -1 here because these are unsigned values.
1129-
::std::u32::MAX
1129+
u32::MAX
11301130
};
11311131

11321132
// Safe because this is a constant value and a valid C string.

src/devices/src/virtio/fs/macos/passthrough.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,13 +1169,13 @@ impl FileSystem for PassthroughFs {
11691169
attr.st_uid
11701170
} else {
11711171
// Cannot use -1 here because these are unsigned values.
1172-
::std::u32::MAX
1172+
u32::MAX
11731173
};
11741174
let gid = if valid.contains(SetattrValid::GID) {
11751175
attr.st_gid
11761176
} else {
11771177
// Cannot use -1 here because these are unsigned values.
1178-
::std::u32::MAX
1178+
u32::MAX
11791179
};
11801180

11811181
set_xattr_stat(StatFile::Path(&c_path), Some((uid, gid)), None)?;

src/devices/src/virtio/fs/server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,8 +880,8 @@ impl<F: FileSystem + Sync> Server<F> {
880880
minor: KERNEL_MINOR_VERSION,
881881
max_readahead,
882882
flags: enabled as u32,
883-
max_background: ::std::u16::MAX,
884-
congestion_threshold: (::std::u16::MAX / 4) * 3,
883+
max_background: u16::MAX,
884+
congestion_threshold: (u16::MAX / 4) * 3,
885885
max_write: MAX_BUFFER_SIZE,
886886
time_gran: 1, // nanoseconds
887887
max_pages: max_pages.try_into().unwrap(),
@@ -1432,7 +1432,7 @@ fn add_dirent(
14321432
d: DirEntry,
14331433
entry: Option<Entry>,
14341434
) -> io::Result<usize> {
1435-
if d.name.len() > ::std::u32::MAX as usize {
1435+
if d.name.len() > u32::MAX as usize {
14361436
return Err(io::Error::from_raw_os_error(libc::EOVERFLOW));
14371437
}
14381438

src/devices/src/virtio/net/backend.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::os::fd::RawFd;
22

3+
#[allow(dead_code)]
34
#[derive(Debug)]
45
pub enum ConnectError {
56
InvalidAddress(nix::Error),
@@ -8,6 +9,7 @@ pub enum ConnectError {
89
SendingMagic(nix::Error),
910
}
1011

12+
#[allow(dead_code)]
1113
#[derive(Debug)]
1214
pub enum ReadError {
1315
/// Nothing was written
@@ -16,6 +18,7 @@ pub enum ReadError {
1618
Internal(nix::Error),
1719
}
1820

21+
#[allow(dead_code)]
1922
#[derive(Debug)]
2023
pub enum WriteError {
2124
/// Nothing was written, you can drop the frame or try to resend it later

src/devices/src/virtio/vsock/proxy.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub enum RecvPkt {
1414
WaitForCredit,
1515
}
1616

17+
#[allow(dead_code)]
1718
#[derive(Debug)]
1819
pub enum ProxyError {
1920
CreatingSocket(nix::errno::Errno),

src/rutabaga_gfx/src/renderer_utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub fn ret_to_res(ret: i32) -> RutabagaResult<()> {
2828
}
2929
}
3030

31+
#[allow(dead_code)]
3132
pub struct RutabagaCookie {
3233
pub render_server_fd: Option<SafeDescriptor>,
3334
pub fence_handler: Option<RutabagaFenceHandler>,

0 commit comments

Comments
 (0)