The function check_fn_subtyping
does a function subtyping check between
the sub-type (T_f) corresponding to the type of def_id
@ args
and the
super-type (T_g) corresponding to the oblig_sig
. This subtyping is handled
as akin to the code
[NOTE:Fold-Local-Pointers] Fold local pointers implements roughly a rule like this (for all the local pointers)
that converts the local pointers created via [NOTE:Unfold-Local-Pointers] back into &mut.
HACK(nilehmann) This let us infer parameters under mutable references for the simple case
where the formal argument is of the form &mut B[@n]
, e.g., the type of the first argument
to RVec::get_mut
is &mut RVec<T>[@n]
. We should remove this after we implement opening of
mutable references.
Trait subtyping check, which makes sure that the type for an impl method (def_id)
is a subtype of the corresponding trait method.
[NOTE:Unfold-Local-Pointers] temporarily (at a call-site) convert an &mut to an &strg
to allow for the call to be checked. This is done by unfolding the &mut into a local pointer
at the call-site and then folding the pointer back into the &mut upon return.
See [NOTE:Fold-Local-Pointers]