Avoid use imports in `thread_local_inner!`
Previously, the use imports in thread_local_inner! can shadow user-provided types or type aliases of the names Storage, EagerStorage, LocalStorage and LocalKey. This PR fixes that by dropping the use imports and instead refer to the std-internal types via fully qualified paths. A basic test is added to ensure thread_local!s with static decls with type names that match the aforementioned std-internal type names can successfully compile.
Fixes #131863.
r? @jhpratt
rustbot has assigned @jhpratt. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
@bors r+ rollup
:pushpin: Commit 7b2320c3df9e57e8920a8eeec94e907e3d3e6347 has been approved by jhpratt
It is now in the queue for this repository.
@rustbot label beta-nominated https://github.com/rust-lang/rust/issues/131863#issuecomment-2421186397
Should this be stable nominated too? Maybe it's not worth a point release on its own but if one does happen for some other reason then it might be good to include this?
A comment on the issue says the following about stable nomination:
I think it's uncommon enough that a backport to stable isn't necessary, though that's up to the team.
Given that no one complained during the entire 1.81 cycle, this doesn't seem very urgent. Beta should be enough imo