File tree 12 files changed +126
-24
lines changed
12 files changed +126
-24
lines changed Original file line number Diff line number Diff line change
1
+ // Regression test for <https://github.com/rust-lang/rust/issues/98007>.
2
+
3
+ #![ feature( no_core) ]
4
+ #![ no_core]
5
+
6
+ mod auto {
7
+ mod action_row {
8
+ pub struct ActionRowBuilder ;
9
+ }
10
+
11
+ #[ doc( hidden) ]
12
+ pub mod builders {
13
+ pub use super :: action_row:: ActionRowBuilder ;
14
+ }
15
+ }
16
+
17
+ // @count doc_hidden_failure.json "$.index[*][?(@.name=='builders')]" 2
18
+ pub use auto:: * ;
19
+
20
+ pub mod builders {
21
+ pub use crate :: auto:: builders:: * ;
22
+ }
Original file line number Diff line number Diff line change
1
+ pub struct Foo ;
Original file line number Diff line number Diff line change 3
3
#![ no_core]
4
4
#![ feature( no_core) ]
5
5
6
- // @!has glob_extern.json "$.index[*][?(@.name=='mod1')]"
6
+ // @is glob_extern.json "$.index[*][?(@.name=='mod1')].kind" \"module\"
7
+ // @is glob_extern.json "$.index[*][?(@.name=='mod1')].inner.is_stripped" "true"
7
8
mod mod1 {
8
9
extern "C" {
9
- // @set public_fn_id = - "$.index[*][?(@.name=='public_fn')].id"
10
+ // @has - "$.index[*][?(@.name=='public_fn')].id"
10
11
pub fn public_fn ( ) ;
11
12
// @!has - "$.index[*][?(@.name=='private_fn')]"
12
13
fn private_fn ( ) ;
13
14
}
14
15
}
15
16
16
- // @has - "$.index[*][?(@.name =='glob_extern ')].inner.items[*]" $public_fn_id
17
+ // @is - "$.index[*][?(@.kind =='import ')].inner.glob" true
17
18
pub use mod1:: * ;
Original file line number Diff line number Diff line change 3
3
#![ no_core]
4
4
#![ feature( no_core) ]
5
5
6
- // @!has glob_private.json "$.index[*][?(@.name=='mod1')]"
6
+ // @is glob_private.json "$.index[*][?(@.name=='mod1')].kind" \"module\"
7
+ // @is glob_private.json "$.index[*][?(@.name=='mod1')].inner.is_stripped" "true"
7
8
mod mod1 {
8
- // @!has - "$.index[*][?(@.name=='mod2')]"
9
+ // @is - "$.index[*][?(@.name=='mod2')].kind" \"module\"
10
+ // @is - "$.index[*][?(@.name=='mod2')].inner.is_stripped" "true"
9
11
mod mod2 {
10
12
// @set m2pub_id = - "$.index[*][?(@.name=='Mod2Public')].id"
11
13
pub struct Mod2Public ;
12
14
13
15
// @!has - "$.index[*][?(@.name=='Mod2Private')]"
14
16
struct Mod2Private ;
15
17
}
18
+
19
+ // @has - "$.index[*][?(@.kind=='import' && @.inner.name=='mod2')]"
16
20
pub use self :: mod2:: * ;
17
21
18
22
// @set m1pub_id = - "$.index[*][?(@.name=='Mod1Public')].id"
19
23
pub struct Mod1Public ;
20
-
21
24
// @!has - "$.index[*][?(@.name=='Mod1Private')]"
22
25
struct Mod1Private ;
23
26
}
27
+
28
+ // @has - "$.index[*][?(@.kind=='import' && @.inner.name=='mod1')]"
24
29
pub use mod1:: * ;
25
30
26
- // @has - "$.index[*][?(@.name=='glob_private ')].inner.items[*]" $m2pub_id
27
- // @has - "$.index[*][?(@.name=='glob_private ')].inner.items[*]" $m1pub_id
31
+ // @has - "$.index[*][?(@.name=='mod2 ')].inner.items[*]" $m2pub_id
32
+ // @has - "$.index[*][?(@.name=='mod1 ')].inner.items[*]" $m1pub_id
Original file line number Diff line number Diff line change 1
1
#![ feature( no_core) ]
2
2
#![ no_core]
3
3
4
+ // @is in_root_and_mod.json "$.index[*][?(@.name=='foo')].kind" \"module\"
5
+ // @is in_root_and_mod.json "$.index[*][?(@.name=='foo')].inner.is_stripped" "true"
4
6
mod foo {
5
- // @set foo_id = in_root_and_mod.json "$.index[*][?(@.name=='Foo')].id "
7
+ // @has - "$.index[*][?(@.name=='Foo')]"
6
8
pub struct Foo ;
7
9
}
8
10
9
- // @has - "$.index[*][?(@.name =='in_root_and_mod')] .inner.items[*]" $foo_id
11
+ // @has - "$.index[*][?(@.kind =='import' && @ .inner.source=='foo::Foo')]"
10
12
pub use foo:: Foo ;
11
13
12
14
pub mod bar {
13
- // @has - "$.index[*][?(@.name =='bar')] .inner.items[*]" $foo_id
15
+ // @has - "$.index[*][?(@.kind =='import' && @ .inner.source=='crate::foo::Foo')]"
14
16
pub use crate :: foo:: Foo ;
15
17
}
Original file line number Diff line number Diff line change
1
+ // aux-build:pub-struct.rs
2
+
3
+ // Test for the ICE in rust/83057
4
+ // Am external type re-exported with different attributes shouldn't cause an error
5
+
6
+ #![ no_core]
7
+ #![ feature( no_core) ]
8
+
9
+ extern crate pub_struct as foo;
10
+
11
+ #[ doc( inline) ]
12
+ pub use foo:: Foo ;
13
+
14
+ pub mod bar {
15
+ pub use foo:: Foo ;
16
+ }
17
+
18
+ // @count private_twice_one_inline.json "$.index[*][?(@.kind=='import')]" 2
Original file line number Diff line number Diff line change
1
+ // Test for the ICE in rust/83720
2
+ // A pub-in-private type re-exported under two different names shouldn't cause an error
3
+
4
+ #![ no_core]
5
+ #![ feature( no_core) ]
6
+
7
+ // @is private_two_names.json "$.index[*][?(@.name=='style')].kind" \"module\"
8
+ // @is private_two_names.json "$.index[*][?(@.name=='style')].inner.is_stripped" "true"
9
+ mod style {
10
+ // @has - "$.index[*](?(@.name=='Color'))"
11
+ pub struct Color ;
12
+ }
13
+
14
+ // @has - "$.index[*][?(@.kind=='import' && @.inner.name=='Color')]"
15
+ pub use style:: Color ;
16
+ // @has - "$.index[*][?(@.kind=='import' && @.inner.name=='Colour')]"
17
+ pub use style:: Color as Colour ;
Original file line number Diff line number Diff line change 2
2
3
3
#![ no_core]
4
4
#![ feature( no_core) ]
5
- // @!has rename_private.json "$.index[*][?(@.name=='inner')]"
5
+
6
+ // @is rename_private.json "$.index[*][?(@.name=='inner')].kind" \"module\"
7
+ // @is rename_private.json "$.index[*][?(@.name=='inner')].inner.is_stripped" "true"
6
8
mod inner {
7
- // @! has - "$.index[*][?(@.name=='Public')]"
9
+ // @has - "$.index[*][?(@.name=='Public')]"
8
10
pub struct Public ;
9
11
}
10
12
11
- // @set newname_id = - "$.index[*][?(@.name=='NewName')].id"
12
- // @is - "$.index[*][?(@.name=='NewName')].kind" \"struct\"
13
- // @has - "$.index[*][?(@.name=='rename_private')].inner.items[*]" $newname_id
13
+ // @is - "$.index[*][?(@.kind=='import')].inner.name" \"NewName\"
14
14
pub use inner:: Public as NewName ;
Original file line number Diff line number Diff line change 1
- // Regression test for https://github.com/rust-lang/rust/issues/97432.
1
+ // Regression test for < https://github.com/rust-lang/rust/issues/97432> .
2
2
3
3
#![ feature( no_core) ]
4
4
#![ no_std]
5
5
#![ no_core]
6
6
7
7
// @has same_type_reexported_more_than_once.json
8
- // @set trait_id = - "$.index[*][?(@.name=='Trait')].id"
9
- // @has - "$.index[*][?(@.name=='same_type_reexported_more_than_once')].inner.items[*]" $trait_id
8
+ // @has - "$.index[*][?(@.name=='Trait')]"
10
9
pub use inner:: Trait ;
11
- // @set reexport_id = - "$.index[*][?(@.name=='Reexport')].id"
12
- // @has - "$.index[*][?(@.name=='same_type_reexported_more_than_once')].inner.items[*]" $reexport_id
10
+ // @has - "$.index[*].inner[?(@.name=='Reexport')].id"
13
11
pub use inner:: Trait as Reexport ;
14
12
15
13
mod inner {
Original file line number Diff line number Diff line change 1
1
// edition:2018
2
-
3
2
#![ no_core]
4
3
#![ feature( no_core) ]
5
4
6
- // @!has simple_private.json "$.index[*][?(@.name=='inner')]"
5
+ // @is simple_private.json "$.index[*][?(@.name=='inner')].kind" \"module\"
6
+ // @is simple_private.json "$.index[*][?(@.name=='inner')].inner.is_stripped" "true"
7
7
mod inner {
8
8
// @set pub_id = - "$.index[*][?(@.name=='Public')].id"
9
9
pub struct Public ;
10
10
}
11
11
12
- // @has - "$.index[*][?(@.name =='simple_private ')].inner.items[*]" $pub_id
12
+ // @is - "$.index[*][?(@.kind =='import ')].inner.name" \"Public\"
13
13
pub use inner:: Public ;
14
+
15
+ // @has - "$.index[*][?(@.name=='inner')].inner.items[*]" $pub_id
Original file line number Diff line number Diff line change
1
+ // Regression test for <https://github.com/rust-lang/rust/issues/96161>.
2
+ // ignore-tidy-linelength
3
+
4
+ #![ feature( no_core) ]
5
+ #![ no_core]
6
+
7
+ mod secret {
8
+ pub struct Secret ;
9
+ }
10
+
11
+ // @is return_private.json "$.index[*][?(@.name=='get_secret')].kind" \"function\"
12
+ // @is return_private.json "$.index[*][?(@.name=='get_secret')].inner.decl.output.inner.name" \"secret::Secret\"
13
+ pub fn get_secret ( ) -> secret:: Secret {
14
+ secret:: Secret
15
+ }
Original file line number Diff line number Diff line change
1
+ #![ no_core]
2
+ #![ feature( no_core) ]
3
+
4
+ // @!has stripped_modules.json "$.index[*][?(@.name=='no_pub_inner')]"
5
+ mod no_pub_inner {
6
+ fn priv_inner ( ) { }
7
+ }
8
+
9
+ // @!has - "$.index[*][?(@.name=='pub_inner_unreachable')]"
10
+ mod pub_inner_unreachable {
11
+ // @!has - "$.index[*][?(@.name=='pub_inner_1')]"
12
+ pub fn pub_inner_1 ( ) { }
13
+ }
14
+
15
+ // @has - "$.index[*][?(@.name=='pub_inner_reachable')]"
16
+ mod pub_inner_reachable {
17
+ // @has - "$.index[*][?(@.name=='pub_inner_2')]"
18
+ pub fn pub_inner_2 ( ) { }
19
+ }
20
+
21
+ pub use pub_inner_reachable:: pub_inner_2;
You can’t perform that action at this time.
0 commit comments