Skip to content
Permalink
Browse files

Make fn ptr always structural match, regardless of whether formal typ…

…es are.

Fix #63479.
  • Loading branch information...
pnkfelix committed Sep 13, 2019
1 parent 1e86913 commit 7437f770251f6c3c76f75891d48db4d1e26fc0c2
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/librustc_mir/hair/pattern/mod.rs
@@ -1229,7 +1229,13 @@ fn search_for_adt_without_structural_match<'tcx>(tcx: TyCtxt<'tcx>,
ty::RawPtr(..) => {
// `#[structural_match]` ignores substructure of
// `*const _`/`*mut _`, so skip super_visit_with

//
// (But still tell caller to continue search.)
return false;
}
ty::FnDef(..) | ty::FnPtr(..) => {
// types of formals and return in `fn(_) -> _` are also irrelevant
//
// (But still tell caller to continue search.)
return false;
}

0 comments on commit 7437f77

Please sign in to comment.
You can’t perform that action at this time.