Skip to content

Ambiguous name error with assert! macro #1597

@tedinski

Description

@tedinski

The current version of the futures library builds fine. But many crates seem to have compat features to enable cross-compatibility with the 0.1 version of the futures library. This version does something odd that creates build failures.

$ cargo new futures-old
     Created binary (application) `futures-old` package
$ cd futures-old/
$ cargo add futures@0.1
    Updating crates.io index
      Adding futures v0.1 to dependencies.
             Features:
             + use_std
$ cargo kani
   Compiling futures v0.1.31
error[E0659]: `assert` is ambiguous
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.31/src/future/select_all.rs:41:5
    |
41  |     assert!(ret.inner.len() > 0);
    |     ^^^^^^ ambiguous name
    |
    = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
note: `assert` could refer to the macro imported here
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.31/src/future/select_all.rs:5:5
    |
5   | use std::prelude::v1::*;
    |     ^^^^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `assert` to disambiguate
    = help: or use `self::assert` to refer to this macro unambiguously
note: `assert` could also refer to the macro imported here
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.31/src/lib.rs:163:1
    |
163 | #[macro_use]
    | ^^^^^^^^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    [C] BugThis is a bug. Something isn't working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions