Skip to content

Commit 703323e

Browse files
authored
Rollup merge of #111565 - aDotInTheVoid:rdj-impl-viz, r=GuillaumeGomez
rustdoc-json: Add tests for visibility of impls [Apparrently rustdoc use to give these `crate` instead of `default`](obi1kenobi/trustfall-rustdoc-adapter@rustdoc-v24...rustdoc-v25#diff-58e57a0fc73d1353fa3a057f0fe81c6ecfd4548b429cef1aee36b1c84d8d15a4L366). CC `@obi1kenobi` The output is arguably still buggy as to weather some of these impls should be stripped, but that's a seperate issue and shouldn't block adding these tests (#111564) r? `@GuillaumeGomez`
2 parents ff364b0 + 99cae9c commit 703323e

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#![feature(no_core)]
2+
#![no_core]
3+
4+
pub struct Foo;
5+
6+
/// impl Foo priv
7+
impl Foo {
8+
fn baz() {}
9+
}
10+
// @!has '$.index[*][?(@.docs=="impl Foo priv")]'
11+
12+
13+
/// impl Foo pub
14+
impl Foo {
15+
pub fn qux() {}
16+
}
17+
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
18+
19+
20+
/// impl Foo hidden
21+
impl Foo {
22+
#[doc(hidden)]
23+
pub fn __quazl(){}
24+
}
25+
// FIXME(#111564): Is this the right behaviour?
26+
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// compile-flags: --document-hidden-items
2+
#![feature(no_core)]
3+
#![no_core]
4+
5+
pub struct Foo;
6+
7+
/// impl Foo priv
8+
impl Foo {
9+
fn baz() {}
10+
}
11+
// FIXME(#111564): Is this the right behaviour?
12+
// @is '$.index[*][?(@.docs=="impl Foo priv")].visibility' '"default"'
13+
14+
15+
/// impl Foo pub
16+
impl Foo {
17+
pub fn qux() {}
18+
}
19+
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
20+
21+
22+
/// impl Foo hidden
23+
impl Foo {
24+
#[doc(hidden)]
25+
pub fn __quazl(){}
26+
}
27+
// FIXME(#111564): Is this the right behaviour?
28+
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// compile-flags: --document-private-items
2+
#![feature(no_core)]
3+
#![no_core]
4+
5+
pub struct Foo;
6+
7+
/// impl Foo priv
8+
impl Foo {
9+
fn baz() {}
10+
}
11+
// @is '$.index[*][?(@.docs=="impl Foo priv")].visibility' '"default"'
12+
13+
14+
/// impl Foo pub
15+
impl Foo {
16+
pub fn qux() {}
17+
}
18+
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
19+
20+
21+
/// impl Foo hidden
22+
impl Foo {
23+
#[doc(hidden)]
24+
pub fn __quazl(){}
25+
}
26+
// FIXME(#111564): Is this the right behaviour?
27+
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'

0 commit comments

Comments
 (0)