Skip to content

Commit

Permalink
Make novel structural match violations a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Jun 17, 2020
1 parent e8ff4bc commit c9dc73d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc_mir_build/hair/pattern/const_to_pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c9dc73d

Please sign in to comment.