Skip to content

Commit d2df430

Browse files
authored
Merge pull request #99 from KodrAus/fix/nightly
Fix nightly build
2 parents c90f281 + afa05d2 commit d2df430

File tree

12 files changed

+41
-16
lines changed

12 files changed

+41
-16
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ matrix:
1313
- cargo bench --features nightly
1414
- cargo test --features spin_no_std
1515
- cargo bench --features spin_no_std
16+
- cd compiletest
1617
- cargo clean
17-
- cargo test --features compiletest
18+
- cargo test
19+
- cd ../
1820

1921
- rust: nightly
2022
before_script:

Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,9 @@ categories = [ "no-std", "rust-patterns", "memory-management" ]
1717
version = "0.4.6"
1818
optional = true
1919

20-
[dependencies.compiletest_rs]
21-
version = "0.3"
22-
optional = true
23-
2420
[features]
2521
nightly = []
2622
spin_no_std = ["nightly", "spin"]
27-
compiletest = ["compiletest_rs"]
2823

2924
[badges]
3025
appveyor = { repository = "rust-lang-nursery/lazy-static.rs" }

appveyor.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ test_script:
5353
- cargo build --verbose
5454
- cargo test
5555
- if [%CHANNEL%]==[nightly] (
56+
cd compiletest &&
5657
cargo clean &&
57-
cargo build --verbose --features "compiletest" &&
58-
cargo test --features "compiletest"
58+
cargo build --verbose &&
59+
cargo test &&
60+
cd ../
5961
)

compiletest/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "lazy_static_compiletest"
3+
version = "0.0.1"
4+
publish = false
5+
authors = ["lazy_static contributors"]
6+
7+
[dependencies.lazy_static]
8+
path = "../"
9+
10+
[dependencies.compiletest_rs]
11+
version = "0.3"

compiletest/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
This library is a shim around `lazy_static` that disambiguates it with the `lazy_static`
3+
that's shipped with the Rust toolchain. We re-export the entire public API of `lazy_static`
4+
under a different crate name so that can be imported in the compile tests.
5+
6+
This currently appears to use the right local build of `lazy_static`.
7+
*/
8+
9+
#![feature(use_extern_macros)]
10+
11+
extern crate lazy_static;
12+
13+
pub use self::lazy_static::*;

tests/compile-fail/README.md renamed to compiletest/tests/compile-fail/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ warning/note/help/error at compilation. Syntax of annotations is described in
33
[rust documentation](https://github.com/rust-lang/rust/blob/master/src/test/COMPILER_TESTS.md).
44
For more information check out [`compiletest` crate](https://github.com/laumann/compiletest-rs).
55

6-
To run compile tests issue `cargo +nightly --test --features compiletest`.
6+
To run compile tests issue `cargo +nightly --test`.
77

88
## Notes on working with `compiletest` crate
99

tests/compile-fail/incorrect_visibility_restriction.rs renamed to compiletest/tests/compile-fail/incorrect_visibility_restriction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// incorrect visibility restriction
22
#[macro_use]
3-
extern crate lazy_static;
3+
extern crate lazy_static_compiletest as lazy_static;
44

55
lazy_static! {
66
pub(nonsense) static ref WRONG: () = ();

tests/compile-fail/static_is_private.rs renamed to compiletest/tests/compile-fail/static_is_private.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[macro_use]
2-
extern crate lazy_static;
2+
extern crate lazy_static_compiletest as lazy_static;
33

44
mod outer {
55
pub mod inner {

tests/compile-fail/static_is_sized.rs renamed to compiletest/tests/compile-fail/static_is_sized.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// error-pattern:the trait bound `str: std::marker::Sized` is not satisfied
22
#[macro_use]
3-
extern crate lazy_static;
3+
extern crate lazy_static_compiletest as lazy_static;
44

55
lazy_static! {
66
pub static ref FOO: str = panic!();

tests/compile-fail/static_never_used.rs renamed to compiletest/tests/compile-fail/static_never_used.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// error-pattern:static item is never used: `UNUSED`
22
#![deny(dead_code)]
33
#[macro_use]
4-
extern crate lazy_static;
4+
extern crate lazy_static_compiletest as lazy_static;
55

66
lazy_static! {
77
static ref UNUSED: () = ();

0 commit comments

Comments
 (0)