Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] rustdoc: rewrite pred clean #23

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/librustdoc/clean/auto_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use rustc_trait_selection::traits::auto_trait::{self, RegionTarget};
use thin_vec::ThinVec;

use crate::clean::{
self, clean_generic_param_def, clean_middle_ty, clean_predicate,
clean_trait_ref_with_constraints, clean_ty_generics, simplify, Lifetime,
self, clean_generic_param_def, clean_middle_ty, clean_trait_ref_with_constraints,
clean_ty_generics, Lifetime,
};
use crate::core::DocContext;

Expand Down Expand Up @@ -167,7 +167,7 @@ fn clean_param_env<'tcx>(
// FIXME(#111101): Incorporate the explicit predicates of the item here...
let item_predicates: FxIndexSet<_> =
tcx.param_env(item_def_id).caller_bounds().iter().collect();
let where_predicates = param_env
let predicates = param_env
.caller_bounds()
.iter()
// FIXME: ...which hopefully allows us to simplify this:
Expand All @@ -192,14 +192,15 @@ fn clean_param_env<'tcx>(
}
})
})
.flat_map(|pred| clean_predicate(pred, cx))
.chain(clean_region_outlives_constraints(&region_data, generics))
.map(|pred| (pred, rustc_span::DUMMY_SP))
.collect();

let mut generics = clean::Generics { params, where_predicates };
simplify::sized_bounds(cx, &mut generics);
generics.where_predicates = simplify::where_clauses(cx, generics.where_predicates);
generics
let mut where_predicates =
super::modern::clean_predicates(cx, predicates, &mut super::modern::WhereClause::default());
// FIXME: these no longer get "simplif[ied]::where_clauses"
where_predicates.extend(clean_region_outlives_constraints(&region_data, generics));

clean::Generics { params, where_predicates }
}

/// Clean region outlives constraints to where-predicates.
Expand Down
Loading