-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Misc cleanups from reading some borrowck code #150141
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
base: main
Are you sure you want to change the base?
Conversation
| let identity_args = GenericArgs::identity_for_item(tcx, typeck_root_def_id); | ||
| if self.mir_def.to_def_id() == typeck_root_def_id | ||
| // Do not ICE when checking default_field_values consts with lifetimes (#135649) | ||
| && DefKind::Field != tcx.def_kind(tcx.parent(typeck_root_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.
| let arg_mapping = iter::zip(identity_args.regions(), fr_args.regions().map(|r| r.as_var())); | ||
| // This relies on typeck roots being generics_of parents with their | ||
| // parameters at the start of nested bodies' generics. | ||
| assert!(renumbered_args.len() >= identity_args.len()); |
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.
I don't know how valuable this assert is in practice? I also would expect us to be relying on this invariant in more places in the compiler than just here 🤔 feels like more generally we expect all typeck parents to be generics_of parents and if that doesn't hold we probably want to yell somewhere other than here 🤔
|
|
||
| mod opaque; | ||
|
|
||
| fn anon_const_type_of<'tcx>(icx: &ItemCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx> { |
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.
ive just moved this down because it's weird for type_of to be sandwiched between helper functions both on top and below :3 no actual changes here
This comment has been minimized.
This comment has been minimized.
9ef21f0 to
9304256
Compare
title
r? lcnr