The lifetime of outer is the entirety of your function, while the lifetime of inner is the body of the function. Thus inner is dropped too soon. When you create a new variable fn1_outer (last example) its lifetime is inferred to be shorter than the function body.