Skip to content

ICE on trait method with type parameter bounded by trait with lifetime parameter #12856

Closed
@dwrensha

Description

@dwrensha

I think this relates to #12807 and #5121.

The following program causes rustc to crash:

// lifetimes_bug.rs
use std;

pub struct StructReader<'a> {
    marker : std::kinds::marker::ContravariantLifetime<'a>,
}

pub trait FromStructReader<'a> {
    fn new(struct_reader : StructReader<'a>) -> Self;
}

pub trait MessageReader {
    fn get_root<'a, T :FromStructReader<'a>>(&'a self) -> T;
}

pub fn main () {}
$ rustc lifetimes_bug.rs 
error: internal compiler error: No inferred index entry for unknown node (id=31)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions