-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rewrite TLS to require less usage of @
#7677
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
Conversation
\o/ |
After @nikomatsakis's comment on #7673, it actually turns out that I can work around the compiler right now in a bit of an odd way to get TLS to not require |
Turns out I was able to work around everything completely (with excessive use of Things also changed a fair amount from previously. I'd definitely appreciate someone reading the comments to make sure that I'm still sane. |
One unfortunate side effect is that for now |
cc #6004 and #3273 This is a rewrite of TLS to get towards not requiring `@` when using task local storage. Most of the rewrite is straightforward, although there are two caveats: 1. Changing `local_set` to not require `@` is blocked on #7673 2. The code in `local_pop` is some of the most unsafe code I've written. A second set of eyes should definitely scrutinize it... The public-facing interface currently hasn't changed, although it will have to change because `local_data::get` cannot return `Option<T>`, nor can it return `Option<&T>` (the lifetime isn't known). This will have to be changed to be given a closure which yield `&T` (or as an Option). I didn't do this part of the api rewrite in this pull request as I figured that it could wait until when `@` is fully removed. This also doesn't deal with the issue of using something other than functions as keys, but I'm looking into using static slices (as mentioned in the issues).
Awesome, thanks |
…msteffen fix bug for large_enum_variants Fix the discussion problem in the issue of rust-lang/rust-clippy#7666 (comment) About the false positive problem of case: ```rust enum LargeEnum6 { A, B([u8;255]), C([u8;200]), } ``` changelog: Fix largest_enum_variant wrongly identifying the second largest variant.
cc #6004 and #3273
This is a rewrite of TLS to get towards not requiring
@
when using task local storage. Most of the rewrite is straightforward, although there are two caveats:local_set
to not require@
is blocked on Polymorphically creating traits barely works #7673local_pop
is some of the most unsafe code I've written. A second set of eyes should definitely scrutinize it...The public-facing interface currently hasn't changed, although it will have to change because
local_data::get
cannot returnOption<T>
, nor can it returnOption<&T>
(the lifetime isn't known). This will have to be changed to be given a closure which yield&T
(or as an Option). I didn't do this part of the api rewrite in this pull request as I figured that it could wait until when@
is fully removed.This also doesn't deal with the issue of using something other than functions as keys, but I'm looking into using static slices (as mentioned in the issues).