rust/library/std/src
Michael Goulet 262382ff37
Rollup merge of #96173 - jmaargh:jmaargh/with-capacity-doc-fix, r=Dylan-DPC
Fix documentation for  `with_capacity` and `reserve` families of methods

Fixes #95614

Documentation for the following methods
 - `with_capacity`
 - `with_capacity_in`
 - `with_capacity_and_hasher`
 - `reserve`
 - `reserve_exact`
 - `try_reserve`
 - `try_reserve_exact`

was inconsistent and often not entirely correct where they existed on the following types
- `Vec`
- `VecDeque`
- `String`
- `OsString`
- `PathBuf`
- `BinaryHeap`
- `HashSet`
- `HashMap`
- `BufWriter`
- `LineWriter`

since the allocator is allowed to allocate more than the requested capacity in all such cases, and will frequently "allocate" much more in the case of zero-sized types (I also checked `BufReader`, but there the docs appear to be accurate as it appears to actually allocate the exact capacity).

Some effort was made to make the documentation more consistent between types as well.
2022-06-23 14:39:05 -07:00
..
backtrace Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
collections Rollup merge of #96173 - jmaargh:jmaargh/with-capacity-doc-fix, r=Dylan-DPC 2022-06-23 14:39:05 -07:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
f32 Implement IEEE 754-2019 minimun and maximum functions for f32/f64 2021-11-20 10:14:03 +01:00
f64 Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
ffi Fix documentation for with_capacity and reserve families of methods 2022-06-19 20:46:49 +01:00
fs Use gender neutral terms 2022-04-07 08:51:59 +01:00
io Rollup merge of #96173 - jmaargh:jmaargh/with-capacity-doc-fix, r=Dylan-DPC 2022-06-23 14:39:05 -07:00
net Fix stabilization version of Ipv6Addr::to_ipv4_mapped 2022-05-24 01:05:06 +02:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os update ioslice docs to use shared slices 2022-06-21 11:45:17 +02:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path Allow unused_macro_rules in path tests 2022-05-16 08:55:05 +02:00
prelude Finish bumping stage0 2022-05-27 07:36:17 -04:00
process Add test for issue #95178 2022-03-23 05:33:44 +00:00
sync Auto merge of #97791 - m-ou-se:const-locks, r=m-ou-se 2022-06-19 08:20:36 +00:00
sys Rollup merge of #96768 - m-ou-se:futex-fuchsia, r=tmandry 2022-06-22 15:16:09 +09:00
sys_common Rollup merge of #96768 - m-ou-se:futex-fuchsia, r=tmandry 2022-06-22 15:16:09 +09:00
thread Improve docs for is_running to explain use case 2022-06-20 13:42:49 -07:00
time Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
alloc.rs make std not use &A: Allocator instance 2022-06-18 07:38:28 -07:00
ascii.rs Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
backtrace.rs revert changes that cast functions to raw pointers, portability hazard 2022-03-29 20:18:27 -04:00
env.rs add aliases for current_dir 2022-05-24 19:41:40 -07:00
error.rs Fix typo (panick -> panic) 2022-05-29 13:14:59 +04:00
f32.rs Rollup merge of #95483 - golddranks:improve_float_docs, r=joshtriplett 2022-05-09 18:45:35 +02:00
f64.rs Rollup merge of #95483 - golddranks:improve_float_docs, r=joshtriplett 2022-05-09 18:45:35 +02:00
fs.rs Stabilize Path::try_exists() and improve doc 2022-06-14 17:48:55 +02:00
keyword_docs.rs Rollup merge of #98169 - pierwill:dyn-disp, r=JohnTitor 2022-06-17 07:16:58 +09:00
lazy.rs Move/rename lazy::Sync{OnceCell,Lazy} to sync::{Once,Lazy}Lock 2022-06-16 19:54:42 +04:00
lib.rs Auto merge of #96837 - tmiasko:stdio-fcntl, r=joshtriplett 2022-06-10 11:50:39 +00:00
macros.rs Make write/print macros eagerly drop temporaries 2022-05-22 16:11:08 -07:00
num.rs Add Saturating type (based on Wrapping type) 2021-08-10 19:27:01 +02:00
panic.rs Configure panic hook backtrace behavior 2022-02-02 13:46:42 -05:00
panicking.rs Auto merge of #92461 - rust-lang:const_tls_local_panic_count, r=Mark-Simulacrum 2022-05-23 13:04:59 +00:00
path.rs Rollup merge of #97912 - Kixunil:stabilize_path_try_exists, r=dtolnay 2022-06-20 07:37:41 +09:00
primitive_docs.rs rustdoc: change "variadic tuple" notation to look less like real syntax 2022-06-14 12:21:38 -07:00
process.rs Rollup merge of #97150 - ChrisDenton:stdio-create_pipe, r=m-ou-se 2022-06-20 14:56:39 +02:00
rt.rs Change Termination::report return type to ExitCode 2022-01-28 12:53:36 -08:00
time.rs std::time : fix doc variable name 2022-05-23 00:02:09 +02:00