forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#107766 - GuillaumeGomez:fix-json-reexports-…
…of-different-items-with-same-name, r=aDotInTheVoid Fix json reexports of different items with same name Fixes rust-lang#107677. I renamed `from_item_id*` functions into `id_from_item` instead because it makes more sense now. I also simplified the logic around it a bit so that the `ids` function will now directly pass `&clean::Item` to `id_from_item` and the ID will be consistently generated (it caused an issue when I updated the ID for imports). So now, the big change of this PR: I changed how imports' ID is generated: it now includes the target item's ID at the end of the ID. It's to prevent two reexported items with the same name (but different types). r? `@aDotInTheVoid`
- Loading branch information
Showing
3 changed files
with
98 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |