Skip to content

Commit

Permalink
Make fn ptr always structural match, regardless of whether formal typ…
Browse files Browse the repository at this point in the history
…es are.

Fix #63479.
  • Loading branch information
pnkfelix committed Sep 13, 2019
1 parent 1e86913 commit 7437f77
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/librustc_mir/hair/pattern/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7437f77

Please sign in to comment.