Skip to content

ICE with incorrect turbofish #60989

Closed
Closed
@cramertj

Description

@cramertj
struct A{}
struct B{}

impl From<A> for B {
    fn from(a: A) -> B {
        B{}
    }
}

fn main() {
    let c1 = A{};
    let c2: B = c1::<Into<B>>.into();
    let _ = c2;
}

gives

error: internal compiler error: src/librustc_typeck/check/mod.rs:2456: no type for node 48: type B (hir_id=HirId { owner: DefIndex(16), local_id: 13 }) in fcx 0x7f3fb3fec990

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:637:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error


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.36.0-nightly (6afcb5628 2019-05-19) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions