rust/library/std
Trevor Gross 02cf62c596
Rollup merge of #130962 - nyurik:opts-libs, r=cuviper
Migrate lib's `&Option<T>` into `Option<&T>`

Trying out my new lint https://github.com/rust-lang/rust-clippy/pull/13336 - according to the [video](https://www.youtube.com/watch?v=6c7pZYP_iIE), this could lead to some performance and memory optimizations.

Basic thoughts expressed in the video that seem to make sense:
* `&Option<T>` in an API breaks encapsulation:
  * caller must own T and move it into an Option to call with it
  * if returned, the owner must store it as Option<T> internally in order to return it
* Performance is subject to compiler optimization, but at the basics, `&Option<T>` points to memory that has `presence` flag + value, whereas `Option<&T>` by specification is always optimized to a single pointer.
2024-10-11 23:57:44 -04:00
..
benches Reformat use declarations. 2024-07-29 08:26:52 +10:00
src Rollup merge of #130962 - nyurik:opts-libs, r=cuviper 2024-10-11 23:57:44 -04:00
tests rustc_target: Add sme-b16b16 as an explicit aarch64 target feature 2024-10-10 10:24:57 +00:00
build.rs enable f16 and f128 on windows-gnullvm targets 2024-10-05 23:55:39 +02:00
Cargo.toml Update compiler-builtins to 0.1.133 2024-10-05 21:34:51 -05:00