/// Create a local Env::expect assignment expression from the `pattern: &type`
/// pair which is passed.
Create a local Env::expect assignment expression from the `pattern: &type`
pair which is passed.
Create a local Env :: expect assignment expression from the ` pattern : &type ` pair which is passed .
fn bind_env_reference(arg: PatType) -> Local {
    let arg_span = arg.span();
    let ty = match *arg.ty {
        syn::Type::Reference(syn::TypeReference { lifetime, mutability, elem, .. }) => {
            if mutability.is_some() {
                abort!(mutability.span(), "mutable references cannot be passed by environment");
            }
            if lifetime.is_some() {
                abort!(
                    lifetime.span(),
                    "cannot bind to concrete lifetimes for environment references"
                );
            }
            elem
        }
        ty => abort!(ty.span(), "only references can be passed by environment"),
    };
    Local {
        attrs: vec![],
        let_token: Token![let](arg_span),
        pat: *arg.pat,
        init: Some((
            Token![=](arg_span),
            Box::new(syn::parse_quote!(&*illicit::Env::expect::<#ty>())),
        )),
        semi_token: Token![;](arg_span),
    }
}
fn bind_env_reference ( arg : PatType ) -> Local { let arg_span = arg . span ( ) ; let ty = match * arg . ty { syn :: Type :: Reference ( syn :: TypeReference { lifetime , mutability , elem , .. } ) => { if mutability . is_some ( ) { abort ! ( mutability span ( ) " " ) ; } if lifetime . is_some ( ) { abort ! ( lifetime span ( ) " " ) ; } elem } ty => abort ! ( ty span ( ) " " ) , } ; Local { attrs : vec ! [ ] , let_token : Token ! [ let ] ( arg_span ) , pat : * arg . pat , init : Some ( ( Token ! [ ] ( arg_span ) , Box :: new ( syn :: parse_quote ! ( illicit Env expect ty ( ) ) ) , ) ) , semi_token : Token ! [ ] ( arg_span ) , } }
Create a local Env::expect assignment expression from the `pattern: &type`
pair which is passed.
Create a local Env :: expect assignment expression from the ` pattern : &type ` pair which is passed .
arg
PatType