Skip to content

extern crate foo as core breaks resolution in macros #64364

@tmandry

Description

@tmandry

Broken in a recent nightly. Reproducer (playground):

extern crate futures as core;

fn bar() {
    let _ = format!("{}", 42);
}

Gives the following:

error[E0433]: failed to resolve: could not find `format_args` in `core`
 --> src/lib.rs:4:13
  |
4 |     let _ = format!("{}", 42);
  |             ^^^^^^^^^^^^^^^^^ could not find `format_args` in `core`
  |
  = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

I've also observed this if a crate is named core and gets used without any extern crate items.

modules named core do not trigger this, only crates.

Seen in the wild: gfx-rs/gfx#2964

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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