pub struct AddLt<T: ?Sized>(/* private fields */);Expand description
Require an extra lifetime at the beginning.
If T needed ['a, 'b, 'c] then AddLt<T> needs ['x, 'a, 'b, 'c].
§Examples
use ty_tag::{tag, modifiers::AddLt, Reify, l};
fn with_lt<'a>() {
// error: lifetime may not live long enough
// is_tagged::<'a, &str, &'static str>();
is_tagged::<'a, AddLt<&str>, &'static str>();
}
with_lt();
// Checks that T reifies to U.
fn is_tagged<'a, T: Reify<l!['a], Reified = U>, U>() {}Trait Implementations§
Source§impl<T: Tag> Tag for AddLt<T>
impl<T: Tag> Tag for AddLt<T>
Source§type NeededLifetimes = Cons<Hole, <T as Tag>::NeededLifetimes>
type NeededLifetimes = Cons<Hole, <T as Tag>::NeededLifetimes>
The needed lifetimes by the tagged type.
Auto Trait Implementations§
impl<T> Freeze for AddLt<T>where
T: ?Sized,
impl<T> RefUnwindSafe for AddLt<T>where
T: ?Sized,
impl<T> Send for AddLt<T>where
T: ?Sized,
impl<T> Sync for AddLt<T>where
T: ?Sized,
impl<T> Unpin for AddLt<T>where
T: ?Sized,
impl<T> UnwindSafe for AddLt<T>where
T: ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more