Skip to content

Commit 375b537

Browse files
authored
Auto merge of #310 - servo:ci-woes, r=emilio
Try to fix CI. None
2 parents 4c5d065 + 4244657 commit 375b537

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
override: true
3737

3838
- name: Downgrade phf to a version compatible with the MSRV
39-
run: cargo update --package phf:0.11.0 --precise 0.10.1
39+
run: cargo update --package phf --precise 0.10.1
4040
if: matrix.toolchain == '1.40.0'
4141

4242
- name: Cargo build

build.rs

+4
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,9 @@ fn main() {
4242
println!("cargo:rustc-cfg=rustc_has_pr45225")
4343
}
4444

45+
if std::mem::size_of::<std::borrow::Cow<'static, str>>() == 24 {
46+
println!("cargo:rustc-cfg=rustc_has_better_cow_layout")
47+
}
48+
4549
codegen::main();
4650
}

src/size_of_tests.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ macro_rules! size_of_test {
3838

3939
// Some of these assume 64-bit
4040
size_of_test!(token, Token, 32);
41-
size_of_test!(std_cow_str, Cow<'static, str>, 32);
41+
size_of_test!(std_cow_str, Cow<'static, str>, if cfg!(rustc_has_better_cow_layout) { 24 } else { 32 });
4242
size_of_test!(cow_rc_str, CowRcStr, 16);
4343

4444
size_of_test!(tokenizer, crate::tokenizer::Tokenizer, 72);
@@ -51,9 +51,15 @@ size_of_test!(parser, crate::parser::Parser, 16);
5151
size_of_test!(source_position, crate::SourcePosition, 8);
5252
size_of_test!(parser_state, crate::ParserState, 24);
5353

54-
size_of_test!(basic_parse_error, crate::BasicParseError, 48);
54+
size_of_test!(basic_parse_error, crate::BasicParseError, if cfg!(rustc_has_better_cow_layout) { 40 } else { 48 });
5555
size_of_test!(
5656
parse_error_lower_bound,
5757
crate::ParseError<()>,
58-
if cfg!(rustc_has_pr45225) { 48 } else { 56 }
58+
if cfg!(rustc_has_better_cow_layout) {
59+
40
60+
} else if cfg!(rustc_has_pr45225) {
61+
48
62+
} else {
63+
56
64+
}
5965
);

0 commit comments

Comments
 (0)