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

std: Enable usage of `thread_local!` through imports #55597

Merged
merged 1 commit into from Nov 6, 2018

Conversation

Projects
None yet
4 participants
@alexcrichton
Member

alexcrichton commented Nov 1, 2018

The thread_local! macro delegated to an internal macro but it didn't
do so in a macros-and-the-module-system compatible fashion, meaning if a
#![no_std] crate imported std and tried to use thread_local! it
would fail due to missing a lookup of an internal macro.

This commit switches the macro to instead use $crate to invoke other
macros, ensuring that it'll work when thread_local! is imported alone.

std: Enable usage of `thread_local!` through imports
The `thread_local!` macro delegated to an internal macro but it didn't
do so in a macros-and-the-module-system compatible fashion, meaning if a
`#![no_std]` crate imported `std` and tried to use `thread_local!` it
would fail due to missing a lookup of an internal macro.

This commit switches the macro to instead use `$crate` to invoke other
macros, ensuring that it'll work when `thread_local!` is imported alone.
@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Nov 1, 2018

r? @KodrAus

(rust_highfive has picked a reviewer for you, use r? to override)

@KodrAus

This comment has been minimized.

KodrAus commented Nov 1, 2018

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Nov 1, 2018

📌 Commit ff5226c has been approved by KodrAus

kennytm added a commit to kennytm/rust that referenced this pull request Nov 6, 2018

Rollup merge of rust-lang#55597 - alexcrichton:thread-local-inner, r=…
…KodrAus

std: Enable usage of `thread_local!` through imports

The `thread_local!` macro delegated to an internal macro but it didn't
do so in a macros-and-the-module-system compatible fashion, meaning if a
`#![no_std]` crate imported `std` and tried to use `thread_local!` it
would fail due to missing a lookup of an internal macro.

This commit switches the macro to instead use `$crate` to invoke other
macros, ensuring that it'll work when `thread_local!` is imported alone.

bors added a commit that referenced this pull request Nov 6, 2018

Auto merge of #55710 - kennytm:rollup, r=kennytm
Rollup of 13 pull requests

Successful merges:

 - #55490 (resolve: Fix ICE in macro import error recovery)
 - #55501 (Make `process_obligations`' computation of `completed` optional.)
 - #55597 (std: Enable usage of `thread_local!` through imports)
 - #55601 (Fix tracking issue numbers for some unstable features)
 - #55621 (Add precision for create_dir function)
 - #55626 (Update emscripten)
 - #55644 (ci: Add Dockerfile for dist-powerpcspe-linux)
 - #55664 (Make "all possible cases" help message uniform with existing help messages)
 - #55689 (miri: binary_op_val -> binary_op_imm)
 - #55694 (Fixes #31076)
 - #55696 (NLL Diagnostic Review 3: Missing errors for borrows of union fields )
 - #55700 (Update ui tests with respect to NLL)
 - #55703 (Update `configure --help` (via configure.py) to reflect decoupling of debug+optimize)

Failed merges:

r? @ghost

kennytm added a commit to kennytm/rust that referenced this pull request Nov 6, 2018

Rollup merge of rust-lang#55597 - alexcrichton:thread-local-inner, r=…
…KodrAus

std: Enable usage of `thread_local!` through imports

The `thread_local!` macro delegated to an internal macro but it didn't
do so in a macros-and-the-module-system compatible fashion, meaning if a
`#![no_std]` crate imported `std` and tried to use `thread_local!` it
would fail due to missing a lookup of an internal macro.

This commit switches the macro to instead use `$crate` to invoke other
macros, ensuring that it'll work when `thread_local!` is imported alone.

bors added a commit that referenced this pull request Nov 6, 2018

Auto merge of #55710 - kennytm:rollup, r=kennytm
Rollup of 11 pull requests

Successful merges:

 - #55490 (resolve: Fix ICE in macro import error recovery)
 - #55597 (std: Enable usage of `thread_local!` through imports)
 - #55601 (Fix tracking issue numbers for some unstable features)
 - #55621 (Add precision for create_dir function)
 - #55644 (ci: Add Dockerfile for dist-powerpcspe-linux)
 - #55664 (Make "all possible cases" help message uniform with existing help messages)
 - #55689 (miri: binary_op_val -> binary_op_imm)
 - #55694 (Fixes #31076)
 - #55696 (NLL Diagnostic Review 3: Missing errors for borrows of union fields)
 - #55700 (Update ui tests with respect to NLL)
 - #55703 (Update `configure --help` (via configure.py) to reflect decoupling of debug+optimize)
@bors

This comment has been minimized.

Contributor

bors commented Nov 6, 2018

⌛️ Testing commit ff5226c with merge f90aab7...

@bors bors merged commit ff5226c into rust-lang:master Nov 6, 2018

1 of 2 checks passed

homu Testing commit ff5226cd2fa12fe82c7cef8112905af7cb48fe9d with merge f90aab7aa9bb5834b340eaef0326994e5e09b933...
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@alexcrichton alexcrichton deleted the alexcrichton:thread-local-inner branch Nov 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment