From 02a5a88946edbea92fb6660e4898c4ef2a7d9b6c Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Wed, 9 Feb 2022 19:25:36 +0300 Subject: [PATCH] Fix warnings when building only with Wayland feature This commit also makes our CI fail hard when warning encountered when building only for either Wayland or X11. --- .builds/freebsd.yml | 4 ++-- .builds/linux.yml | 4 ++-- alacritty/src/main.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml index ba863a55..e9b25be2 100644 --- a/.builds/freebsd.yml +++ b/.builds/freebsd.yml @@ -33,7 +33,7 @@ tasks: cargo clippy --all-targets - feature-wayland: | cd alacritty/alacritty - cargo test --no-default-features --features=wayland + RUSTFLAGS="-D warnings" cargo test --no-default-features --features=wayland - feature-x11: | cd alacritty/alacritty - cargo test --no-default-features --features=x11 + RUSTFLAGS="-D warnings" cargo test --no-default-features --features=x11 diff --git a/.builds/linux.yml b/.builds/linux.yml index c23375f5..d610d123 100644 --- a/.builds/linux.yml +++ b/.builds/linux.yml @@ -36,7 +36,7 @@ tasks: cargo clippy --all-targets - feature-wayland: | cd alacritty/alacritty - cargo test --no-default-features --features=wayland + RUSTFLAGS="-D warnings" cargo test --no-default-features --features=wayland - feature-x11: | cd alacritty/alacritty - cargo test --no-default-features --features=x11 + RUSTFLAGS="-D warnings" cargo test --no-default-features --features=x11 diff --git a/alacritty/src/main.rs b/alacritty/src/main.rs index 70991871..368151b4 100644 --- a/alacritty/src/main.rs +++ b/alacritty/src/main.rs @@ -20,7 +20,7 @@ use std::string::ToString; use std::{fs, process}; use glutin::event_loop::EventLoop as GlutinEventLoop; -#[cfg(not(any(target_os = "macos", windows)))] +#[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))] use glutin::platform::unix::EventLoopWindowTargetExtUnix; use log::info; #[cfg(windows)]