File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,13 @@ use core::marker::PhantomData;
5959/// than `'static`). This requirement gives an earlier error when `NonDeDuplicated` is used other
6060/// than intended.
6161///
62- /// We don't just limit to be `:'static`, because then `NonDeDuplicated` could still be somewhat
62+ /// We don't just limit `T` to be `:'static`, because then `NonDeDuplicated` could still be somewhat
6363/// used with non-static lifetimes, and the error would surface only later. The following **would**
6464/// compile:
6565/// ```rust
6666/// # use core::cell::Cell;
6767///
68+ /// #[repr(transparent)]
6869/// pub struct NonDeDuplicatedStatic<T: 'static> {
6970/// cell: Cell<T>,
7071///}
@@ -75,7 +76,7 @@ use core::marker::PhantomData;
7576/// ```
7677/// Only the following would then fail (to compile):
7778/// ```rust,ignore
78- /// fn caller<'a>(r: &'a u8) { let u = 0u8; callee(NonDeDuplicatedStatic::new(uref )); }
79+ /// fn caller<'a>(r: &'a u8) { let u = 0u8; callee(NonDeDuplicatedStatic::new(&u )); }
7980/// ```
8081///
8182/// But, by requiring [NonDeDuplicatedFlexible]'s generic parameter `OWN` (or [NonDeDuplicated]'s
You can’t perform that action at this time.
0 commit comments