-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Update E0446.md #73351
Update E0446.md #73351
Conversation
The existing error documentation did not show how to use a child module's functions if the types used in those functions are private. These are some other places this problem has popped up that did not present a solution (these are from before the solution existed, 2016-2017. The solution was released in the Rust 2018 edition. However these were the places I was pointed to when I encountered the problem myself): #30905 https://stackoverflow.com/questions/39334430/how-to-reference-private-types-from-public-functions-in-private-modules/62374958#62374958
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ecstatic-morse (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Not working code example demonstrating how the problem may occur: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=20b1d1bb370f129c514316cb8d8acb25 Fixed example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=e48d67236e05699bb103ec2a9c6d2758 Another working example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=cc6c921f0ce7e061f4c8cb733327cb3b |
I like this better than the existing example. cc @GuillaumeGomez in case they want to take a look. Otherwise, @bors r+ rollup |
📌 Commit 8361ee5 has been approved by |
Update E0446.md The existing error documentation did not show how to use a child module's functions if the types used in those functions are private. These are some other places this problem has popped up that did not present a solution (these are from before the solution existed, 2016-2017. The solution was released in the Rust 2018 edition. However these were the places I was pointed to when I encountered the problem myself): rust-lang#30905 https://stackoverflow.com/questions/39334430/how-to-reference-private-types-from-public-functions-in-private-modules/62374958#62374958
Rollup of 10 pull requests Successful merges: - rust-lang#71824 (Check for live drops in constants after drop elaboration) - rust-lang#72389 (Explain move errors that occur due to method calls involving `self`) - rust-lang#72556 (Fix trait alias inherent impl resolution) - rust-lang#72584 (Stabilize vec::Drain::as_slice) - rust-lang#72598 (Display information about captured variable in `FnMut` error) - rust-lang#73336 (Group `Pattern::strip_*` method together) - rust-lang#73341 (_match.rs: fix module doc comment) - rust-lang#73342 (Fix iterator copied() documentation example code) - rust-lang#73351 (Update E0446.md) - rust-lang#73353 (structural_match: non-structural-match ty closures) Failed merges: r? @ghost
The existing error documentation did not show how to use a child module's functions if the types used in those functions are private. These are some other places this problem has popped up that did not present a solution (these are from before the solution existed, 2016-2017. The solution was released in the Rust 2018 edition. However these were the places I was pointed to when I encountered the problem myself):
#30905
https://stackoverflow.com/questions/39334430/how-to-reference-private-types-from-public-functions-in-private-modules/62374958#62374958