diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-06-17 09:29:33 -0700 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-06-17 09:29:33 -0700 |
| commit | c9dc73d757003c58430d759b6e567afa356470a7 (patch) | |
| tree | 27aad2f3d16d889e61828b175d850fcc8da7c369 | |
| parent | e8ff4bcbd02475cf487cd101bf32954dc63366d4 (diff) | |
| download | rust-c9dc73d757003c58430d759b6e567afa356470a7.tar.gz rust-c9dc73d757003c58430d759b6e567afa356470a7.zip | |
Make novel structural match violations a warning
| -rw-r--r-- | src/librustc_mir_build/hair/pattern/const_to_pat.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc_mir_build/hair/pattern/const_to_pat.rs b/src/librustc_mir_build/hair/pattern/const_to_pat.rs index 087c2c064cf..8c4230dfa5d 100644 --- a/src/librustc_mir_build/hair/pattern/const_to_pat.rs +++ b/src/librustc_mir_build/hair/pattern/const_to_pat.rs @@ -107,8 +107,12 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> { cv.ty, structural ); + // This can occur because const qualification treats all associated constants as + // opaque, whereas `search_for_structural_match_violation` tries to monomorphize them + // before it runs. See #73431 for an example. if structural.is_none() && mir_structural_match_violation { - bug!("MIR const-checker found novel structural match violation"); + warn!("MIR const-checker found novel structural match violation"); + return inlined_const_as_pat; } if let Some(non_sm_ty) = structural { |
