diff options
| author | bors <bors@rust-lang.org> | 2024-10-18 11:11:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-18 11:11:43 +0000 |
| commit | 1350eead10c46b9d3c2007fe0ea7892b7d7337ab (patch) | |
| tree | cb64b35fbe218b685fd687977266e5205562d645 /library/core/tests/pin.rs | |
| parent | acfdb8dd1fd4913ea004f43f73e7346e125491ed (diff) | |
| parent | 80a8f7b0419cc8cbe987a5f68715a435b1654a18 (diff) | |
| download | rust-1350eead10c46b9d3c2007fe0ea7892b7d7337ab.tar.gz rust-1350eead10c46b9d3c2007fe0ea7892b7d7337ab.zip | |
Auto merge of #131887 - jieyouxu:rollup-ftik4ni, r=jieyouxu
Rollup of 9 pull requests Successful merges: - #130136 (Partially stabilize const_pin) - #131755 (Regression test for AVR `rjmp` offset) - #131774 (Add getentropy for RTEMS) - #131802 (Dont ICE when computing coverage of synthetic async closure body) - #131809 (Fix predicate signatures in retain_mut docs) - #131858 (Remove outdated documentation for `repeat_n`) - #131866 (Avoid use imports in `thread_local_inner!`) - #131874 (Default to the medium code model on OpenHarmony LoongArch target) - #131877 (checktools.sh: add link to issue for more context about disabled Miri tests) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/core/tests/pin.rs')
| -rw-r--r-- | library/core/tests/pin.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/core/tests/pin.rs b/library/core/tests/pin.rs index 7a6af46a743..026d2ca8de2 100644 --- a/library/core/tests/pin.rs +++ b/library/core/tests/pin.rs @@ -19,6 +19,10 @@ fn pin_const() { const REF: &'static usize = PINNED.get_ref(); assert_eq!(REF, POINTER); + const INT: u8 = 42; + const STATIC_REF: Pin<&'static u8> = Pin::static_ref(&INT); + assert_eq!(*STATIC_REF, INT); + // Note: `pin_mut_const` tests that the methods of `Pin<&mut T>` are usable in a const context. // A const fn is used because `&mut` is not (yet) usable in constants. const fn pin_mut_const() { |
