move-language / move

Apache License 2.0
2.25k stars 679 forks source link

[session] Accept MoveResolver by value #1009

Closed amnn closed 1 year ago

amnn commented 1 year ago

Rather than accepting MoveResolver by reference accept it by value, but provide generic implementations for references of types that implement the traits. Also expose a reference to it on Session and return it by value on finish.

This allows for the creation of resolvers that hold state that is scoped to the session, internally to themselves, rather than relying on that state's lifetime being maintained externally.

Test Plan

$ cargo nextest
amnn commented 1 year ago

Obligatory acknowledgement that all our lives would be easier if we weren't using session for this... cc @dariorussi