diff options
| author | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2018-07-11 01:09:48 +0300 |
|---|---|---|
| committer | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2018-07-11 01:09:48 +0300 |
| commit | df33cf4cb07fbab7fe1831635892da9b4405dd93 (patch) | |
| tree | af82ddbfa8c613caaebe3ed7881cfc32f86f5f4e /src | |
| parent | 05d6e55fab21e76627b3e5e793c062ad4d2b485a (diff) | |
| download | rust-df33cf4cb07fbab7fe1831635892da9b4405dd93.tar.gz rust-df33cf4cb07fbab7fe1831635892da9b4405dd93.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/check/regionck.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index 68fcde0b165..79ee322d109 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -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 () + }}) } /////////////////////////////////////////////////////////////////////////// @@ -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 @@ -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 |
