Macro def_linear

Source
macro_rules! def_linear {
    { $T:tt in $FOR:ty } => { ... };
}
Expand description

Create a new token type $T that is linear, i.e. whose instances are undroppable, meant to be embedded in the type $FOR. $FOR is reported as the type that is being dropped, when a $T is dropped! Call $T::new() to create an instance, and call bury() to get rid of it, preferably inside a method of $FOR that is consuming the $FOR object and cleans it up.