-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use elaboration to turn ~const bounds into non-const bounds #116872
Use elaboration to turn ~const bounds into non-const bounds #116872
Conversation
This comment has been minimized.
This comment has been minimized.
d215b0b
to
3dd95d2
Compare
// HACK(eddyb) should get the original `Span`. | ||
let span = tcx.def_span(def_id); | ||
ty::GenericPredicates { | ||
parent: None, | ||
predicates: tcx.arena.alloc_from_iter( | ||
self.param_env.caller_bounds().iter().filter_map(|predicate| { | ||
match predicate.kind().skip_binder() { | ||
ty::ClauseKind::Trait(data) if data.self_ty().is_param(index) => { | ||
// HACK(eddyb) should get the original `Span`. | ||
let span = tcx.def_span(def_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be reverted?
😅 this is the same thing I had in my own attempt at effect generics last year. I'll compare the impls to see if I found some other subtle issues due to the higher test coverage compared to the current effects impl |
☔ The latest upstream changes (presumably #116885) made this pull request unmergeable. Please resolve the merge conflicts. |
@rustbot author |
This is superseded (in the other direction) by #119721. |
Feels slightly less ad-hoc, and is an attempt at this comment: #116756 (comment)
The only thing that I don't like is the filtering in
one_bound_for_assoc_type
-- I wonder if I should filter somewhere else?r? @fee1-dead or @oli-obk