Skip to content

1.1.0: glob imports break re-exporting a crate #26930

@emidoots

Description

@emidoots

cargo new mycrate

Add to Cargo.toml:

[dependencies]
num = "*"

Make empty x.rs file: touch mycrate/src/x.rs

Contents of mycrate/src/lib.rs:

extern crate num;
use num as num_export;
use self::x::*;
$ cargo build
   Compiling issue v0.1.0 (file:///home/stephen/Desktop/rust/issue)
src/lib.rs:2:5: 2:22 error: unresolved import (maybe you meant `num as num_export::*`?)
src/lib.rs:2 use num as num_export;
                 ^~~~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `issue`.

To learn more, run the command again with --verbose.

Try removing the use self::x::*; line and everything will work just fine.

  • OS: Ubuntu 15.04 (beta)
  • rustc --version: rustc 1.1.0 (35ceea399 2015-06-19)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    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