Skip to content

Commit ae15e34

Browse files
committed
Reformat and fix tidy error
1 parent c852254 commit ae15e34

File tree

5 files changed

+31
-10
lines changed

5 files changed

+31
-10
lines changed

src/tools/compiletest/src/header.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -746,11 +746,11 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
746746
"ignore-mode-incremental",
747747
"ignore-mode-js-doc-test",
748748
"ignore-mode-mir-opt",
749+
"ignore-mode-pretty",
749750
"ignore-mode-run-make",
750751
"ignore-mode-run-pass-valgrind",
751752
"ignore-mode-rustdoc",
752753
"ignore-mode-rustdoc-json",
753-
"ignore-mode-pretty",
754754
"ignore-mode-ui",
755755
"ignore-mode-ui-fulldeps",
756756
"ignore-msp430",
@@ -993,7 +993,8 @@ fn iter_header(
993993
if testfile.extension().map(|e| e == "rs").unwrap_or(false) {
994994
let directive_ln = non_revisioned_directive_line.trim();
995995

996-
let CheckDirectiveResult { is_known_directive, directive_name } = check_directive(directive_ln);
996+
let CheckDirectiveResult { is_known_directive, directive_name } =
997+
check_directive(directive_ln);
997998

998999
if !is_known_directive {
9991000
*poisoned = true;
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ check-pass
22

33
//~ HELP
4-
fn main() { } //~ERROR
4+
fn main() {} //~ERROR
55
//~^ ERROR
66
//~| ERROR

src/tools/compiletest/src/header/tests.rs

+25-5
Original file line numberDiff line numberDiff line change
@@ -623,34 +623,54 @@ fn run_path(poisoned: &mut bool, path: &Path, buf: &[u8]) {
623623
#[test]
624624
fn test_unknown_directive_check() {
625625
let mut poisoned = false;
626-
run_path(&mut poisoned, Path::new("a.rs"), include_bytes!("./directive_checks/unknown_directive.rs"));
626+
run_path(
627+
&mut poisoned,
628+
Path::new("a.rs"),
629+
include_bytes!("./directive_checks/unknown_directive.rs"),
630+
);
627631
assert!(poisoned);
628632
}
629633

630634
#[test]
631635
fn test_known_legacy_directive_check() {
632636
let mut poisoned = false;
633-
run_path(&mut poisoned, Path::new("a.rs"), include_bytes!("./directive_checks/known_legacy_directive.rs"));
637+
run_path(
638+
&mut poisoned,
639+
Path::new("a.rs"),
640+
include_bytes!("./directive_checks/known_legacy_directive.rs"),
641+
);
634642
assert!(poisoned);
635643
}
636644

637645
#[test]
638646
fn test_known_directive_check_no_error() {
639647
let mut poisoned = false;
640-
run_path(&mut poisoned, Path::new("a.rs"), include_bytes!("./directive_checks/known_directive.rs"));
648+
run_path(
649+
&mut poisoned,
650+
Path::new("a.rs"),
651+
include_bytes!("./directive_checks/known_directive.rs"),
652+
);
641653
assert!(!poisoned);
642654
}
643655

644656
#[test]
645657
fn test_error_annotation_no_error() {
646658
let mut poisoned = false;
647-
run_path(&mut poisoned, Path::new("a.rs"), include_bytes!("./directive_checks/error_annotation.rs"));
659+
run_path(
660+
&mut poisoned,
661+
Path::new("a.rs"),
662+
include_bytes!("./directive_checks/error_annotation.rs"),
663+
);
648664
assert!(!poisoned);
649665
}
650666

651667
#[test]
652668
fn test_non_rs_unknown_directive_not_checked() {
653669
let mut poisoned = false;
654-
run_path(&mut poisoned, Path::new("a.Makefile"), include_bytes!("./directive_checks/not_rs.Makefile"));
670+
run_path(
671+
&mut poisoned,
672+
Path::new("a.Makefile"),
673+
include_bytes!("./directive_checks/not_rs.Makefile"),
674+
);
655675
assert!(!poisoned);
656676
}

src/tools/compiletest/src/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ use std::process::Command;
66

77
use tracing::*;
88

9+
pub(crate) mod edit_distance;
910
#[cfg(test)]
1011
mod tests;
11-
pub(crate) mod edit_distance;
1212

1313
pub fn make_new_path(path: &str) -> String {
1414
assert!(cfg!(windows));

src/tools/compiletest/src/util/edit_distance.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Edit distance taken from rustc's `rustc_span::edit_distance`.
22
3-
use std::mem;
43
use std::cmp;
4+
use std::mem;
55

66
/// Finds the [edit distance] between two strings.
77
///

0 commit comments

Comments
 (0)