Skip to content

Commit

Permalink
fix build on nightly (rust-lang/rust#45860)
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-joseph-rust committed Nov 13, 2017
1 parent 30a28c4 commit fd3561d
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ relm = "0.10"
relm-derive = "0.10"
shakmaty = "0.4"

[build-dependencies]
version_check = "0.1"

[dev-dependencies]
rand = "0.3"
relm-attributes = "0.10"
26 changes: 26 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This file is part of the chessground library.
// Copyright (C) 2017 Niklas Fiekas <[email protected]>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

extern crate version_check;

fn main() {
println!("cargo:rerun-if-changed=build.rs");

// detect support for nightly features
if let Some(true) = version_check::supports_features() {
println!("cargo:rustc-cfg=nightly");
}
}
1 change: 1 addition & 0 deletions src/boardstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

use std::f64::consts::PI;

#[cfg(not(nightly))]
use option_filter::OptionFilterExt;

use cairo::prelude::*;
Expand Down
1 change: 1 addition & 0 deletions src/ground.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use std::f64::consts::PI;
use std::cmp::{min, max};
use std::fmt;

#[cfg(not(nightly))]
use option_filter::OptionFilterExt;

use gtk;
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#![warn(missing_debug_implementations)]

#![cfg_attr(nightly, feature(option_filter))]

extern crate gtk;
extern crate gdk;
extern crate cairo;
Expand Down
1 change: 1 addition & 0 deletions src/pieces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

use std::f64::consts::PI;

#[cfg(not(nightly))]
use option_filter::OptionFilterExt;

use time::SteadyTime;
Expand Down
1 change: 1 addition & 0 deletions src/promotable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

use std::f64::consts::PI;

#[cfg(not(nightly))]
use option_filter::OptionFilterExt;

use time::SteadyTime;
Expand Down

0 comments on commit fd3561d

Please sign in to comment.