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

lazy_static without unsafe? #125

Closed
matthiasbeyer opened this Issue Sep 27, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@matthiasbeyer

matthiasbeyer commented Sep 27, 2018

Hi,

I'm trying to use #![forbid(unsafe_code)] but I also want to use lazy_static!() - is there a way?

My failling travis job is here

@KodrAus

This comment has been minimized.

Contributor

KodrAus commented Oct 30, 2018

Hmm, the problem here is that the macro-generated deref impl for lazy statics uses an unsafe block because it accesses a 'static mut. In #124 we're removing the need for 'static mut, so we should be able to work properly with crates that #![forbid(unsafe_code)].

@KodrAus

This comment has been minimized.

Contributor

KodrAus commented Nov 4, 2018

Alrighty! It should be possible now to use lazy_static 1.2.0 alongside #![forbid(unsafe_code)].

@KodrAus KodrAus closed this Nov 4, 2018

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