We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 956238e commit 9edb1abCopy full SHA for 9edb1ab
library/core/src/pin.rs
@@ -787,7 +787,8 @@ impl<T: ?Sized> Pin<&'static T> {
787
/// This is safe, because the `'static` lifetime guarantees the data will
788
/// never be moved.
789
#[unstable(feature = "pin_static_ref", issue = "none")]
790
- pub fn new_static(r: &'static T) -> Pin<&'static T> {
+ #[rustc_const_unstable(feature = "const_pin", issue = "76654")]
791
+ pub const fn new_static(r: &'static T) -> Pin<&'static T> {
792
// SAFETY: The 'static lifetime guarantees the data will not be
793
// moved/invalidated until it gets dropped (which is never).
794
unsafe { Pin::new_unchecked(r) }
0 commit comments