Rollup merge of #80551 - lcnr:const-arg-wildcard, r=varkor
support pattern as const parents in type_of nice to know that there's still stuff about rust i didn't know about 😆 fixes #80531 r? `@varkor`
This commit is contained in:
commit
96c11f98d7
5 changed files with 127 additions and 11 deletions
|
@ -760,9 +760,9 @@ pub struct Pat<'hir> {
|
|||
pub default_binding_modes: bool,
|
||||
}
|
||||
|
||||
impl Pat<'_> {
|
||||
impl<'hir> Pat<'hir> {
|
||||
// FIXME(#19596) this is a workaround, but there should be a better way
|
||||
fn walk_short_(&self, it: &mut impl FnMut(&Pat<'_>) -> bool) -> bool {
|
||||
fn walk_short_(&self, it: &mut impl FnMut(&Pat<'hir>) -> bool) -> bool {
|
||||
if !it(self) {
|
||||
return false;
|
||||
}
|
||||
|
@ -785,12 +785,12 @@ impl Pat<'_> {
|
|||
/// Note that when visiting e.g. `Tuple(ps)`,
|
||||
/// if visiting `ps[0]` returns `false`,
|
||||
/// then `ps[1]` will not be visited.
|
||||
pub fn walk_short(&self, mut it: impl FnMut(&Pat<'_>) -> bool) -> bool {
|
||||
pub fn walk_short(&self, mut it: impl FnMut(&Pat<'hir>) -> bool) -> bool {
|
||||
self.walk_short_(&mut it)
|
||||
}
|
||||
|
||||
// FIXME(#19596) this is a workaround, but there should be a better way
|
||||
fn walk_(&self, it: &mut impl FnMut(&Pat<'_>) -> bool) {
|
||||
fn walk_(&self, it: &mut impl FnMut(&Pat<'hir>) -> bool) {
|
||||
if !it(self) {
|
||||
return;
|
||||
}
|
||||
|
@ -810,7 +810,7 @@ impl Pat<'_> {
|
|||
/// Walk the pattern in left-to-right order.
|
||||
///
|
||||
/// If `it(pat)` returns `false`, the children are not visited.
|
||||
pub fn walk(&self, mut it: impl FnMut(&Pat<'_>) -> bool) {
|
||||
pub fn walk(&self, mut it: impl FnMut(&Pat<'hir>) -> bool) {
|
||||
self.walk_(&mut it)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue