summary refs log tree commit diff
path: root/library/std/src/primitive_docs.rs
AgeCommit message (Collapse)AuthorLines
2022-03-31match std f32 primitive docs to core f32 primitive docsPyry Kontio-2/+3
2022-03-31Improve wording of "NaN as a special value" top level explanationPyry Kontio-4/+5
2022-03-31Improve floating point documentation:Pyry Kontio-4/+14
- Refine the "NaN as a special value" top level explanation of f32 - Refine `const NAN` docstring. - Refine `fn is_sign_positive` and `fn is_sign_negative` docstrings. - Refine `fn min` and `fn max` docstrings. - Refine `fn trunc` docstrings. - Refine `fn powi` docstrings. - Refine `fn copysign` docstrings. - Reword `NaN` and `NAN` as plain "NaN", unless they refer to the specific `const NAN`. - Reword "a number" to `self` in function docstrings to clarify. - Remove "Returns NAN if the number is NAN" as this is told to be the default behavior in the top explanation. - Remove "propagating NaNs", as full propagation (preservation of payloads) is not guaranteed.
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-10/+10
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-01Fix annotation of code blocksGeorge Bateman-2/+3
2022-01-31(#93493) Add items from code reviewGeorge Bateman-15/+35
2022-01-30Document char validityGeorge Bateman-5/+33
2021-12-04Update docs.Mara Bos-2/+1
2021-11-19Remove unnecessary doc linksMaybe Waffle-2/+0
2021-10-10Update library/std/src/primitive_docs.rsWaffle Lapkin-1/+1
Co-authored-by: fmease <liehr.exchange@gmx.net>
2021-10-10Makes docs for references a little less confusingWaffle Lapkin-5/+5
- Make clear that the `Pointer` trait is related to formatting - Make clear that `&T` (shared reference) implements `Send` (if `T: Send + Sync`)
2021-09-12Add primitive documentation to libcoreJoshua Nelson-21/+25
This works by doing two things: - Adding links that are specific to the crate. Since not all primitive items are defined in `core` (due to lang_items), these need to use relative links and not intra-doc links. - Duplicating `primitive_docs` in both core and std. This allows not needing CARGO_PKG_NAME to build the standard library. It also adds a tidy check to make sure they stay the same.
2021-09-08Bump stage0 compiler to 1.56Mark Rousskov-2/+1
2021-09-08Rollup merge of #88594 - steffahn:more_symbolic_doc_aliases, r=joshtriplettJack Huey-2/+5
More symbolic doc aliases A bunch of small changes, mostly adding `#[doc(alias = "…")]` entries for symbolic `"…"`. Also a small change in documentation of `const` keywords.
2021-09-05Additional aliases for pointersFrank Steffahn-0/+3
2021-09-05Auto merge of #88469 - patrick-gu:master, r=dtolnaybors-14/+20
Add links in docs for some primitive types This pull request adds additional links in existing documentation of some of the primitive types. Where items are linked only once, I have used the `[link](destination)` format. For items in `std`, I have linked directly to the HTML, since although the primitives are in `core`, they are not displayed on `core` documentation. I was unsure of what length I should keep lines of documentation to, so I tried to keep them within reason. Additionally, I have avoided excessively linking to keywords like `self` when they are not relevant to the documentation. I can add these links if it would be an improvement. I hope this can improve Rust. Please let me know if there's anything I did wrong!
2021-09-03Remove excessive linkingpatrick-gu-22/+19
2021-09-03Update primitive docs for rust 2021.Mara Bos-7/+11
2021-09-02Consistent placement of doc alias for primitives below the `doc(primitive…)`Frank Steffahn-2/+2
2021-08-29Add links in docs for some primitive typespatrick-gu-29/+38
2021-07-29Fix may not to appropriate might not or must notAli Malik-1/+1
2021-06-23Use HTTPS links where possibleSmitty-2/+2
2021-05-24remove cfg(bootstrap)Pietro Albini-6/+3
2021-05-15Add doc aliases to `unit`r00ster-0/+3
2021-05-05Rollup merge of #83553 - jfrimmel:addr-of, r=m-ou-seRalf Jung-1/+21
Update `ptr` docs with regards to `ptr::addr_of!` This updates the documentation since `ptr::addr_of!` and `ptr::addr_of_mut!` are now stable. One might remove the distinction between the sections `# On packed structs` and `# Examples`, as the old section on packed structs was primarily to prevent users of doing undefined behavior, which is not necessary anymore. Technically there is now wrong/outdated documentation on stable, but I don't think this is worth a point release 😉 Fixes #83509. ``````````@rustbot`````````` modify labels: T-doc
2021-05-03Update `ptr` docs with regards to `ptr::addr_of!`Julian Frimmel-1/+21
This updates the documentation since `ptr::addr_of!` and `ptr::addr_of_mut!` are now stable. One might remove the distinction between the sections `# On packed structs` and `# Examples`, as the old section on packed structs was primarily to prevent users of doing unde- fined behavior, which is not necessary anymore. There is also a new section in "how to obtain a pointer", which referen- ces the `ptr::addr_of!` macros. This commit contains squashed commits from code review. Co-authored-by: Joshua Nelson <joshua@yottadb.com> Co-authored-by: Mara Bos <m-ou.se@m-ou.se> Co-authored-by: Soveu <marx.tomasz@gmail.com> Co-authored-by: Ralf Jung <post@ralfj.de>
2021-04-29Ignore doctests in bootstrapest31-1/+2
On bootstrap the IntoIterator trait is not implemented yet for arrays.
2021-04-28Add a paragraph with possible alternatives on older editionsest31-0/+42
2021-04-26Point out that behavior might be switched on 2015 and 2018 editions too one dayest31-2/+4
2021-04-25Auto merge of #84147 - cuviper:array-method-dispatch, r=nikomatsakis,m-ou-sebors-20/+57
Cautiously add IntoIterator for arrays by value Add the attribute described in #84133, `#[rustc_skip_array_during_method_dispatch]`, which effectively hides a trait from method dispatch when the receiver type is an array. Then cherry-pick `IntoIterator for [T; N]` from #65819 and gate it with that attribute. Arrays can now be used as `IntoIterator` normally, but `array.into_iter()` has edition-dependent behavior, returning `slice::Iter` for 2015 and 2018 editions, or `array::IntoIter` for 2021 and later. r? `@nikomatsakis` cc `@LukasKalbertodt` `@rust-lang/libs`
2021-04-24Ignore array IntoIterator tests in bootstrapJosh Stone-2/+4
2021-04-19Update library/std/src/primitive_docs.rsTrevor Spiteri-2/+2
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
2021-04-16doc: use U+2212 for minus sign in floating-point -0.0 remarksTrevor Spiteri-4/+4
Also remove plus sign in `-0.0 == +0.0` to make it a valid expression.
2021-04-16Document the edition behavior for array.into_iter()Josh Stone-0/+50
2021-04-16Adjust docs and tests for new `IntoIterator` impl for arraysLukas Kalbertodt-19/+4
2021-03-22Rephrase -0.0 docsJubilee Young-4/+4
2021-03-22Update signed fmt/-0f32 docsJubilee Young-3/+5
"semantic equivalence" is too strong a phrasing here, which is why actually explaining what kind of circumstances might produce a -0 was chosen instead.
2021-02-25Convert primitives to use intra-doc linksJoshua Nelson-3/+3
2021-01-03Auto merge of #80590 - camelid:bool-never-docs, r=nagisabors-6/+7
Update `bool` and `!` docs
2021-01-01always demands -> requiresCamelid-1/+1
2021-01-01Update `bool` and `!` docsCamelid-6/+7
2020-12-31Remove many unnecessary manual link resolves from libraryCamelid-3/+0
Now that #76934 has merged, we can remove a lot of these! E.g, this is no longer necessary: [`Vec<T>`]: Vec
2020-12-21Rollup merge of #80159 - jyn514:array, r=m-ou-seDylan DPC-1/+3
Add array search aliases Missed this in https://github.com/rust-lang/rust/pull/80068. This one will really fix https://github.com/rust-lang/rust/issues/46075. The last alias especially I'm a little unsure about - maybe fuzzy search should be fixed in rustdoc instead? Happy to make that change although I'd have to figure out how. r? ``@m-ou-se`` although cc ``@GuillaumeGomez`` for the search issue.
2020-12-19Rollup merge of #80068 - jyn514:mut-reference, r=m-ou-seYuki Okushi-0/+1
Add `&mut` as an alias for 'reference' primitive Closes https://github.com/rust-lang/rust/issues/46075.
2020-12-18Add array search aliasesJoshua Nelson-1/+3
2020-12-15Add `&mut` as an alias for 'reference' primitiveJoshua Nelson-0/+1
2020-12-11doc: apply suggestionsWilliam Woodruff-2/+3
2020-12-10doc(array,vec): add notes about side effects when empty-initializingWilliam Woodruff-0/+3
2020-12-02Use more std:: instead of core:: in docs for consistency, add more intra doc ↵Alexis Bourget-2/+2
links
2020-11-05Rollup merge of #78757 - camelid:crate-link-text, r=jyn514Mara Bos-6/+6
Improve and clean up some intra-doc links