Skip to content

Wrong pub modifier in each function of trait documentation #81274

@tesuji

Description

@tesuji

The documentation of Iterator trait on 1.49.0 (current stable) doesn't contain pub modifier in function declaration of that trait.
image
However, on beta and nightly, there is pub modifier.
image

This is wrong because you cannot use pub modifier for each method/function in Trait definition.
Why is this important? People copy the method/function declaration in the documentation to their code
and see the compiler error: error[E0449]: unnecessary visibility qualifier.

Meta

rustc --version --verbose:

rustc 1.49.0 (e1884a8e3 2020-12-29)
binary: rustc
commit-hash: e1884a8e3c3e813aada8254edfa120e85bf5ffca
commit-date: 2020-12-29
host: x86_64-unknown-linux-gnu
release: 1.49.0

cc @jyn514 I think this might relate to some changes in visibility around macros ?

Metadata

Metadata

Assignees

Labels

A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateA-visibilityArea: Visibility / privacyC-bugCategory: This is a bug.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.P-mediumMedium priorityT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions