about summary refs log tree commit diff
path: root/library/std/src/keyword_docs.rs
AgeCommit message (Collapse)AuthorLines
2025-01-22Library: Finalize dyn compatibility renamingLeón Orell Valerian Liehr-5/+4
2024-12-17Remove `rustc::existing_doc_keyword` lint.Nicholas Nethercote-3/+3
`CheckAttrVisitor::check_doc_keyword` checks `#[doc(keyword = "..")]` attributes to ensure they are on an empty module, and that the value is a non-empty identifier. The `rustc::existing_doc_keyword` lint checks these attributes to ensure that the value is the name of a keyword. It's silly to have two different checking mechanisms for these attributes. This commit does the following. - Changes `check_doc_keyword` to check that the value is the name of a keyword (avoiding the need for the identifier check, which removes a dependency on `rustc_lexer`). - Removes the lint. - Updates tests accordingly. There is one hack: the `SelfTy` FIXME case used to used to be handled by disabling the lint, but now is handled with a special case in `is_doc_keyword`. That hack will go away if/when the FIXME is fixed. Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
2024-12-17Move `doc(keyword = "while")`.Nicholas Nethercote-58/+58
All the other unconditional keywords are in the alphabetical order, but `while` is for some reason not.
2024-11-18Document alternatives to `static mut`Kornel-0/+6
2024-10-18Update `use` keyword docs to describe precise capturingprintfn-7/+39
2024-10-09Library: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-1/+3
2024-08-06Trivial grammar fix in const keyword docsMonadic Cat-1/+1
> `const` items looks remarkably similar to `static` items, [...] Either this should be written as > A `const` items looks remarkably similar to a `static` item, or "looks" should be changed to "look". I have selected the smaller diff.
2024-07-26Fix doc nitsJohn Arundel-2/+2
Many tiny changes to stdlib doc comments to make them consistent (for example "Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph breaks, backticks for monospace style, and other minor nits. https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
2024-03-15Mention labelled blocks in `break` docsWilfred Hughes-1/+1
`break` doesn't require a loop, so note this in the docs. This is covered in the linked sections of the rust reference, but this page implied that `break` is only for loops.
2023-08-21docs: Add example, reference link for `type` keyword.Bruce Mitchener-1/+9
Fixes #114281.
2023-05-07enable `rust_2018_idioms` for doctestsozkanonur-1/+1
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-04-26Spelling library/Josh Soref-2/+2
* advance * aligned * borrowed * calculate * debugable * debuggable * declarations * desugaring * documentation * enclave * ignorable * initialized * iterator * kaboom * monomorphization * nonexistent * optimizer * panicking * process * reentrant * rustonomicon * the * uninitialized Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-12remove some unneeded importsKaDiWa-1/+1
2023-02-20use UpperCamelCaseMilo Moisson-1/+1
2023-02-20docs: wrong naming convention in struct keyword docMilo Moisson-1/+1
2022-10-07review feedbackRalf Jung-42/+43
2022-09-29unsafe keyword: trait examples and unsafe_op_in_unsafe_fn updateRalf Jung-32/+120
2022-08-31Fix a bunch of typoDezhi Wu-3/+3
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-06-17Rollup merge of #98169 - pierwill:dyn-disp, r=JohnTitorYuki Okushi-1/+2
Keyword docs: Link to wikipedia article for dynamic dispatch
2022-06-16Keyword docs: Link to wikipedia article for dynamic dispatchpierwill-1/+2
2022-06-13remove an unnecessary space in docTakayuki Maeda-1/+1
2022-06-03Fully stabilize NLLJack Huey-1/+1
2022-05-24Fix weird indentation in continue_keyword docsMichael Howell-6/+6
This format was causing every line in the code examples to have a space at the start.
2022-03-19Rollup merge of #93692 - mfrw:mfrw/document-keyword-in, r=dtolnayDylan DPC-0/+14
keyword_docs: document use of `in` with `pub` keyword Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Fixes: #93609
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-24/+24
This updates the standard library's documentation to use the new syntax. The documentation is worthwhile to update as it should be more idiomatic (particularly for features like this, which are nice for users to get acquainted with). The general codebase is likely more hassle than benefit to update: it'll hurt git blame, and generally updates can be done by folks updating the code if (and when) that makes things more readable with the new format. A few places in the compiler and library code are updated (mostly just due to already having been done when this commit was first authored).
2022-02-21Rollup merge of #91192 - r00ster91:futuredocs, r=GuillaumeGomezMatthias Krüger-6/+8
Some improvements to the async docs The goal here is to make the docs overall a little bit more comprehensive and add more links between the things. One thing that's not working yet is the links to the keywords. Somehow I couldn't get them to work. r? ````@GuillaumeGomez```` do you know how I could get the keyword links to work?
2022-02-19Some improvements to the async docsr00ster91-6/+8
2022-02-06keyword_docs: document use of `in` with `pub` keywordMuhammad Falak R Wani-0/+14
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
2022-01-09eplace usages of vec![].into_iter with [].into_iterLucas Kent-1/+1
2021-11-21Simplify for loop desugarCameron Steffen-4/+1
2021-11-09Update booksEric Huss-1/+1
2021-09-16Fix typo in `break` docstatami4-1/+1
2021-09-05Mention usage of `const` in raw pointer types at the top of the keyword's ↵Frank Steffahn-1/+1
documentation page.
2021-08-22Fix typos “an”→“a” and a few different ones that appeared in the ↵Frank Steffahn-1/+1
same search
2021-06-25Fix a few misspellings.Eric Huss-1/+1
2021-06-17Rollup merge of #86141 - amorison:link-ref-in-doc-dyn-keyword, r=kennytmYuki Okushi-2/+5
Link reference in `dyn` keyword documentation The "read more" sentence formatted "object safety" as inline code instead of providing a link to more information. This PR adds a link to the Reference about this matter, as well as the page regarding trait objects. --- We could also put these links in the very first line (instead of the link to the Book) and in the first paragraph which mentions the "object safe" requirement. Personally, I think it's good to keep the link to the Book up-front as it's more accessible than the Reference.
2021-06-15Update keyword_docs.rsLukas Wirth-2/+1
2021-06-08Link reference in `dyn` keyword documentationAdrien Morison-2/+5
The "read more" sentence formatted "object safety" as inline code instead of providing a link to more information. This PR adds a link to the Reference about this matter, as well as the page regarding trait objects.
2021-06-05Updated code examples and wordingerer1243-11/+9
2021-05-13Fix indentation in move keyword documentationThomas Otto-2/+2
2021-04-12Turn old edition lints (anonymous-parameters, keyword-idents) into ↵Manish Goregaokar-0/+1
warn-by-default on 2015
2021-03-31Rollup merge of #83680 - ibraheemdev:patch-2, r=Dylan-DPCDylan DPC-9/+12
Update for loop desugaring docs It looks like the documentation for `for` loops was not updated to match the new de-sugaring process.
2021-03-30update for loop desugaring docsIbraheem Ahmed-9/+12
2021-03-30Fix Self keyword doc URL conflict on case insensitive file systemsGuillaume Gomez-1/+5
2021-03-20Fix broken doc link referenceStephen Albert-Moore-2/+2
2021-03-18Fix pluralization in keyword docsStephen Albert-Moore-3/+3
2021-02-25Convert primitives to use intra-doc linksJoshua Nelson-5/+3
2021-01-13Update code to account for extern ABI requirementMark Rousskov-1/+1
2020-12-19Rollup merge of #79211 - yoshuawuyts:future-doc-alias, r=Mark-SimulacrumYuki Okushi-0/+1
Add the "async" and "promise" doc aliases to `core::future::Future` Adds the "async" and "promise" doc aliases to `core::future::Future`. This enables people who search for "async" or "promise" to find `Future`, which is Rust's core primitive for async programming. Thanks!
2020-12-18Add the "promise" aliases to the `async` lang featureYoshua Wuyts-0/+1