From 02a9b2cb7180a35fc46f168cf0ae2866e8785d70 Mon Sep 17 00:00:00 2001 From: Victor Koenders Date: Sun, 17 Oct 2021 17:21:20 +0200 Subject: [PATCH] Made the test stage throw an error on warnings --- .github/workflows/rust.yml | 5 ++++- src/features/impl_alloc.rs | 4 +++- tests/alloc.rs | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c8845b2..81ce5b6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -100,7 +100,10 @@ }, { "run": "cargo test-all-features", - "name": "Run `cargo test` on all features" + "name": "Run `cargo test` on all features", + "env": { + "RUSTFLAGS": "-D warnings" + } } ] }, diff --git a/src/features/impl_alloc.rs b/src/features/impl_alloc.rs index 64aca51..d146b4f 100644 --- a/src/features/impl_alloc.rs +++ b/src/features/impl_alloc.rs @@ -5,7 +5,9 @@ use crate::{ error::{DecodeError, EncodeError}, Config, }; -use alloc::{borrow::Cow, boxed::Box, collections::*, rc::Rc, string::String, sync::Arc, vec::Vec}; +#[cfg(feature = "atomic")] +use alloc::sync::Arc; +use alloc::{borrow::Cow, boxed::Box, collections::*, rc::Rc, string::String, vec::Vec}; #[derive(Default)] struct VecWriter { diff --git a/tests/alloc.rs b/tests/alloc.rs index e3af915..b8d17cf 100644 --- a/tests/alloc.rs +++ b/tests/alloc.rs @@ -7,6 +7,7 @@ mod utils; use alloc::borrow::Cow; use alloc::collections::*; use alloc::rc::Rc; +#[cfg(feature = "atomic")] use alloc::sync::Arc; use utils::{the_same, the_same_with_comparer};