diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2021-02-12 19:32:20 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-12 19:32:20 +0900 |
| commit | 6830ea1a83e890d4218b98597137eb457cbb0ac1 (patch) | |
| tree | 2d4c40fd936c26b875b3224aa4b73c9828c55217 /src/test | |
| parent | 1a9d20b4305bf17c76e1c1b1b16781ddefe44222 (diff) | |
| parent | 67fb96c537993673a47ee91f073523e6778809b3 (diff) | |
Rollup merge of #82011 - jyn514:warn-private-assoc-item, r=max-heller
Fix private intra-doc warnings on associated items The issue was that the `kind, id` override was previously only being considered for the disambiguator check, not the privacy check. This uses the same ID for both. Fixes https://github.com/rust-lang/rust/issues/81981. r? ``@max-heller``
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc-ui/intra-doc/private.private.stderr | 12 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/intra-doc/private.public.stderr | 12 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/intra-doc/private.rs | 7 |
3 files changed, 26 insertions, 5 deletions
diff --git a/src/test/rustdoc-ui/intra-doc/private.private.stderr b/src/test/rustdoc-ui/intra-doc/private.private.stderr index 6e11ec3e87b..94a833fcc1a 100644 --- a/src/test/rustdoc-ui/intra-doc/private.private.stderr +++ b/src/test/rustdoc-ui/intra-doc/private.private.stderr @@ -1,11 +1,19 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` --> $DIR/private.rs:5:11 | -LL | /// docs [DontDocMe] +LL | /// docs [DontDocMe] [DontDocMe::f] | ^^^^^^^^^ this item is private | = note: `#[warn(private_intra_doc_links)]` on by default = note: this link resolves only because you passed `--document-private-items`, but will break without -warning: 1 warning emitted +warning: public documentation for `DocMe` links to private item `DontDocMe::f` + --> $DIR/private.rs:5:23 + | +LL | /// docs [DontDocMe] [DontDocMe::f] + | ^^^^^^^^^^^^ this item is private + | + = note: this link resolves only because you passed `--document-private-items`, but will break without + +warning: 2 warnings emitted diff --git a/src/test/rustdoc-ui/intra-doc/private.public.stderr b/src/test/rustdoc-ui/intra-doc/private.public.stderr index 3a6a4b66452..21a60638d5e 100644 --- a/src/test/rustdoc-ui/intra-doc/private.public.stderr +++ b/src/test/rustdoc-ui/intra-doc/private.public.stderr @@ -1,11 +1,19 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` --> $DIR/private.rs:5:11 | -LL | /// docs [DontDocMe] +LL | /// docs [DontDocMe] [DontDocMe::f] | ^^^^^^^^^ this item is private | = note: `#[warn(private_intra_doc_links)]` on by default = note: this link will resolve properly if you pass `--document-private-items` -warning: 1 warning emitted +warning: public documentation for `DocMe` links to private item `DontDocMe::f` + --> $DIR/private.rs:5:23 + | +LL | /// docs [DontDocMe] [DontDocMe::f] + | ^^^^^^^^^^^^ this item is private + | + = note: this link will resolve properly if you pass `--document-private-items` + +warning: 2 warnings emitted diff --git a/src/test/rustdoc-ui/intra-doc/private.rs b/src/test/rustdoc-ui/intra-doc/private.rs index 613236d75d2..3782864305f 100644 --- a/src/test/rustdoc-ui/intra-doc/private.rs +++ b/src/test/rustdoc-ui/intra-doc/private.rs @@ -2,8 +2,13 @@ // revisions: public private // [private]compile-flags: --document-private-items -/// docs [DontDocMe] +/// docs [DontDocMe] [DontDocMe::f] //~^ WARNING public documentation for `DocMe` links to private item `DontDocMe` +//~| WARNING public documentation for `DocMe` links to private item `DontDocMe::f` // FIXME: for [private] we should also make sure the link was actually generated pub struct DocMe; struct DontDocMe; + +impl DontDocMe { + fn f() {} +} |
