Skip to content

Putting &mut Trait in a struct causes an ICE #8249

Closed

Description

This code

trait A {}
struct B;
impl A for B {}

struct C<'self> {
    foo: &'self mut A,
}

fn foo(a: &mut A) {
    C{ foo: a };
}

fn main() {
}

fails with this message:

foo.rs:10:12: 10:13 error: internal compiler error: Cannot relate bound region as subregion: br_self                                                
foo.rs:10     C{ foo: a };                                                                                                                          
                      ^                                                                                                                             

cc @msullivan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions