Use delay_span_bug() over debug!()

This commit is contained in:
Seiichi Uchida 2018-01-13 00:54:56 +09:00
parent 142134d54f
commit 42410a96c4

View File

@ -280,7 +280,8 @@ impl<'a, 'tcx> Pattern<'tcx> {
let mut pcx = PatternContext::new(tcx, param_env_and_substs, tables);
let result = pcx.lower_pattern(pat);
if !pcx.errors.is_empty() {
debug!("encountered errors lowering pattern: {:?}", pcx.errors)
let msg = format!("encountered errors lowering pattern: {:?}", pcx.errors);
tcx.sess.delay_span_bug(pat.span, &msg);
}
debug!("Pattern::from_hir({:?}) = {:?}", pat, result);
result