Skip to content

extern crate foo as core breaks resolution in macros #64364

@tmandry

Description

@tmandry
Member

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

Activity

changed the title [-]`extern crate foo as core` breaks format macros[/-] [+]`extern crate foo as core` breaks resolution in macros[/+] on Sep 10, 2019
petrochenkov

petrochenkov commented on Sep 10, 2019

@petrochenkov
Contributor

Duplicate of #63687, fixed in #64060.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jonas-schievink@tmandry@petrochenkov

        Issue actions

          `extern crate foo as core` breaks resolution in macros · Issue #64364 · rust-lang/rust