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

Use a &'static Log rather than raw pointer #228

Merged
merged 1 commit into from Sep 28, 2017

Conversation

Projects
None yet
2 participants
@sfackler
Copy link
Member

sfackler commented Sep 28, 2017

This allows us to make try_set_logger_raw a safe function. It turns out
that every example dealing with that function was violating the static
lifetime requirement. Fun!

r? @alexcrichton

Use a &'static Log rather than raw pointer
This allows us to make try_set_logger_raw a safe function. It turns out
that every example dealing with that function was violating the static
lifetime requirement. Fun!
@sfackler

This comment has been minimized.

Copy link
Member Author

sfackler commented Sep 28, 2017

We're now temptingly close to being entirely no_std. It's kind of unfortunate we don't have a Box<T> -> &'static T safe function in the standard library.

@alexcrichton alexcrichton merged commit 2901ed5 into rust-lang-nursery:master Sep 28, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Sep 28, 2017

👍

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Sep 28, 2017

I wonder, would this enable us to turn off the std feature by default? That may make it actually feasible to disable std in larger applications

@sfackler sfackler deleted the sfackler:no-raw-ptr branch Sep 28, 2017

@sfackler

This comment has been minimized.

Copy link
Member Author

sfackler commented Sep 28, 2017

Yeah - that's what I'm kind of wondering. Loggers that have state are going to want the Box interface but they can opt into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.