Skip to content

Commit dad667b

Browse files
committed
fix tests
1 parent 3c68417 commit dad667b

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

‎src/bootstrap/src/core/build_steps/clippy.rs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn lint_args(builder: &Builder<'_>, config: &LintConfig, ignored_rules: &[&str])
6666
/// We need to keep the order of the given clippy lint rules before passing them.
6767
/// Since clap doesn't offer any useful interface for this purpose out of the box,
6868
/// we have to handle it manually.
69-
fnget_clippy_rules_in_order(all_args:&[String],config:&LintConfig) -> Vec<String>{
69+
pubfnget_clippy_rules_in_order(all_args:&[String],config:&LintConfig) -> Vec<String>{
7070
letmut result = vec![];
7171

7272
for(prefix, item)in
@@ -86,11 +86,11 @@ fn get_clippy_rules_in_order(all_args: &[String], config: &LintConfig) -> Vec<St
8686
}
8787

8888
#[derive(Debug,Clone,PartialEq,Eq,Hash)]
89-
structLintConfig{
90-
allow:Vec<String>,
91-
warn:Vec<String>,
92-
deny:Vec<String>,
93-
forbid:Vec<String>,
89+
pubstructLintConfig{
90+
puballow:Vec<String>,
91+
pubwarn:Vec<String>,
92+
pubdeny:Vec<String>,
93+
pubforbid:Vec<String>,
9494
}
9595

9696
implLintConfig{

‎src/bootstrap/src/core/config/tests.rs‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use serde::Deserialize;
99

1010
usesuper::flags::Flags;
1111
usesuper::{ChangeIdWrapper,Config,RUSTC_IF_UNCHANGED_ALLOWED_PATHS};
12-
usecrate::core::build_steps::clippy::get_clippy_rules_in_order;
12+
usecrate::core::build_steps::clippy::{LintConfig,get_clippy_rules_in_order};
1313
usecrate::core::build_steps::llvm;
1414
usecrate::core::config::{LldMode,Target,TargetSelection,TomlConfig};
1515

@@ -309,9 +309,10 @@ fn order_of_clippy_rules() {
309309
];
310310
let config = Config::parse(Flags::parse(&args));
311311

312-
let actual = match&config.cmd{
312+
let actual = match config.cmd.clone(){
313313
crate::Subcommand::Clippy{ allow, deny, warn, forbid, .. } => {
314-
get_clippy_rules_in_order(&args,&allow,&deny,&warn,&forbid)
314+
let cfg = LintConfig{ allow, deny, warn, forbid };
315+
get_clippy_rules_in_order(&args,&cfg)
315316
}
316317
_ => panic!("invalid subcommand"),
317318
};
@@ -332,9 +333,10 @@ fn clippy_rule_separate_prefix() {
332333
vec!["clippy".to_string(),"-A clippy:all".to_string(),"-W clippy::style".to_string()];
333334
let config = Config::parse(Flags::parse(&args));
334335

335-
let actual = match&config.cmd{
336+
let actual = match config.cmd.clone(){
336337
crate::Subcommand::Clippy{ allow, deny, warn, forbid, .. } => {
337-
get_clippy_rules_in_order(&args,&allow,&deny,&warn,&forbid)
338+
let cfg = LintConfig{ allow, deny, warn, forbid };
339+
get_clippy_rules_in_order(&args,&cfg)
338340
}
339341
_ => panic!("invalid subcommand"),
340342
};

0 commit comments

Comments
 (0)