Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
64839ee
Add Pin::new_static.
m-ou-se Oct 8, 2020
390883e
Make Pin::new_static const.
m-ou-se Oct 8, 2020
104c0f0
Rename Pin::new_static to Pin::static_ref.
m-ou-se Oct 12, 2020
2c71f68
Add Pin::static_mut.
m-ou-se Oct 12, 2020
f83446b
Reword safety guarantee of Pin::static_{ref,mut}.
m-ou-se Oct 13, 2020
df95dce
Add missing `mut`.
m-ou-se Oct 15, 2020
7b652d3
Haiku: explicitly set CMAKE_SYSTEM_NAME when cross-compiling
nielx Sep 19, 2020
cc0b718
Mark inout asm! operands as used in liveness pass
oliviacrain Oct 15, 2020
fd193f2
Treat InOut variables like other input variables
oliviacrain Oct 17, 2020
7b33ae6
Improve wording of "cannot multiply" type error
camelid Oct 18, 2020
003516f
BTreeMap: split off most code of remove and split_off
ssomers Oct 17, 2020
48060f1
rustdoc: Show the correct source filename, without `.html`
camelid Oct 19, 2020
17c6c59
Mark InOut operands as used in RWU table with write_place
oliviacrain Oct 19, 2020
8f0bced
Refactor liveness-issue-77915 to liveness-asm and improve tests
oliviacrain Oct 19, 2020
cb33f95
remove what seems to be an outdated comment
RalfJung Oct 19, 2020
c1766c6
fix static_ptr_ty for foreign statics, and more comments in check_uns…
RalfJung Oct 19, 2020
153e843
fix Rvalue::ty for ThreadLocalRef
RalfJung Oct 19, 2020
9dd0bb6
Do not print braces again print_anon_const already does it
spastorino Oct 19, 2020
d641cb8
Allow NtBlock to parse on check inline const next token
spastorino Oct 19, 2020
dcd2d91
Add inline const macro test
spastorino Oct 19, 2020
243c8e9
Apply some review suggestions
camelid Oct 20, 2020
154acf0
Rollup merge of #77726 - fusion-engineering-forks:static-pin, r=dtolnay
JohnTitor Oct 21, 2020
983299f
Rollup merge of #77976 - oliviacrain:issue-77915-fix, r=matthewjasper
JohnTitor Oct 21, 2020
ec025ba
Rollup merge of #78009 - nielx:fix/CMAKE_SYSTEM_NAME, r=Mark-Simulacrum
JohnTitor Oct 21, 2020
1e9e561
Rollup merge of #78056 - ssomers:btree_chop_up_1, r=dtolnay
JohnTitor Oct 21, 2020
76da0e2
Rollup merge of #78063 - camelid:improve-cannot-multiply-error, r=est…
JohnTitor Oct 21, 2020
0d3f068
Rollup merge of #78094 - camelid:rustdoc-fix-source-title, r=jyn514
JohnTitor Oct 21, 2020
dbb36ab
Rollup merge of #78101 - RalfJung:foreign-static, r=oli-obk
JohnTitor Oct 21, 2020
34c2223
Rollup merge of #78118 - spastorino:inline-const-followups, r=petroch…
JohnTitor Oct 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make Pin::new_static const.
  • Loading branch information
m-ou-se committed Oct 8, 2020
commit 390883e888c580d054ab4a2584c851aba50865e9
3 changes: 2 additions & 1 deletion library/core/src/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,8 @@ impl<T: ?Sized> Pin<&'static T> {
/// This is safe, because the `'static` lifetime guarantees the data will
/// never be moved.
#[unstable(feature = "pin_static_ref", issue = "none")]
pub fn new_static(r: &'static T) -> Pin<&'static T> {
#[rustc_const_unstable(feature = "const_pin", issue = "76654")]
pub const fn new_static(r: &'static T) -> Pin<&'static T> {
// SAFETY: The 'static lifetime guarantees the data will not be
// moved/invalidated until it gets dropped (which is never).
unsafe { Pin::new_unchecked(r) }
Expand Down