Skip to content

Commit 3c4d2d8

Browse files
use dyn for trait objects
When switching to Rust 1.38 trait objects without an explicit `dyn` are deprecated. Signed-off-by: Andreea Florescu <[email protected]>
1 parent ec9a824 commit 3c4d2d8

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

devices/src/virtio/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ mod tests {
670670
struct DummyBlock {
671671
block: Block,
672672
epoll_raw_fd: i32,
673-
_receiver: Receiver<Box<EpollHandler>>,
673+
_receiver: Receiver<Box<dyn EpollHandler>>,
674674
}
675675

676676
impl DummyBlock {

devices/src/virtio/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ mod tests {
980980
struct DummyNet {
981981
net: Net,
982982
epoll_raw_fd: i32,
983-
_receiver: Receiver<Box<EpollHandler>>,
983+
_receiver: Receiver<Box<dyn EpollHandler>>,
984984
}
985985

986986
impl DummyNet {

devices/src/virtio/vsock/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ mod tests {
282282
pub device: Vsock<TestBackend>,
283283

284284
// This needs to live here, so that sending the handler, at device activation, works.
285-
_handler_receiver: mpsc::Receiver<Box<EpollHandler>>,
285+
_handler_receiver: mpsc::Receiver<Box<dyn EpollHandler>>,
286286
}
287287

288288
impl TestContext {

net_util/src/tap.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,9 @@ mod tests {
442442
// For a given interface name, this returns a tuple that contains the MAC address of the
443443
// interface, an object that can be used to send Ethernet frames, and a receiver of
444444
// Ethernet frames arriving at the specified interface.
445-
fn pnet_get_mac_tx_rx(ifname: String) -> (MacAddr, Box<DataLinkSender>, Box<DataLinkReceiver>) {
445+
fn pnet_get_mac_tx_rx(
446+
ifname: String,
447+
) -> (MacAddr, Box<dyn DataLinkSender>, Box<dyn DataLinkReceiver>) {
446448
let interface_name_matches = |iface: &NetworkInterface| iface.name == ifname;
447449

448450
// Find the network interface with the provided name.

0 commit comments

Comments
 (0)