Is there a canonical way to get the current scope's type arguments from the
I'd like to get the type argument if the current
Ty corresponds to them in order to suggest an appropriate binding restriction.
@nikomatsakis My guess is that you'd be the best person to ask :^)
Not sure if I've done it before, but I'd try calling
I think that has information about the type parameters.
If you've got a
Ty then you could get the relevant generic from that (assuming it is a
ty::TyKind::Param) with the
Not sure if you'd need to start looking at the predicates on the function so you correctly suggest a
T: ... + Copy or just
T: Copy depending if the user already specified some constraints.
Just some ideas in case you hadn't looked at those functions already.
That sounds reasonable and promising. I'll take a look at that this weekend.
@davidtwco that worked, thank you! :thumbs_up: