Skip to content

Commit

Permalink
add a debug log for more MC failures
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arielb1 committed Jul 10, 2018
1 parent 05d6e55 commit df33cf4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/librustc_typeck/check/regionck.rs
Expand Up @@ -105,7 +105,10 @@ use rustc::hir::{self, PatKind};

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

///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1034,7 +1037,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
debug!("link_pattern(discr_cmt={:?}, root_pat={:?})",
discr_cmt,
root_pat);
let _ = self.with_mc(|mc| {
ignore_err!(self.with_mc(|mc| {
mc.cat_pattern(discr_cmt, root_pat, |sub_cmt, sub_pat| {
match sub_pat.node {
// `ref x` pattern
Expand All @@ -1051,7 +1054,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
_ => {}
}
})
});
}));
}

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

0 comments on commit df33cf4

Please sign in to comment.