use can be used inside a function, but that's not always obvious to a newcomer. (I, for example, didn't realize this was possible from the documentation.) It would be nice if the use-declarations.html page had a brief example of it so it's more obvious.