Skip to content

Commit fbae25b

Browse files
committed
fix(ci): use outer #[rustfmt::skip] on generated fn (inner is unstable)
#![rustfmt::skip] (file-level inner attribute) is an unstable custom inner attribute (E0658 on stable). Switch to #[rustfmt::skip] (outer attribute on the #[test] fn), which is a stable tool attribute and still makes rustfmt skip the generated body.
1 parent 2a69278 commit fbae25b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

float-pigment-forest/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn main() {
6464
let fn_name = format!("html_{}_{}", topic_ident, name_ident);
6565
let ignore_attr = if *ignore { "#[ignore]\n" } else { "" };
6666
let case_rs = format!(
67-
"#![rustfmt::skip]\n// AUTO-GENERATED from tests/cases/{topic}/{name}.html. Do not edit.\nuse crate::TestCtx;\n\n{ignore_attr}#[test]\nfn {fn_name}() {{\n{body}}}\n"
67+
"// AUTO-GENERATED from tests/cases/{topic}/{name}.html. Do not edit.\nuse crate::TestCtx;\n\n{ignore_attr}#[rustfmt::skip]\n#[test]\nfn {fn_name}() {{\n{body}}}\n"
6868
);
6969
fs::write(topic_dir.join(format!("{name}.rs")), case_rs).unwrap();
7070
topic_mod.push_str(&format!("mod {name_ident};\n"));

0 commit comments

Comments
 (0)