rust-lang-nursery / lazy-static.rs

A small macro for defining lazy evaluated static variables in Rust.
Apache License 2.0
1.9k stars 111 forks source link

Update examples for 2018 edition #134

Closed ralexstokes closed 4 years ago

ralexstokes commented 5 years ago

Addresses #120

Removes #[macro_use] extern crate lazy_static; in favor of the simpler use lazy_static::lazy_static enabled in 2018 edition.

ralexstokes commented 5 years ago

the build is failing when run on Linux w/ Rust 1.24.1 which doesn't support 2018 edition.

do we want to test with a newer version of Rust or is there a particular reason we are targeting that specific version?

BurntSushi commented 5 years ago

@ralexstokes lazy_static is a core crate in the ecosystem, and for that reason is generally conservative with respect to the Rust version it supports. One possible way around this would be to continue to run the core test suite on Rust 1.24, but only run the example tests on newer versions of Rust.

fbruetting commented 5 years ago

According to the official Rust 2018 article it should be no problem to mix 2015 binaries with 2018 crates…?

KodrAus commented 5 years ago

@fbruetting That's right, but since any new projects that are created with recent Rust compilers will default to the 2018 edition it seems most helpful to make our getting started examples use it.

AndyGauge commented 4 years ago

Would it be alright if I put a PR against this branch to resolve the 1.24 build?

KodrAus commented 4 years ago

@AndyGauge or if you'd like to submit a new PR based off https://github.com/rust-lang-nursery/lazy-static.rs/pull/134/commits/3b036d3a0a65ecc64cc7abe191dc2d744b5e6f2d that would also be really appreciated!

AndyGauge commented 4 years ago

Looks like minimum rust version increased to 1.27.2, but the 2018 edition still needs to be fixed. Haven't had time until today to start looking at this.

LukasKalbertodt commented 4 years ago

Superseeded by #159