about summary refs log tree commit diff
path: root/library/alloc/src/macros.rs
AgeCommit message (Collapse)AuthorLines
2021-06-30Remove alloc/malloc/calloc/realloc doc aliasesAmanieu d'Antras-2/+0
2021-02-14Only define rustc_diagnostic_item format_macro in not(test).Mara Bos-1/+1
2021-02-14Improve suggestion for panic!(format!(..)).Mara Bos-0/+1
2021-01-22Auto merge of #79233 - yoshuawuyts:alloc-doc-alias, r=GuillaumeGomezbors-0/+2
Add doc aliases for memory allocations This patch adds doc aliases for various C allocation functions, making it possible to search for the C-equivalent of a function and finding the (safe) Rust counterpart: - `Vec::with_capacity` / `Box::new` / `vec!` -> alloc + malloc, allocates memory - `Box::new_zeroed` -> calloc, allocates zeroed-out memory - `Vec::{reserve,reserve_exact,try_reserve_exact,shrink_to_fit,shrink_to}` -> realloc, reallocates a previously allocated slice of memory It's worth noting that `Vec::new` does not allocate, so we don't link to it. Instead people are probably looking for `Vec::with_capacity` or `vec!`. I hope this will allow people comfortable with the system allocation APIs to make it easier to find what they may be looking for. Thanks!
2021-01-22Add doc aliases for memory allocationsYoshua Wuyts-0/+2
- Vec::with_capacity / Box::new -> alloc + malloc - Box::new_zeroed -> calloc - Vec::{reserve,reserve_exact,try_reserve_exact,shrink_to_fit,shrink_to} -> realloc
2021-01-21Rename alloc::force_expr to __rust_force_expr.Mara Bos-4/+4
2021-01-21Turn alloc's force_expr macro into a regular macro_rules!{}.Mara Bos-3/+13
Otherwise rust-analyzer doesn't understand vec![].
2021-01-17Force vec! to expressions onlyDániel Buga-4/+4
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-10-31Fix doc links to std::fmtIvan Pavluk-2/+2
std::format and core::write macros' docs linked to core::fmt for format string reference, even though only std::fmt has format string documentation and the link titles were std::fmt.
2020-08-21Use intra-doc-links in `alloc`LeSeulArtichaut-6/+5
2020-07-27mv std libs to library/mark-0/+110