Skip to content

Commit 0b0b948

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#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.
2 parents f843ad6 + 02a40e8 commit 0b0b948

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/librustc/traits/auto_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
712712
// Additionally, we check if we've seen this predicate before,
713713
// to avoid rendering duplicate bounds to the user.
714714
if self.is_param_no_infer(p.skip_binder().projection_ty.substs)
715-
&& !p.ty().skip_binder().is_ty_infer()
715+
&& !p.ty().skip_binder().has_infer_types()
716716
&& is_new_pred {
717717
debug!("evaluate_nested_obligations: adding projection predicate\
718718
to computed_preds: {:?}", predicate);

src/librustdoc/clean/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2945,6 +2945,7 @@ impl Clean<Type> for hir::Ty {
29452945

29462946
impl<'tcx> Clean<Type> for Ty<'tcx> {
29472947
fn clean(&self, cx: &DocContext<'_>) -> Type {
2948+
debug!("cleaning type: {:?}", self);
29482949
match self.sty {
29492950
ty::Never => Never,
29502951
ty::Bool => Primitive(PrimitiveType::Bool),

0 commit comments

Comments
 (0)