Make novel structural match violations a warning

This commit is contained in:
Dylan MacKenzie 2020-06-17 09:29:33 -07:00
parent e8ff4bcbd0
commit c9dc73d757

View file

@ -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 {