Skip to content

opaque type structurally_resolve_type breakage #231

@lcnr

Description

@lcnr
use std::ops::{Deref, Index};
fn deref_no_target() -> impl Deref {
    if false {
        let _ = *deref_no_target();
    }
    &()
}

fn deref_with_target() -> impl Deref<Target = ()> {
    if false {
        let () = *deref_with_target();
    }
    &()
}

fn field_autoderef() -> impl Deref<Target = ((),)> {
    if false {
        let () = field_autoderef().0;
    }
    &((),)
}

fn index() -> impl Index<usize, Output = u32> {
    if false {
        assert_eq!(index()[0], 1);
    }
    [1]
}

fn index_autoderef() -> impl Deref<Target = [u8; 3]> {
    if false {
        assert_eq!(index_autoderef()[1], 1);
    }
    &[0, 1, 2]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    potentially irrelevant

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions