rustdoc: fix ICE when delegating functions with impl Trait as argument type#156498
rustdoc: fix ICE when delegating functions with impl Trait as argument type#156498cijiugechu wants to merge 1 commit into
impl Trait as argument type#156498Conversation
|
rustbot has assigned @lolbinarycat. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
This is needed because delegated signatures now go through tcx.fn_sig, where the inherited bounds may include internal sizedness bounds.
impl Trait as argument type
| #![crate_name = "fn_delegation_impl_trait"] | ||
| #![feature(fn_delegation)] | ||
| #![allow(incomplete_features)] | ||
|
|
There was a problem hiding this comment.
I'd like to also see tests of what happens when delegating to a function defined in a separate crate, since rustdoc won't have the HIR in that case. This can be achieved via the aux-crate directive.
I think using build_function will handle this case correctly, but it would be nice to know for sure/
Also, what happens if we #[doc(inline)] a function that was delegated in a separate crate? What about delegating to a function that was delegated in a separate crate?
There's a lot of possible permutations but I think just adding a few more would make me a lot more confident there's no sneaky edge cases that break.
| @@ -0,0 +1,35 @@ | |||
| //! Regression test for <https://github.com/rust-lang/rust/issues/155728> | |||
| #![crate_name = "fn_delegation_impl_trait"] | |||
There was a problem hiding this comment.
| #![crate_name = "fn_delegation_impl_trait"] |
That shouldn't be necessary.
| @@ -0,0 +1,35 @@ | |||
| //! Regression test for <https://github.com/rust-lang/rust/issues/155728> | |||
There was a problem hiding this comment.
| //! Regression test for <https://github.com/rust-lang/rust/issues/155728> | |
| // Regression test for <https://github.com/rust-lang/rust/issues/155728> |
nitpick: Usually regular comments are used for test descriptions, not doc comments. Also it would be nice to have a little blurb describing what the test does without having to follow the link, like "Make sure delegating functions with impl Trait in argument position works works correctly."
HIR signatures for delegation items contain
InferDelegationplaceholders, clean the inherited fn_sig signature instead.Closes #155728