See this:
it appears that the return type from create_static
still captures the lifetime of its argument _s
, despite being declared as + 'static
, and that argument not being used. Which seems odd, especially since if you replace S
with &str
in args of both alpha
and create_static
, it works fine (the return type doesn't capture the unnamed lifetime of &str).
What am I missing here, and/or is there a way to use impl Trait
in the return position to indicate that the returned impl is 'static
?