diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2019-09-13 17:06:09 +0200 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-09-21 12:26:45 -0400 |
| commit | f3ebfab0678962ae5bc0639baafb0eaa59cd3e1b (patch) | |
| tree | 98ea5d202bc65c411915b9c9630160cd59afdacd | |
| parent | d8052d8ee5981bef474fc5d960d72286110a7219 (diff) | |
| download | rust-f3ebfab0678962ae5bc0639baafb0eaa59cd3e1b.tar.gz rust-f3ebfab0678962ae5bc0639baafb0eaa59cd3e1b.zip | |
Make fn ptr always structural match, regardless of whether formal types are.
Fix #63479.
| -rw-r--r-- | src/librustc_mir/hair/pattern/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/librustc_mir/hair/pattern/mod.rs b/src/librustc_mir/hair/pattern/mod.rs index 5ecfb84b632..c82bb5d2ed7 100644 --- a/src/librustc_mir/hair/pattern/mod.rs +++ b/src/librustc_mir/hair/pattern/mod.rs @@ -1203,7 +1203,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; } |
