rust/library/core
Yuki Okushi ff3c8cb518
Rollup merge of #77726 - fusion-engineering-forks:static-pin, r=dtolnay
Add Pin::static_ref, static_mut.

This adds `Pin::static_ref` and `Pin::static_mut`, which convert a static reference to a pinned static reference.

Static references are effectively already pinned, as what they refer to has to live forever and can never be moved.

---

Context: I want to update the `sys` and `sys_common` mutexes/rwlocks/condvars to use `Pin<&self>` in their functions, instead of only warning in the unsafety comments that they may not be moved. That should make them a little bit less dangerous to use. Putting such an object in a `static` (e.g. through `sys_common::StaticMutex`) fulfills the requirements about never moving it, but right now there's no safe way to get a `Pin<&T>` to a `static`. This solves that.
2020-10-21 13:59:29 +09:00
..
benches Remove redundant 'static from library crates 2020-10-18 17:25:51 +02:00
src Rollup merge of #77726 - fusion-engineering-forks:static-pin, r=dtolnay 2020-10-21 13:59:29 +09:00
tests Rollup merge of #77892 - est31:remove_redundant_absolute_paths, r=lcnr 2020-10-14 06:02:36 +09:00
Cargo.toml mv std libs to library/ 2020-07-27 19:51:13 -05:00