-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid use imports in thread_local_inner!
#131866
Conversation
By using qualified imports, i.e. `$crate::...::LocalKey`.
@bors r+ rollup |
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 rust-lang#131863.
Rollup of 3 pull requests Successful merges: - rust-lang#131809 (Fix predicate signatures in retain_mut docs) - rust-lang#131858 (Remove outdated documentation for `repeat_n`) - rust-lang#131866 (Avoid use imports in `thread_local_inner!`) r? `@ghost` `@rustbot` modify labels: rollup
@rustbot label beta-nominated |
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:
|
Given that no one complained during the entire 1.81 cycle, this doesn't seem very urgent. Beta should be enough imo |
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 rust-lang#131863.
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 rust-lang#131863.
Rollup of 9 pull requests Successful merges: - rust-lang#130136 (Partially stabilize const_pin) - rust-lang#131755 (Regression test for AVR `rjmp` offset) - rust-lang#131774 (Add getentropy for RTEMS) - rust-lang#131802 (Dont ICE when computing coverage of synthetic async closure body) - rust-lang#131809 (Fix predicate signatures in retain_mut docs) - rust-lang#131858 (Remove outdated documentation for `repeat_n`) - rust-lang#131866 (Avoid use imports in `thread_local_inner!`) - rust-lang#131874 (Default to the medium code model on OpenHarmony LoongArch target) - rust-lang#131877 (checktools.sh: add link to issue for more context about disabled Miri tests) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#131866 - jieyouxu:thread_local, r=jhpratt 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 rust-lang#131863.
Previously, the use imports in
thread_local_inner!
can shadow user-provided types or type aliases of the namesStorage
,EagerStorage
,LocalStorage
andLocalKey
. 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 ensurethread_local!
s with static decls with type names that match the aforementioned std-internal type names can successfully compile.Fixes #131863.