Skip to content

Commit 67d2dd9

Browse files
committed
Upgrade to rustc 1.23.0-nightly (33374fa9d 2017-11-20)
1 parent ebdec18 commit 67d2dd9

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
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

Lines changed: 13 additions & 0 deletions
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);

src/size_of_tests.rs

Lines changed: 2 additions & 2 deletions
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 });

0 commit comments

Comments
 (0)