about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-04-30 16:10:25 +0200
committerGitHub <noreply@github.com>2019-04-30 16:10:25 +0200
commit6547de2bddb195f511e24caf7e53550955d2cc0f (patch)
tree2b2d2e1bdbb09e001459b5189e480f89807d831c
parentf843ad60ef5a78d8b4da85c5007d3ecac229f1a8 (diff)
parent02a40e83b217e281e7d2928cf1ce1560f6f7c219 (diff)
downloadrust-6547de2bddb195f511e24caf7e53550955d2cc0f.tar.gz
rust-6547de2bddb195f511e24caf7e53550955d2cc0f.zip
Rollup merge of #60344 - Aaron1011:fix/tower-hyper, r=eddyb
Don't try to render auto-trait bounds with any inference variables

Previously, we checked if the target of a projection type was itself an
inference variable. However, for Rustdoc rendering purposes, there's no
distinction between an inference variable ('_') and a type containing
one (e.g. (MyStruct<u8, _>)) - we don't want to render either of them.

Fixes #60269

Due to the complexity of the original bug, which spans three different
crates (hyper, tower-hyper, and tower), I have been unable to create a
minimized reproduction for the issue.
-rw-r--r--src/librustc/traits/auto_trait.rs2
-rw-r--r--src/librustdoc/clean/mod.rs1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc/traits/auto_trait.rs b/src/librustc/traits/auto_trait.rs
index bb3dcdcf72b..4de79ccd1d8 100644
--- a/src/librustc/traits/auto_trait.rs
+++ b/src/librustc/traits/auto_trait.rs
@@ -712,7 +712,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
                     // Additionally, we check if we've seen this predicate before,
                     // to avoid rendering duplicate bounds to the user.
                     if self.is_param_no_infer(p.skip_binder().projection_ty.substs)
-                        && !p.ty().skip_binder().is_ty_infer()
+                        && !p.ty().skip_binder().has_infer_types()
                         && is_new_pred {
                             debug!("evaluate_nested_obligations: adding projection predicate\
                             to computed_preds: {:?}", predicate);
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index 8232254cdec..52c8d1847c6 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -2945,6 +2945,7 @@ impl Clean<Type> for hir::Ty {
 
 impl<'tcx> Clean<Type> for Ty<'tcx> {
     fn clean(&self, cx: &DocContext<'_>) -> Type {
+        debug!("cleaning type: {:?}", self);
         match self.sty {
             ty::Never => Never,
             ty::Bool => Primitive(PrimitiveType::Bool),