Skip to content

Does not build with time feature and --cfg loom #2463

@faern

Description

@faern

Version

0.2.20 and latest git

Platform

macOS

Description

I'm using loom as recommended in the loom docs: by setting RUSTFLAGS="--cfg loom". This causes tokio to not compile if the time feature is activated. Can be reproduced by just creating an empty crate and adding tokio as a dependency:

[dependencies]
tokio = { version = "0.2.20", features = ["time"] }
$ RUSTFLAGS="--cfg loom" cargo build
...
error[E0432]: unresolved import `crate::sync::AtomicWaker`
 --> /Users/faern/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.20/src/time/driver/entry.rs:2:5
  |
2 | use crate::sync::AtomicWaker;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^ no `AtomicWaker` in `sync`

I assume crates depending on tokio should be able to use loom so I guess this is not intentional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tokioArea: The main tokio crateC-questionUser questions that are neither feature requests nor bug reports

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions