wl: silence unused code warnings

When wl-dmabuf is not enabled, rustc complains about unused imports and
enum values.  Add compiler directives to silence the warnings.

BUG=None
TEST='cargo build', 'emerge-nami crosvm'

Change-Id: Ib39735d329f8aa835c0b5842b10bfe78d0e578d9
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1327827
This commit is contained in:
Daniel Verkamp 2018-11-08 16:12:18 -08:00 committed by chrome-bot
parent d32efefb7a
commit 6bfee45131
2 changed files with 3 additions and 0 deletions

View file

@ -57,6 +57,7 @@ use data_model::VolatileMemoryError;
use data_model::*;
use msg_socket::{MsgError, MsgReceiver, MsgSender, MsgSocket};
#[cfg(feature = "wl-dmabuf")]
use resources::GpuMemoryDesc;
use sys_util::{
pipe, round_up_to_page_size, Error, EventFd, FileFlags, GuestAddress, GuestMemory,
@ -403,6 +404,7 @@ fn encode_resp(desc_mem: VolatileSlice, resp: WlResp) -> WlResult<u32> {
}
}
#[allow(dead_code)]
#[derive(Debug)]
enum WlError {
NewAlloc(Error),

View file

@ -12,6 +12,7 @@ use gpu_buffer;
use msg_socket::MsgOnSocket;
use sys_util;
#[allow(dead_code)]
#[derive(Debug)]
pub enum GpuAllocatorError {
OpenGpuBufferDevice,