You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Rust does not check the re-definition in re-exporting, the code compiles sucessufully.
And I use cargo doc to generate the doc of doc_test. As expected, there are foo and foo2 in the crate doc_test.
I expected to see this happen:
The return type of foo should be the MyReturnType with bar: usize as field, and the return type of foo2 should be the MyReturnType with bar: u64 as field.
Instead, this happened:
The return type of foo and foo2 are both the MyReturnType with bar: usize as field.
As suggested in naming convention, and approved by RFC #356, the Error type in each module should not have prefix. So as a common practice (such as diesel), when we want to re-export another crate, we often has the following code:
I tried this code:
Since Rust does not check the re-definition in re-exporting, the code compiles sucessufully.
And I use
cargo doc
to generate the doc ofdoc_test
. As expected, there arefoo
andfoo2
in the cratedoc_test
.I expected to see this happen:
The return type of
foo
should be theMyReturnType
withbar: usize
as field, and the return type offoo2
should be theMyReturnType
withbar: u64
as field.Instead, this happened:
The return type of
foo
andfoo2
are both theMyReturnType
withbar: usize
as field.Meta
rustc --version --verbose
:Severity
As suggested in naming convention, and approved by RFC #356, the
Error
type in each module should not have prefix. So as a common practice (such as diesel), when we want to re-export another crate, we often has the following code:As coded above, this practice leads to the wrong doc, which may confuse the reader (such as this issue in diesel).
The text was updated successfully, but these errors were encountered: