Skip to content

Internal compiler in Rust 2018 module path resolution #51887

Closed
@joshtriplett

Description

@joshtriplett

With the edition set to 2018, and ansi_term = "*" in [dependencies]:

use ansi_term;
use self::ansi_term::Colour::Red;

fn main() {
    println!("{}", Red.paint("hi"));
}

This produces:

error: internal compiler error: no type-dependent def for method call
 --> src/main.rs:5:20
  |
5 |     println!("{}", Red.paint("hi"));
  |                    ^^^^^^^^^^^^^^^

thread 'main' panicked at 'LocalTableInContext: key not found', libcore/option.rs:960:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error


error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.28.0-nightly (84804c387 2018-06-26) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-2018Area: The 2018 editionC-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.F-rust_2018_preview`#![feature(rust_2018_preview)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions