Debian Codegraph @

.cargo/vendor/zerocopy/tests/ui-stable/ptr-is-invariant-over-v.rs

raw
1 use zerocopy::pointer::{
2 invariant::{Aligned, Exclusive, Shared, Valid},
3 Ptr,
4 };
5
6 fn _when_exclusive<'big: 'small, 'small>(
7 big: Ptr<'small, &'big u32, (Exclusive, Aligned, Valid)>,
8 mut _small: Ptr<'small, &'small u32, (Exclusive, Aligned, Valid)>,
9 ) {
10 _small = big;
11 }
12
13 fn _when_shared<'big: 'small, 'small>(
14 big: Ptr<'small, &'big u32, (Shared, Aligned, Valid)>,
15 mut _small: Ptr<'small, &'small u32, (Shared, Aligned, Valid)>,
16 ) {
17 _small = big;
18 }
19
20 fn main() {}