Skip to content

Commit 096bd88

Browse files
author
bors-servo
authored
Auto merge of #205 - servo:rustup, r=nox
Upgrade to rustc 1.23.0-nightly (33374fa9d 2017-11-20) <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-cssparser/205) <!-- Reviewable:end -->
2 parents ebdec18 + e38b3f9 commit 096bd88

9 files changed

+22
-8
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ smallvec = "0.4.3"
3232
[build-dependencies]
3333
syn = "0.11"
3434
quote = "0.3"
35+
rustc_version = "0.2"
3536

3637
[features]
3738
bench = []

build.rs

+13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
extern crate quote;
66
extern crate syn;
7+
extern crate rustc_version;
78

89
use std::env;
910
use std::path::Path;
@@ -33,6 +34,18 @@ mod codegen {
3334
}
3435

3536
fn main() {
37+
let rustc = rustc_version::version_meta().unwrap();
38+
let commit_date = match rustc.commit_date {
39+
Some(ref s) => &**s,
40+
None => "unknown", // Sorts after a date
41+
};
42+
if (rustc.semver.major, rustc.semver.minor, rustc.semver.patch, commit_date) >=
43+
(1, 23, 0, "2017-11-20")
44+
{
45+
// https://github.com/rust-lang/rust/pull/45225
46+
println!("cargo:rustc-cfg=rustc_has_pr45225")
47+
}
48+
3649
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
3750
let tokenizer_rs = Path::new(&manifest_dir).join("src/tokenizer.rs");
3851
codegen::main(&tokenizer_rs);

macros/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern crate proc_macro;
88
#[macro_use] extern crate quote;
99
extern crate syn;
1010

11-
use std::ascii::AsciiExt;
11+
#[allow(unused_imports)] use std::ascii::AsciiExt;
1212

1313
define_proc_macros! {
1414
/// Input: the arms of a `match` expression.

src/nth.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
use std::ascii::AsciiExt;
5+
#[allow(unused_imports)] use std::ascii::AsciiExt;
66

77
use super::{Token, Parser, ParserInput, BasicParseError};
88

src/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use cow_rc_str::CowRcStr;
66
use smallvec::SmallVec;
77
use std::ops::Range;
8-
use std::ascii::AsciiExt;
8+
#[allow(unused_imports)] use std::ascii::AsciiExt;
99
use std::ops::BitOr;
1010
use tokenizer::{Token, Tokenizer, SourcePosition, SourceLocation};
1111

src/rules_and_declarations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use cow_rc_str::CowRcStr;
88
use parser::{parse_until_before, parse_until_after, parse_nested_block, ParserState};
9-
use std::ascii::AsciiExt;
9+
#[allow(unused_imports)] use std::ascii::AsciiExt;
1010
use super::{Token, Parser, Delimiter, ParseError, BasicParseError, BasicParseErrorKind};
1111

1212
/// Parse `!important`.

src/serializer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use dtoa_short::{self, Notation};
66
use itoa;
7-
use std::ascii::AsciiExt;
7+
#[allow(unused_imports)] use std::ascii::AsciiExt;
88
use std::fmt::{self, Write};
99
use std::io;
1010
use std::str;

src/size_of_tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ size_of_test!(std_cow_str, Cow<'static, str>, 32);
3737
size_of_test!(cow_rc_str, CowRcStr, 16);
3838

3939
size_of_test!(tokenizer, ::tokenizer::Tokenizer, 72);
40-
size_of_test!(parser_input, ::parser::ParserInput, 144);
40+
size_of_test!(parser_input, ::parser::ParserInput, if cfg!(rustc_has_pr45225) { 136 } else { 144 });
4141
size_of_test!(parser, ::parser::Parser, 16);
4242
size_of_test!(source_position, ::SourcePosition, 8);
4343
size_of_test!(parser_state, ::ParserState, 24);
4444

4545
size_of_test!(basic_parse_error, ::BasicParseError, 48);
46-
size_of_test!(parse_error_lower_bound, ::ParseError<()>, 56);
46+
size_of_test!(parse_error_lower_bound, ::ParseError<()>, if cfg!(rustc_has_pr45225) { 48 } else { 56 });

src/tokenizer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use std::ops::Range;
88
use std::char;
9-
use std::ascii::AsciiExt;
9+
#[allow(unused_imports)] use std::ascii::AsciiExt;
1010
use std::i32;
1111

1212
use parser::ParserState;

0 commit comments

Comments
 (0)