Skip to content

Commit df33cf4

Browse files
committed
add a debug log for more MC failures
I don't see why MC should fail on well-formed code, so it might be a better idea to just add a `delay_span_bug` there (anyone remember the `cat_expr Errd` bug from the 1.0 days?). However, I don't think this is a good idea to backport a new delay_span_bug into stable and this code is going away soon-ish anyway.
1 parent 05d6e55 commit df33cf4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/librustc_typeck/check/regionck.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ use rustc::hir::{self, PatKind};
105105

106106
// a variation on try that just returns unit
107107
macro_rules! ignore_err {
108-
($e:expr) => (match $e { Ok(e) => e, Err(_) => return () })
108+
($e:expr) => (match $e { Ok(e) => e, Err(_) => {
109+
debug!("ignoring mem-categorization error!");
110+
return ()
111+
}})
109112
}
110113

111114
///////////////////////////////////////////////////////////////////////////
@@ -1034,7 +1037,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
10341037
debug!("link_pattern(discr_cmt={:?}, root_pat={:?})",
10351038
discr_cmt,
10361039
root_pat);
1037-
let _ = self.with_mc(|mc| {
1040+
ignore_err!(self.with_mc(|mc| {
10381041
mc.cat_pattern(discr_cmt, root_pat, |sub_cmt, sub_pat| {
10391042
match sub_pat.node {
10401043
// `ref x` pattern
@@ -1051,7 +1054,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
10511054
_ => {}
10521055
}
10531056
})
1054-
});
1057+
}));
10551058
}
10561059

10571060
/// Link lifetime of borrowed pointer resulting from autoref to lifetimes in the value being

0 commit comments

Comments
 (0)