1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use crate::*;
/// Checks if a type is a mutable reference type.
///
/// Returns true if the type is `&mut T`, false otherwise (including `&T` and other types).
pub
/// Implements the context! procedural macro.
///
/// This macro generates a let statement that converts a context pointer into a reference.
/// The generated code performs an unsafe conversion from a raw pointer to a reference
/// through the `Into` trait.
///
/// The mutability of the generated reference is determined by the optional type annotation:
/// - If the type annotation contains `&mut`, generates `leak_mut()` call
/// - Otherwise, generates `leak()` call (default behavior)
///
/// # Arguments
///
/// - `TokenStream` - The input token stream containing the variable name identifier
/// and an optional type annotation (e.g., `ctx` or `ctx: &mut Context`).
///
/// # Returns
///
/// - `TokenStream` - The generated let statement binding the variable to the converted context reference.
pub