This does not make sense (error borrowed value does not live long enough)

type or paste code here
fn main() {
    let v = vec![0usize];
    type T2 = Box<dyn Fn()>;
    let f = || -> T2 {
        Box::new(|| {
            let j2 = &v;
        })
    }; //this doesn't
    let f2 = || -> Box<dyn Fn()> {
        Box::new(|| {
            let j2 = &v;
        })
    }; //this works
}
     0 references | β–Ά Run  | βš™ Debug                                                                                          
  fn main() {                                                                                                                 
󰌡 ▏   let v = vec![0usize];     β–  binding `v` declared here                                                                   
  ▏   type T2 = Box<dyn Fn()>;                                                                                                
 ▏   let f = || -> T2 {     β– β– β–  unused variable: `f`                                                                         
󰌡 ▏   ▏   Box::new(|| {     β–  returning this value requires that `v` is borrowed for `'static`                                
 ▏   ▏   ▏   let j2 = &v;     β– β– β–  `v` does not live long enough  borrowed value does not live long enough                    
  ▏   ▏   })                                                                                                                  
  ▏   }; //this doesn't                                                                                                       
 ▏   let f2 = || -> Box<dyn Fn()> {     β– β–  unused variable: `f2`                                                             
  ▏   ▏   Box::new(|| {                                                                                                       
 ▏   ▏   ▏   let j2 = &v;     β– β–  unused variable: `j2`  `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
  ▏   ▏   })                                                                                                                  
  ▏   }; //this works                                                                                                         
󰌡 }     β–  `v` dropped here while still borrowed                                                                               

In the context of a type alias...

...Box<dyn Trait> is sugar for Box<dyn Trait + 'static>.

In an expression like so...

...it is sugar for Box<dyn Trait + '_>, and the dyn lifetime doesn't have to be 'static.

T2 can work if you add a lifetime parameter to it.

    type T2<'a> = Box<dyn Fn() + 'a>;