-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Simplify some places that deal with generic parameter defaults #132912
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -782,21 +782,11 @@ impl<'tcx> Visitor<'tcx> for EmbargoVisitor<'tcx> { | |
impl ReachEverythingInTheInterfaceVisitor<'_, '_> { | ||
fn generics(&mut self) -> &mut Self { | ||
for param in &self.ev.tcx.generics_of(self.item_def_id).own_params { | ||
match param.kind { | ||
GenericParamDefKind::Lifetime => {} | ||
GenericParamDefKind::Type { has_default, .. } => { | ||
if has_default { | ||
self.visit(self.ev.tcx.type_of(param.def_id).instantiate_identity()); | ||
} | ||
} | ||
GenericParamDefKind::Const { has_default, .. } => { | ||
self.visit(self.ev.tcx.type_of(param.def_id).instantiate_identity()); | ||
if has_default { | ||
self.visit( | ||
self.ev.tcx.const_param_default(param.def_id).instantiate_identity(), | ||
); | ||
} | ||
} | ||
if let GenericParamDefKind::Const { .. } = param.kind { | ||
self.visit(self.ev.tcx.type_of(param.def_id).instantiate_identity()); | ||
} | ||
if let Some(default) = param.default_value(self.ev.tcx) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do you feel about renaming it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think |
||
self.visit(default.instantiate_identity()); | ||
} | ||
} | ||
self | ||
|
Uh oh!
There was an error while loading. Please reload this page.