Skip to content

[lifetime-generate] Crash on assertion failure: generic_bounds.len() == 0 #1296

@zhengyao-lin

Description

@zhengyao-lin

I was trying to define some traits similar to an iterator, but encountered this isssue (https://play.verus-lang.org/?version=stable&mode=basic&edition=2021&gist=ff5d6a560097dc550a07be84b688629a)

pub trait A {
    type Iter<'a>: B<'a, E = Self::E> where Self: 'a;
    type E;
    
    fn things<'a>(&'a mut self) -> Result<Self::Iter<'a>, Self::E>;
}

pub trait B<'a> {
    type E;
}
thread 'rustc' panicked at rust_verify/src/lifetime_generate.rs:2292:17:
assertion failed: generic_bounds.len() == 0

I think it's probably due to the bound Self: 'a?

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

    Issue actions