-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Missing documentation of use
bounds
#132224
Comments
Thanks for the report! I agree it can be pretty challenging to search for certain things in Rust. Some notes:
|
I don't have an opinion on whether the Rust Book should have a section on the topic, but the keyword glossary (stable, nightly) is incomplete with the expansion of the
I'm assuming that the standard library documentation in 1.82 not including the precise capture section is an oversight rather than a deliberate decision, but in case it isn't, I hope the maintainers will tally one vote for the "ship some documentation with the feature, even if it is incomplete" 🙂 |
I've created a PR for fixing the issue of the book not mentioning this new use of With edition 2024 its erroneous code will start working (due to capturing all lifetimes by default) and erroneous code examples would need to use a So, not sure what to do about that. anyone have any suggestions? |
On the book side, we’re definitely happy to land the PR that @hkBst opened for the appendix, and I am also planning to incorporate a small change once 1.85 is stable (which I may also try to land on the beta so it’s present with the version that goes out with the edition) that addresses I will add a meta note: In general, folks do try to make sure that there is sufficient documentation to go out with a release, not least because it’s part of the project’s commitment that documentation is part of stabilization, but different folks understand “sufficient” in different ways. There are also mechanical issues—stuff that changes across an edition is particularly tricky for documentation, given it needs to be able to use the edition value, e.g. |
Location
Concerns
rustc --explain E0700
, the Rust Book, and the Reference.Summary
I originally asked this StackOverflow question and was advised to file a bug.
The new
use
keyword, apparently introduced in 1.82, is poorly documented. There are at least 3 documentation issues:add a
But running this command only talks about the older syntax and doesn't mentionuse<...>
bound to explicitly capture'_
... For more information about this error, tryrustc --explain E0700
.use
at all.My specific questions about the syntax were answered by the announcement blog post, I just didn't know how to find it, because "rust use lifetime" is a pretty terrible set of keywords to google for.
The text was updated successfully, but these errors were encountered: