-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Simplify param handling in resolve_bound_vars
#132043
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
); | ||
(param.def_id, ResolvedArg::LateBound(depth, idx, param.def_id)) | ||
fn late(idx: u32, param: &GenericParam<'_>) -> ResolvedArg { | ||
ResolvedArg::LateBound(ty::INNERMOST, idx, param.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 we just get rid of those constructors?
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.
We could do so, but having INNERMOST
sprinkled around everywhere is a tiny bit annoying. I feel like it doesn't change the code much either way.
@bors r+ rollup |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#132043 (Simplify param handling in `resolve_bound_vars`) - rust-lang#132214 (Cleanup: Move an impl-Trait check from AST validation to AST lowering) - rust-lang#132221 (Clean up some comments on lint implementation) - rust-lang#132228 (Revert "ci update freebsd version proposal, freebsd 12 being eol.") - rust-lang#132234 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132043 - compiler-errors:simplify-rbv, r=cjgillot Simplify param handling in `resolve_bound_vars` I always found the flow of the `ResolvedArg` constructors to be a bit confusing; turns out they're also kinda redundantly passing around their data, too. Also, deduplicate some code handling early-bound var to late-bound var conversion between return type notation's two styles: `where <T as Trait>::method(..): Bound` and `where T: Trait<method(..): Bound>`.
I always found the flow of the
ResolvedArg
constructors to be a bit confusing; turns out they're also kinda redundantly passing around their data, too.Also, deduplicate some code handling early-bound var to late-bound var conversion between return type notation's two styles:
where <T as Trait>::method(..): Bound
andwhere T: Trait<method(..): Bound>
.