Skip to content

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

Closed
wants to merge 2 commits into from
Closed

Replace def_id_no_primitives with def_id #92342

wants to merge 2 commits into from

Conversation

zredb
Copy link
Contributor

@zredb zredb commented Dec 28, 2021

this is my first PR for this repository, please let me know it has ayn question.
r?

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Dec 28, 2021
@rust-highfive
Copy link
Contributor

Some changes occurred in clean/types.rs.

cc @camelid

@rust-highfive
Copy link
Contributor

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 28, 2021
@bors
Copy link
Collaborator

bors commented Dec 28, 2021

☔ 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) {
Copy link
Member

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,
Copy link
Member

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
Copy link
Member

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 {
Copy link
Member

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 {
Copy link
Member

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)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

@GuillaumeGomez
Copy link
Member

Looks good overall. Just a few improvements and it'll be good to go!

@camelid
Copy link
Member

camelid commented Dec 28, 2021

Please squash your commits too using git reset --soft HEAD~ && git commit --amend --no-edit :)

@camelid camelid added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 28, 2021
@camelid
Copy link
Member

camelid commented Dec 28, 2021

You'll also need to rebase so this PR can be merged.

@GuillaumeGomez GuillaumeGomez changed the title Issue 90187 fix Remove def_id_no_primitives Dec 28, 2021
@GuillaumeGomez GuillaumeGomez changed the title Remove def_id_no_primitives Replace def_id_no_primitives with def_id Dec 28, 2021
@zredb zredb closed this Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants