-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Replace def_id_no_primitives with def_id #92342
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
Conversation
Some changes occurred in cc @camelid |
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @GuillaumeGomez (or someone else) soon. Please see the contribution instructions for more information. |
☔ The latest upstream changes (presumably #92088) made this pull request unmergeable. Please resolve the merge conflicts. |
@@ -47,7 +48,7 @@ crate fn collect_trait_impls(mut krate: Crate, cx: &mut DocContext<'_>) -> Crate | |||
inline::build_impl(cx, None, def_id, None, &mut new_items); | |||
|
|||
// FIXME(eddyb) is this `doc(hidden)` check needed? | |||
if !cx.tcx.is_doc_hidden(def_id) { | |||
if !cx.tcx.get_attrs(def_id).lists(sym::doc).has_word(sym::hidden) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't have changed.
@@ -64,6 +65,7 @@ crate fn collect_trait_impls(mut krate: Crate, cx: &mut DocContext<'_>) -> Crate | |||
map: &FxHashMap<DefId, &Type>, | |||
cleaner: &mut BadImplStripper, | |||
type_did: DefId, | |||
c: &Cache, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cx
is already passed in the parameters, so no need to add the cache
in here. Just call cx.cache
.
@@ -176,7 +185,13 @@ impl<'a, 'tcx> DocVisitor for SyntheticImplCollector<'a, 'tcx> { | |||
fn visit_item(&mut self, i: &Item) { | |||
if i.is_struct() || i.is_enum() || i.is_union() { | |||
// FIXME(eddyb) is this `doc(hidden)` check needed? | |||
if !self.cx.tcx.is_doc_hidden(i.def_id.expect_def_id()) { | |||
if !self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't have changed.
@@ -211,13 +226,13 @@ struct BadImplStripper { | |||
} | |||
|
|||
impl BadImplStripper { | |||
fn keep_impl(&self, ty: &Type, is_deref: bool) -> bool { | |||
fn keep_impl(&self, ty: &Type, is_deref: bool, c: &Cache) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please name it cache
and not just c
.
@@ -1140,6 +1140,15 @@ impl PartialEq for Attributes { | |||
|
|||
impl Eq for Attributes {} | |||
|
|||
impl Hash for Attributes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
@@ -904,7 +904,7 @@ impl<I: Iterator<Item = ast::NestedMetaItem> + IntoIterator<Item = ast::NestedMe | |||
/// Included files are kept separate from inline doc comments so that proper line-number | |||
/// information can be given when a doctest fails. Sugared doc comments and "raw" doc comments are | |||
/// kept separate because of issue #42760. | |||
#[derive(Clone, PartialEq, Eq, Debug)] | |||
#[derive(Clone, PartialEq, Eq, Debug, Hash)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
Looks good overall. Just a few improvements and it'll be good to go! |
Please squash your commits too using |
You'll also need to rebase so this PR can be merged. |
this is my first PR for this repository, please let me know it has ayn question.
r?