Skip to content

add function prototypes #6

@nikomatsakis

Description

@nikomatsakis

Currently the IR includes only "use" statements, which are meant to model opaque functions. It'd be nice to replace those with function prototypes. You would give a signature like:

fn foo<...>(T1..Tn) -> Tr;

then you would write:

x = foo<..>(y, z);

and we would instantiate the function signature, add the constraints that all of the types/regions must outlive this point, and create the relevant subtyping relations, all in one step.

One can still model the existing a = use(b) by something like:

fn opaque<A,B>(B) -> A

which would permit

a = opaque<TA, TB>(b)

where TA is the type of a and TB is the type of B.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions