Skip to content

Commit ce9435f

Browse files
committed
Fix additional warnings on beta toolchain
1 parent 9cb807a commit ce9435f

13 files changed

Lines changed: 2759 additions & 2761 deletions

File tree

.azure-pipelines.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ strategy:
77
rustup_toolchain: stable
88
beta:
99
rustup_toolchain: beta
10-
nightly:
11-
rustup_toolchain: nightly
1210

1311
steps:
1412
- script: |

blocks/data/1.13.2.dat

0 Bytes
Binary file not shown.

blocks/src/blocks.rs

Lines changed: 2723 additions & 2723 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blocks/src/mappings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub struct VersionedMappings {
7272
}
7373

7474
/// Loads a versioned mappings file.
75-
pub fn load_versioned(bytes: &[u8]) -> Result<VersionedMappings, Error> {
75+
pub fn _load_versioned(bytes: &[u8]) -> Result<VersionedMappings, Error> {
7676
let mut cursor = Cursor::new(bytes);
7777

7878
let header = read_header(&mut cursor)?;

codegen/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ pub fn derive_packet(_item: TokenStream) -> TokenStream {
184184

185185
let r = quote! {
186186
impl Packet for #ident {
187-
fn read_from(&mut self, mut buf: &mut PacketBuf) -> Result<(), ()> {
187+
fn read_from(&mut self, mut buf: &mut dyn PacketBuf) -> Result<(), ()> {
188188
#(#read_code)*
189189
Ok(())
190190
}

core/src/network/packet/implementation.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub struct Handshake {
9090
}
9191

9292
impl Packet for Handshake {
93-
fn read_from(&mut self, mut buf: &mut PacketBuf) -> Result<(), ()> {
93+
fn read_from(&mut self, mut buf: &mut dyn PacketBuf) -> Result<(), ()> {
9494
self.protocol_version = buf.read_var_int().unwrap() as u32;
9595
self.server_address = buf.read_string()?;
9696
self.server_port = buf.get_u16_be();
@@ -140,7 +140,7 @@ pub struct EncryptionResponse {
140140
}
141141

142142
impl Packet for EncryptionResponse {
143-
fn read_from(&mut self, mut buf: &mut PacketBuf) -> Result<(), ()> {
143+
fn read_from(&mut self, mut buf: &mut dyn PacketBuf) -> Result<(), ()> {
144144
self.secret_length = buf.read_var_int()?;
145145

146146
let mut secret = vec![];
@@ -250,7 +250,7 @@ pub struct PluginMessageServerbound {
250250
}
251251

252252
impl Packet for PluginMessageServerbound {
253-
fn read_from(&mut self, mut buf: &mut PacketBuf) -> Result<(), ()> {
253+
fn read_from(&mut self, mut buf: &mut dyn PacketBuf) -> Result<(), ()> {
254254
self.channel = buf.read_string()?;
255255

256256
let mut data = Vec::with_capacity(buf.remaining());
@@ -289,7 +289,7 @@ pub struct UseEntity {
289289
}
290290

291291
impl Packet for UseEntity {
292-
fn read_from(&mut self, mut buf: &mut PacketBuf) -> Result<(), ()> {
292+
fn read_from(&mut self, mut buf: &mut dyn PacketBuf) -> Result<(), ()> {
293293
self.target = buf.read_var_int()?;
294294

295295
let ty_id = buf.read_var_int()?;
@@ -408,7 +408,7 @@ pub struct PlayerDigging {
408408
}
409409

410410
impl Packet for PlayerDigging {
411-
fn read_from(&mut self, mut buf: &mut PacketBuf) -> Result<(), ()> {
411+
fn read_from(&mut self, mut buf: &mut dyn PacketBuf) -> Result<(), ()> {
412412
self.status = {
413413
let id = buf.read_var_int()?;
414414
match id {
@@ -598,7 +598,7 @@ pub struct EncryptionRequest {
598598
}
599599

600600
impl Packet for EncryptionRequest {
601-
fn read_from(&mut self, mut buf: &mut PacketBuf) -> Result<(), ()> {
601+
fn read_from(&mut self, mut buf: &mut dyn PacketBuf) -> Result<(), ()> {
602602
unimplemented!()
603603
}
604604

@@ -715,7 +715,7 @@ pub struct SpawnPlayer {
715715
}
716716

717717
impl Packet for SpawnPlayer {
718-
fn read_from(&mut self, buf: &mut PacketBuf) -> Result<(), ()> {
718+
fn read_from(&mut self, buf: &mut dyn PacketBuf) -> Result<(), ()> {
719719
unimplemented!()
720720
}
721721

@@ -749,7 +749,7 @@ pub struct Statistics {
749749
}
750750

751751
impl Packet for Statistics {
752-
fn read_from(&mut self, buf: &mut PacketBuf) -> Result<(), ()> {
752+
fn read_from(&mut self, buf: &mut dyn PacketBuf) -> Result<(), ()> {
753753
unimplemented!()
754754
}
755755

@@ -802,7 +802,7 @@ pub struct BossBar {
802802
}
803803

804804
impl Packet for BossBar {
805-
fn read_from(&mut self, buf: &mut PacketBuf) -> Result<(), ()> {
805+
fn read_from(&mut self, buf: &mut dyn PacketBuf) -> Result<(), ()> {
806806
unimplemented!()
807807
}
808808

@@ -966,7 +966,7 @@ pub struct PluginMessageClientbound {
966966
}
967967

968968
impl Packet for PluginMessageClientbound {
969-
fn read_from(&mut self, buf: &mut PacketBuf) -> Result<(), ()> {
969+
fn read_from(&mut self, buf: &mut dyn PacketBuf) -> Result<(), ()> {
970970
unimplemented!()
971971
}
972972

@@ -1022,7 +1022,7 @@ pub struct Explosion {
10221022
}
10231023

10241024
impl Packet for Explosion {
1025-
fn read_from(&mut self, buf: &mut PacketBuf) -> Result<(), ()> {
1025+
fn read_from(&mut self, buf: &mut dyn PacketBuf) -> Result<(), ()> {
10261026
unimplemented!()
10271027
}
10281028

@@ -1073,7 +1073,7 @@ pub struct ChunkData {
10731073
}
10741074

10751075
impl Packet for ChunkData {
1076-
fn read_from(&mut self, buf: &mut PacketBuf) -> Result<(), ()> {
1076+
fn read_from(&mut self, buf: &mut dyn PacketBuf) -> Result<(), ()> {
10771077
unimplemented!()
10781078
}
10791079

@@ -1243,7 +1243,7 @@ pub struct CombatEvent {
12431243
}
12441244

12451245
impl Packet for CombatEvent {
1246-
fn read_from(&mut self, buf: &mut PacketBuf) -> Result<(), ()> {
1246+
fn read_from(&mut self, buf: &mut dyn PacketBuf) -> Result<(), ()> {
12471247
unimplemented!()
12481248
}
12491249

@@ -1287,7 +1287,7 @@ pub struct PlayerInfo {
12871287
}
12881288

12891289
impl Packet for PlayerInfo {
1290-
fn read_from(&mut self, buf: &mut PacketBuf) -> Result<(), ()> {
1290+
fn read_from(&mut self, buf: &mut dyn PacketBuf) -> Result<(), ()> {
12911291
unimplemented!()
12921292
}
12931293

@@ -1384,7 +1384,7 @@ pub struct DestroyEntities {
13841384
}
13851385

13861386
impl Packet for DestroyEntities {
1387-
fn read_from(&mut self, buf: &mut PacketBuf) -> Result<(), ()> {
1387+
fn read_from(&mut self, buf: &mut dyn PacketBuf) -> Result<(), ()> {
13881388
unimplemented!()
13891389
}
13901390

core/src/network/packet/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@ pub trait PacketBuf: Buf + Read {}
1212
impl<T: Buf + Read> PacketBuf for T {}
1313

1414
pub trait AsAny {
15-
fn as_any(&self) -> &Any;
15+
fn as_any(&self) -> &dyn Any;
1616
}
1717

1818
pub trait Packet: AsAny + Send {
19-
fn read_from(&mut self, buf: &mut PacketBuf) -> Result<(), ()>;
19+
fn read_from(&mut self, buf: &mut dyn PacketBuf) -> Result<(), ()>;
2020
fn write_to(&self, buf: &mut ByteBuf);
2121
fn ty(&self) -> PacketType;
2222
}
2323

2424
#[derive(Clone, Debug)]
2525
pub struct PacketBuilder {
26-
pub init_fn: fn() -> Box<Packet>,
26+
pub init_fn: fn() -> Box<dyn Packet>,
2727
}
2828

2929
impl PacketBuilder {
30-
pub fn build(&self) -> Box<Packet> {
30+
pub fn build(&self) -> Box<dyn Packet> {
3131
let f = self.init_fn;
3232
f()
3333
}
3434

35-
pub fn with(f: fn() -> Box<Packet>) -> Self {
35+
pub fn with(f: fn() -> Box<dyn Packet>) -> Self {
3636
Self { init_fn: f }
3737
}
3838
}

core/src/network/serialize.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct ConnectionIOManager {
1717
compression_enabled: bool,
1818
compression_threshold: usize,
1919

20-
pending_received_packets: Option<Vec<Box<Packet>>>,
20+
pending_received_packets: Option<Vec<Box<dyn Packet>>>,
2121

2222
incoming_compressed: ByteBuf,
2323
incoming_uncompressed: ByteBuf,
@@ -185,7 +185,7 @@ impl ConnectionIOManager {
185185
Ok(())
186186
}
187187

188-
pub fn serialize_packet(&mut self, packet: Box<Packet>) -> ByteBuf {
188+
pub fn serialize_packet(&mut self, packet: Box<dyn Packet>) -> ByteBuf {
189189
if packet.ty() == PacketType::LoginSuccess {
190190
self.stage = PacketStage::Play;
191191
}
@@ -277,7 +277,7 @@ impl ConnectionIOManager {
277277
}
278278
}
279279

280-
pub fn take_pending_packets(&mut self) -> Vec<Box<Packet>> {
280+
pub fn take_pending_packets(&mut self) -> Vec<Box<dyn Packet>> {
281281
self.pending_received_packets.replace(vec![]).unwrap()
282282
}
283283
}

generators/blocks/src/rust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ fn generate_from_internal_state_id_fn(report: &BlockReport) -> TokenStream {
592592
let data_struct_ident = Ident::new(&data_struct_str, Span::call_site());
593593

594594
match_arms.push(quote! {
595-
#range_start...#range_end => {
595+
#range_start..=#range_end => {
596596
let offset = id - #range_start;
597597
let data = #data_struct_ident::from_value(offset)?;
598598
Some(Block::#variant_ident(data))

server/src/io/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ mod worker;
1515
pub struct Client(usize);
1616

1717
pub enum ServerToWorkerMessage {
18-
SendPacket(Box<Packet>),
19-
NotifyPacketReceived(Box<Packet>),
18+
SendPacket(Box<dyn Packet>),
19+
NotifyPacketReceived(Box<dyn Packet>),
2020
NotifyDisconnect,
2121
Disconnect,
2222
}

0 commit comments

Comments
 (0)