Skip to content

Ambiguous name error with assert! macro #1597

Open

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 [email protected]
    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]
    | ^^^^^^^^^^^^

Activity

  1. added
    [C] Bug
    on Aug 26, 2022
  2. added theissue type on Apr 1, 2026
  3. added
    [F] Spurious Failure
    Z-Kani Compiler
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Z-Kani Compiler[C] Bug[F] Spurious Failure

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions