Skip to content

internal compiler error with impl Aaa for &mut Aaa #17771

Closed
@stepancheg

Description

@stepancheg

Code:

trait Aaa {}

impl<'a> Aaa for &'a mut Aaa + 'a {}

struct Bar<'a> {
    writer: &'a mut Aaa + 'a,
}

fn baz(_: &mut Aaa) {
}

fn foo<'a>(mut bar: Bar<'a>) {
    baz(&mut bar.writer);
}

fn main() {
}
error: internal compiler error: trying to take the sizing type of Aaa+'a, an unsized type

Metadata

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.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions