'static is a special lifetime, which can be treated as "arbitrarily large". For references, since the lifetime annotation is the lower bound, that means "&'static T must live arbitrarily long", i.e. "&'static T must live until the program termination".
This is the valid implementation of ok, with the same signature as it is in your code. But in this case, borrow would be used by spawned thread, and the caller, i.e. main, can't know how long this thread will run and how long it will hold this borrow - so it must be 'static. In fact, this function, with the only change being lifetime annotation in signature, won't compile:
Now, since Rust doesn't look at function body when verifying its caller, it can't possibly know whether ok is empty (as in your case) or really uses borrow as 'static (as here). And the signature clearly tells it that this is the latter.
Lifetime errors are sometimes a bit hard to understand. Even without understanding the errors fully, you should try to remember some antipatterns, in particular&'a mut Type where Type itself contains the same lifetime 'a syntactically is (almost) never something you’ll want to have, like the &'s mut &'s str you had here. Quite related, &'static mut Type is (almost) never something you’ll want.
Note that both cases talk about &'a mut reference, so mutable references. With immutable/shared references you might indeed sometimes encounter &'a Type where Type itself contains the same lifetime 'a, or &'static Type.