-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix invalid display of inlined re-export when both local and foreign items are inlined #113785
Fix invalid display of inlined re-export when both local and foreign items are inlined #113785
Conversation
Updated! |
@bors r+ rollup |
📌 Commit 01e30d9c345567c14f68b98716ccd58e2da75dee has been approved by It is now in the queue for this repository. |
☔ The latest upstream changes (presumably #113574) made this pull request unmergeable. Please resolve the merge conflicts. |
01e30d9
to
afec6d2
Compare
@bors r=notriddle,aDotInTheVoid rollup |
…-105735-fix, r=notriddle,aDotInTheVoid Fix invalid display of inlined re-export when both local and foreign items are inlined Fixes rust-lang#105735. The bug is actually quite interesting: at the `clean` pass, local inlined items have their `use` item removed, however foreign items don't have their `use` item removed because it's in the `clean` pass that we handle them. So when a `use` inlines both a local and a foreign item, it will work as expected for the foreign one, but not for the local as its `use` should not be around anymore. To prevent this, I created a new `inlined_foreigns` field into the `Module` struct to allow to remove the `use` item early on for foreign items as well. Then we iterate it in the `clean` pass directly. r? `@notriddle`
…-105735-fix, r=notriddle,aDotInTheVoid Fix invalid display of inlined re-export when both local and foreign items are inlined Fixes rust-lang#105735. The bug is actually quite interesting: at the `clean` pass, local inlined items have their `use` item removed, however foreign items don't have their `use` item removed because it's in the `clean` pass that we handle them. So when a `use` inlines both a local and a foreign item, it will work as expected for the foreign one, but not for the local as its `use` should not be around anymore. To prevent this, I created a new `inlined_foreigns` field into the `Module` struct to allow to remove the `use` item early on for foreign items as well. Then we iterate it in the `clean` pass directly. r? ``@notriddle``
⌛ Testing commit afec6d2 with merge 63968fcb484c49cecc6576490ac28dd60e14f40a... |
💔 Test failed - checks-actions |
Flaky failure:
@bors retry |
⌛ Testing commit afec6d2 with merge 5fb88f6441afd6781a1bdb8d2c3b2fd2e9cb878f... |
💔 Test failed - checks-actions |
CI seems dead for the moment. |
The job Click to see the possible cause of the failure (guessed by this bot)
|
@bors retry |
…-105735-fix, r=notriddle,aDotInTheVoid Fix invalid display of inlined re-export when both local and foreign items are inlined Fixes rust-lang#105735. The bug is actually quite interesting: at the `clean` pass, local inlined items have their `use` item removed, however foreign items don't have their `use` item removed because it's in the `clean` pass that we handle them. So when a `use` inlines both a local and a foreign item, it will work as expected for the foreign one, but not for the local as its `use` should not be around anymore. To prevent this, I created a new `inlined_foreigns` field into the `Module` struct to allow to remove the `use` item early on for foreign items as well. Then we iterate it in the `clean` pass directly. r? `@notriddle`
Rollup of 7 pull requests Successful merges: - rust-lang#113444 (add tests for alias bound preference) - rust-lang#113716 (Add the `no-builtins` attribute to functions when `no_builtins` is applied at the crate level.) - rust-lang#113754 (Simplify native_libs query) - rust-lang#113765 (Make it clearer that edition functions are `>=`, not `==`) - rust-lang#113774 (Improve error message when closing bracket interpreted as formatting fill character) - rust-lang#113785 (Fix invalid display of inlined re-export when both local and foreign items are inlined) - rust-lang#113803 (Fix inline_const with interpolated block) r? `@ghost` `@rustbot` modify labels: rollup
Fixes #105735.
The bug is actually quite interesting: at the
clean
pass, local inlined items have theiruse
item removed, however foreign items don't have theiruse
item removed because it's in theclean
pass that we handle them. So when ause
inlines both a local and a foreign item, it will work as expected for the foreign one, but not for the local as itsuse
should not be around anymore.To prevent this, I created a new
inlined_foreigns
field into theModule
struct to allow to remove theuse
item early on for foreign items as well. Then we iterate it in theclean
pass directly.r? @notriddle