Skip to content

std uses a Thin trait alias which breaks mir eval #15566

@Veykril

Description

@Veykril

https://doc.rust-lang.org/std/ptr/fn.null_mut.html is defined as:

pub const fn null_mut<T: ?Sized + Thin>() -> *mut T;

where Thin is defined as:

pub trait Thin = Pointee<Metadata = ()>;

r-a currently does not handle trait aliases correctly, as such mir eval bails out on almost all code that does Vec allocations via Vec::with_capacity because we lack the knowledge that Metadata = () in null_mut resulting in a Expected <T as Pointee>::Metadata, found () error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mirA-tytype system / type inference / traits / method resolutionC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions