diff options
| author | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-11-23 23:03:47 +0200 |
|---|---|---|
| committer | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-11-25 22:57:59 +0200 |
| commit | d049e5d19e4058dfdbf1ce54770a0e3ca36e5dd3 (patch) | |
| tree | af0f1fd4f8ef2e34f0cab1e8e90bd8f8f3738b07 /src/librustc/traits/structural_impls.rs | |
| parent | 2f47a9eb80bc3474b6e89637269ef1f92cfccb7f (diff) | |
avoid type-live-for-region obligations on dummy nodes
Type-live-for-region obligations on DUMMY_NODE_ID cause an ICE, and it turns out that in the few cases they are needed, these obligations are not needed anyway because they are verified elsewhere. Fixes #46069.
Diffstat (limited to 'src/librustc/traits/structural_impls.rs')
| -rw-r--r-- | src/librustc/traits/structural_impls.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/librustc/traits/structural_impls.rs b/src/librustc/traits/structural_impls.rs index 92319950180..e1e2798ecb5 100644 --- a/src/librustc/traits/structural_impls.rs +++ b/src/librustc/traits/structural_impls.rs @@ -10,7 +10,7 @@ use traits; use traits::project::Normalized; -use ty::{Lift, TyCtxt}; +use ty::{self, Lift, TyCtxt}; use ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; use std::fmt; @@ -28,9 +28,16 @@ impl<'tcx, T: fmt::Debug> fmt::Debug for Normalized<'tcx, T> { impl<'tcx, O: fmt::Debug> fmt::Debug for traits::Obligation<'tcx, O> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Obligation(predicate={:?},depth={})", - self.predicate, - self.recursion_depth) + if ty::tls::with(|tcx| tcx.sess.verbose()) { + write!(f, "Obligation(predicate={:?},cause={:?},depth={})", + self.predicate, + self.cause, + self.recursion_depth) + } else { + write!(f, "Obligation(predicate={:?},depth={})", + self.predicate, + self.recursion_depth) + } } } |
