-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for dyn Trait
#123
Comments
I investigated a bit. The issue is that we need to handle ExistentialPredicate which isn't quite a |
What do you mean by "we might be able to use a |
|
I think a dyn trait really existentially quantifies a type, and we need to represent that: def foo ... : exists T, Trait T or, written with a dependent tuple (we return a pair of a type def foo ... : (T:Type, Trait T) |
Yes, but with #127 the existentially quantified predicate will always be of the form |
By which I mean, the |
I was wrong about that: a |
Partial support here: #276. Needs more work to support fully. |
Technical note for myself: to create a let ty::Dynamic(data, _, _) = *ty.kind() else { panic!(); }
let existential_trait_ref = tcx.instantiate_bound_regions_with_erased(data.principal().unwrap());
let trait_ref = existential_trait_ref.with_self_ty(tcx, ty); (seen mentioned here in passing). We may want to handle regions better as well. |
No description provided.
The text was updated successfully, but these errors were encountered: