iddm / serde-aux

An auxiliary serde library providing helpful functions for serialisation and deserialisation for containers, struct fields and others.
MIT License
152 stars 26 forks source link

chore(ci): add a job for `cargo build --no-default-features` #30

Closed hrkrshnn closed 1 year ago

hrkrshnn commented 1 year ago

From https://github.com/vityafx/serde-aux/pull/29#issuecomment-1321215039

Perhaps, I need to add more checks in CI.

If you want to go this route, this can be the minimal CI job that would detect the issue.

hrkrshnn commented 1 year ago

Here's how it would look in the older master:

cargo build --no-default-features                                                                                                   master 
   Compiling serde-aux v4.1.1 (/tmp/serde-aux)
error[E0433]: failed to resolve: use of undeclared crate or module `chrono`
  --> src/field_attributes.rs:60:9
   |
60 |     use chrono::prelude::*;
   |         ^^^^^^ use of undeclared crate or module `chrono`

error[E0433]: failed to resolve: use of undeclared crate or module `chrono`
  --> src/field_attributes.rs:56:13
   |
56 | ) -> Result<chrono::DateTime<chrono::Utc>, D::Error>
   |             ^^^^^^ use of undeclared crate or module `chrono`

error[E0433]: failed to resolve: use of undeclared crate or module `chrono`
  --> src/field_attributes.rs:56:30
   |
56 | ) -> Result<chrono::DateTime<chrono::Utc>, D::Error>
   |                              ^^^^^^ use of undeclared crate or module `chrono`

error[E0433]: failed to resolve: use of undeclared type `DateTime`
  --> src/field_attributes.rs:67:8
   |
67 |     Ok(DateTime::<Utc>::from_utc(
   |        ^^^^^^^^ use of undeclared type `DateTime`

error[E0433]: failed to resolve: use of undeclared type `NaiveDateTime`
  --> src/field_attributes.rs:68:9
   |
68 |         NaiveDateTime::from_timestamp_opt(seconds, nanos)
   |         ^^^^^^^^^^^^^ use of undeclared type `NaiveDateTime`

error[E0412]: cannot find type `Utc` in this scope
  --> src/field_attributes.rs:67:19
   |
54 | pub fn deserialize_datetime_utc_from_milliseconds<'de, D>(
   |                                                         - help: you might be missing a type parameter: `, Utc`
...
67 |     Ok(DateTime::<Utc>::from_utc(
   |                   ^^^ not found in this scope

error[E0425]: cannot find value `Utc` in this scope
  --> src/field_attributes.rs:70:9
   |
70 |         Utc,
   |         ^^^ not found in this scope

Some errors have detailed explanations: E0412, E0425, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `serde-aux` due to 7 previous errors
iddm commented 1 year ago

Thanks! I thought I had it but it seems in another project :-)