Skip to content

Commit

Permalink
ci: Disable the check for >1 s! invocation
Browse files Browse the repository at this point in the history
Apparently we already violate this in a few places, it just doesn't show
up because whitespace doesn't line up with what we expect (lack of
formatting). Just disable it for now so we can format the files.

(backport <rust-lang#4107>)
(cherry picked from commit 0189456)
  • Loading branch information
tgross35 committed Nov 19, 2024
1 parent 92c198c commit ca8dcbf
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions ci/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ enum State {

fn check_style(file: &str, path: &Path, err: &mut Errors) {
let mut state = State::Start;
let mut s_macros = 0;

// FIXME: see below
// let mut s_macros = 0;

let mut f_macros = 0;
let mut in_impl = false;

Expand Down Expand Up @@ -140,7 +143,8 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
} else if line.starts_with("type ") && !in_impl {
State::Typedefs
} else if line.starts_with("s! {") {
s_macros += 1;
// FIXME: see below
// s_macros += 1;
State::Structs
} else if line.starts_with("s_no_extra_traits! {") {
// multiple macros of this type are allowed
Expand Down Expand Up @@ -175,10 +179,13 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
f_macros += 1;
err.error(path, i, "multiple f! macros in one module");
}
if s_macros == 2 {
s_macros += 1;
err.error(path, i, "multiple s! macros in one module");
}

// FIXME(#4109): multiple should be allowed if at least one is `cfg(not) within `cfg_if`.
// For now just disable this and check by hand.
// if s_macros == 2 {
// s_macros += 1;
// err.error(path, i, "multiple s! macros in one module");
// }

state = line_state;
}
Expand Down

0 comments on commit ca8dcbf

Please sign in to comment.