Skip to content

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

Closed

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)

Activity

  1. dwrensha commented on Mar 13, 2014

    @dwrensha
    ContributorAuthor
  2. Kimundi commented on Mar 20, 2014

    @Kimundi
    Contributor

    Another testcase:

    trait RefIterable<T> {
        fn refs<'a, Iter: Iterator<&'a T>>(&'a self) -> Iter;
    }
    fn main() {}
    
    error: internal compiler error: No inferred index entry for unknown node (id=18)
    note: the compiler hit an unexpected failure path. this is a bug.
    note: we would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
    note: run with `RUST_BACKTRACE=1` for a backtrace
    task 'rustc' failed at '~Any', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:123
    
  3. nikomatsakis commented on Apr 2, 2014

    @nikomatsakis
    Contributor

    cc me

  4. added a commit that references this issue on Apr 17, 2014
    99c258c
  5. dwrensha commented on Apr 17, 2014

    @dwrensha
    ContributorAuthor

    Thanks for fixing!

    As far as I know, now #12857 is the only thing preventing capnproto-rust from having a safe interface.

  6. added a commit that references this issue on Jul 26, 2022
  7. added 2 commits that reference this issue on Jul 28, 2024
    c6cc160
    062b66d
  8. added 2 commits that reference this issue on Aug 26, 2024
    034ec97
    4a19353
  9. added a commit that references this issue on Sep 3, 2024
    ba20c8c
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions