]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/util/ppaux.rs
Fix impl Trait Lifetime Handling
[rust.git] / src / librustc / util / ppaux.rs
index 0eb2c19fe44ddeb72a2013ce0e79638691e64a39..4b0cf018cb52495bcbc9d5d8083e9aacb673b393 100644 (file)
@@ -17,7 +17,7 @@
 use ty::{TyBool, TyChar, TyAdt};
 use ty::{TyError, TyStr, TyArray, TySlice, TyFloat, TyFnDef, TyFnPtr};
 use ty::{TyParam, TyRawPtr, TyRef, TyNever, TyTuple};
-use ty::{TyClosure, TyGenerator, TyProjection, TyAnon};
+use ty::{TyClosure, TyGenerator, TyForeign, TyProjection, TyAnon};
 use ty::{TyDynamic, TyInt, TyUint, TyInfer};
 use ty::{self, Ty, TyCtxt, TypeFoldable};
 use util::nodemap::FxHashSet;
@@ -1012,8 +1012,13 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
                         Ok(())
                     }
                 }
+                TyForeign(def_id) => parameterized(f, subst::Substs::empty(), def_id, &[]),
                 TyProjection(ref data) => data.print(f, cx),
                 TyAnon(def_id, substs) => {
+                    if cx.is_verbose {
+                        return write!(f, "TyAnon({:?}, {:?})", def_id, substs);
+                    }
+
                     ty::tls::with(|tcx| {
                         // Grab the "TraitA + TraitB" from `impl TraitA + TraitB`,
                         // by looking up the projections associated with the def_id.