Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Fix unused import warnings in test under cfg miri
Browse files Browse the repository at this point in the history
    error: unused imports: `SeqAccess`, `Visitor`
     --> tests/test_error.rs:4:30
      |
    4 | use serde::de::{Deserialize, SeqAccess, Visitor};
      |                              ^^^^^^^^^  ^^^^^^^
      |
      = note: `-D unused-imports` implied by `-D warnings`

    error: unused import: `std::collections::BTreeMap`
     --> tests/test_error.rs:8:5
      |
    8 | use std::collections::BTreeMap;
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

    error: unused import: `self`
     --> tests/test_error.rs:9:16
      |
    9 | use std::fmt::{self, Debug};
      |                ^^^^

    error: miri cannot be run on programs that fail compilation
  • Loading branch information
dtolnay committed May 12, 2023
1 parent 2037c7e commit 622553f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_error.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#![allow(clippy::zero_sized_map_values)]

use indoc::indoc;
use serde::de::{Deserialize, SeqAccess, Visitor};
use serde::de::Deserialize;
#[cfg(not(miri))]
use serde::de::{SeqAccess, Visitor};
use serde_derive::{Deserialize, Serialize};
use serde_yaml::value::{Tag, TaggedValue};
use serde_yaml::{Deserializer, Value};
#[cfg(not(miri))]
use std::collections::BTreeMap;
use std::fmt::{self, Debug};
#[cfg(not(miri))]
use std::fmt;
use std::fmt::Debug;

fn test_error<'de, T>(yaml: &'de str, expected: &str)
where
Expand Down

0 comments on commit 622553f

Please # to comment.