diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-02-07 17:08:59 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-02-18 18:28:17 +0100 |
| commit | 7d47d7cbaa9e8d163818fbd006ffa5382e3e66c4 (patch) | |
| tree | ffee63628a64643d8d139a638b604164de0eff27 | |
| parent | 0541a0c8c36a700e48ed5b7184686b515dbc5bf3 (diff) | |
| download | rust-7d47d7cbaa9e8d163818fbd006ffa5382e3e66c4.tar.gz rust-7d47d7cbaa9e8d163818fbd006ffa5382e3e66c4.zip | |
Add regression test for #107677
| -rw-r--r-- | tests/rustdoc-json/reexport/same_name_different_types.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/rustdoc-json/reexport/same_name_different_types.rs b/tests/rustdoc-json/reexport/same_name_different_types.rs new file mode 100644 index 00000000000..2314a4eb909 --- /dev/null +++ b/tests/rustdoc-json/reexport/same_name_different_types.rs @@ -0,0 +1,25 @@ +// Regression test for <https://github.com/rust-lang/rust/issues/107677>. + +#![feature(no_core)] +#![no_core] + +pub mod nested { + // @set foo_struct = "$.index[*][?(@.docs == 'Foo the struct')].id" + + /// Foo the struct + pub struct Foo {} + + // @set foo_fn = "$.index[*][?(@.docs == 'Foo the function')].id" + + #[allow(non_snake_case)] + /// Foo the function + pub fn Foo() {} +} + +// @ismany "$.index[*][?(@.inner.name == 'Foo' && @.kind == 'import')].inner.id" $foo_fn $foo_struct +// @ismany "$.index[*][?(@.inner.name == 'Bar' && @.kind == 'import')].inner.id" $foo_fn $foo_struct + +// @count "$.index[*][?(@.inner.name == 'Foo' && @.kind == 'import')]" 2 +pub use nested::Foo; +// @count "$.index[*][?(@.inner.name == 'Bar' && @.kind == 'import')]" 2 +pub use Foo as Bar; |
