Skip to content
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

Local storage is always initialized #11812

Closed
brson opened this issue Jan 26, 2014 · 2 comments
Closed

Local storage is always initialized #11812

brson opened this issue Jan 26, 2014 · 2 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

Comments

@brson
Copy link
Contributor

brson commented Jan 26, 2014

The TLS destructor code (https://github.com/mozilla/rust/blob/master/src/libstd/rt/task.rs#L161) always expects the storage map to exist, even though TLS is initialized lazily. This implies that every task is using TLS and defeating lazy initialization. Figure out what is causing this and stop it.

@alexcrichton
Copy link
Member

I'm a little confused, the inner part of the LocalStorage struct is an Option, so it shouldn't ever get initialized if local storage isn't used?

@brson
Copy link
Contributor Author

brson commented Jan 26, 2014

Oh, hm. I thought .take() returned T, but it returns Option<T>. Think this issue is bogus.

@brson brson closed this as completed Jan 26, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 8, 2024
Return `Some` from `walk_to_expr_usage` more

fixes rust-lang#11786
supersedes rust-lang#11097

The code removed in the first commit would have needed changes due to the second commit. Since it's useless it just gets removed instead.

changelog: `needless_borrow`: Fix linting in tuple and array expressions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
Projects
None yet
Development

No branches or pull requests

2 participants