Skip to content

cargo test --no-default-features fails #64

@wetneb

Description

@wetneb

When running cargo test --no-default-features, I get:

error[E0433]: cannot find `std` in the crate root
   --> src/string.rs:29:15
    |
 29 |         use ::std::fmt::Write;
    |               ^^^ could not find `std` in the list of imported crates
...
608 |         eco_format!("{self}")
    |         --------------------- in this macro invocation
    |
    = note: this error originates in the macro `eco_format` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: cannot find `std` in the crate root
   --> src/string.rs:31:11
    |
 31 |         ::std::write!(s, $($tts)*).unwrap();
    |           ^^^ could not find `std` in the list of imported crates
...
608 |         eco_format!("{self}")
    |         --------------------- in this macro invocation
    |
    = note: this error originates in the macro `eco_format` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0425]: cannot find type `Vec` in this scope
  --> src/vendor/vec/splice.rs:90:54
   |
90 | ...h.by_ref().collect::<Vec<I::Item>>().into_iter();
   |                         ^^^ not found in this scope
   |
note: found an item that was configured out
  --> src/lib.rs:58:45
   |
57 | #[cfg(doc)]
   |       --- the item is gated here
58 | use alloc::{string::String, sync::Arc, vec::Vec};
   |                                             ^^^
help: consider importing this struct
   |
 5 + use alloc::vec::Vec;
   |

It would be convenient if the tests that depend on the std feature could be gated as such.
It could make sense to add cargo test --all-targets --no-default-features to the CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions