Skip to content

Commit 399ab46

Browse files
committed
Auto merge of rust-lang#87851 - JohnTitor:rollup-odvmr47, r=JohnTitor
Rollup of 6 pull requests Successful merges: - rust-lang#87744 (Add x.py option to --force-rerun compiletest tests) - rust-lang#87789 (Make vec-shrink-panic test compatible with v0 mangling) - rust-lang#87833 (Fix typo -- "The" -> "They") - rust-lang#87834 (Fix small typo) - rust-lang#87838 (Document that fs::read_dir skips . and ..) - rust-lang#87842 (Fix intra doc link in hidden doc of Iterator::__iterator_get_unchecked) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 57d8747 + c159806 commit 399ab46

File tree

10 files changed

+37
-10
lines changed

10 files changed

+37
-10
lines changed

library/core/src/iter/traits/iterator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3452,7 +3452,7 @@ pub trait Iterator {
34523452
self.map(f).is_sorted()
34533453
}
34543454

3455-
/// See [TrustedRandomAccess]
3455+
/// See [TrustedRandomAccess][super::super::TrustedRandomAccess]
34563456
// The unusual name is to avoid name collisions in method resolution
34573457
// see #76479.
34583458
#[inline]

library/std/src/fs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2039,6 +2039,8 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
20392039
///
20402040
/// The iterator will yield instances of [`io::Result`]`<`[`DirEntry`]`>`.
20412041
/// New errors may be encountered after an iterator is initially constructed.
2042+
/// Entries for the current and parent directories (typically `.` and `..`) are
2043+
/// skipped.
20422044
///
20432045
/// # Platform-specific behavior
20442046
///

src/bootstrap/builder/tests.rs

+3
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ mod dist {
486486
fail_fast: true,
487487
doc_tests: DocTests::No,
488488
bless: false,
489+
force_rerun: false,
489490
compare_mode: None,
490491
rustfix_coverage: false,
491492
pass: None,
@@ -527,6 +528,7 @@ mod dist {
527528
fail_fast: true,
528529
doc_tests: DocTests::No,
529530
bless: false,
531+
force_rerun: false,
530532
compare_mode: None,
531533
rustfix_coverage: false,
532534
pass: None,
@@ -583,6 +585,7 @@ mod dist {
583585
fail_fast: true,
584586
doc_tests: DocTests::Yes,
585587
bless: false,
588+
force_rerun: false,
586589
compare_mode: None,
587590
rustfix_coverage: false,
588591
pass: None,

src/bootstrap/flags.rs

+10
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ pub enum Subcommand {
102102
paths: Vec<PathBuf>,
103103
/// Whether to automatically update stderr/stdout files
104104
bless: bool,
105+
force_rerun: bool,
105106
compare_mode: Option<String>,
106107
pass: Option<String>,
107108
run: Option<String>,
@@ -284,6 +285,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
284285
opts.optflag("", "no-doc", "do not run doc tests");
285286
opts.optflag("", "doc", "only run doc tests");
286287
opts.optflag("", "bless", "update all stderr/stdout files of failing ui tests");
288+
opts.optflag("", "force-rerun", "rerun tests even if the inputs are unchanged");
287289
opts.optopt(
288290
"",
289291
"compare-mode",
@@ -558,6 +560,7 @@ Arguments:
558560
"test" | "t" => Subcommand::Test {
559561
paths,
560562
bless: matches.opt_present("bless"),
563+
force_rerun: matches.opt_present("force-rerun"),
561564
compare_mode: matches.opt_str("compare-mode"),
562565
pass: matches.opt_str("pass"),
563566
run: matches.opt_str("run"),
@@ -726,6 +729,13 @@ impl Subcommand {
726729
}
727730
}
728731

732+
pub fn force_rerun(&self) -> bool {
733+
match *self {
734+
Subcommand::Test { force_rerun, .. } => force_rerun,
735+
_ => false,
736+
}
737+
}
738+
729739
pub fn rustfix_coverage(&self) -> bool {
730740
match *self {
731741
Subcommand::Test { rustfix_coverage, .. } => rustfix_coverage,

src/bootstrap/test.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,10 @@ note: if you're sure you want to do this, please open an issue as to why. In the
13151315
cmd.arg("--bless");
13161316
}
13171317

1318+
if builder.config.cmd.force_rerun() {
1319+
cmd.arg("--force-rerun");
1320+
}
1321+
13181322
let compare_mode =
13191323
builder.config.cmd.compare_mode().or_else(|| {
13201324
if builder.config.test_compare_mode { self.compare_mode } else { None }

src/librustdoc/clean/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,7 @@ crate enum Variant {
19371937
Struct(VariantStruct),
19381938
}
19391939

1940-
/// Small wrapper around [`rustc_span::Span]` that adds helper methods
1940+
/// Small wrapper around [`rustc_span::Span`] that adds helper methods
19411941
/// and enforces calling [`rustc_span::Span::source_callsite()`].
19421942
#[derive(Copy, Clone, Debug)]
19431943
crate struct Span(rustc_span::Span);

src/tools/compiletest/src/common.rs

+3
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ pub struct Config {
362362
pub nodejs: Option<String>,
363363
/// Path to a npm executable. Used for rustdoc GUI tests
364364
pub npm: Option<String>,
365+
366+
/// Whether to rerun tests even if the inputs are unchanged.
367+
pub force_rerun: bool,
365368
}
366369

367370
impl Config {

src/tools/compiletest/src/main.rs

+12-7
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
144144
"enable this to generate a Rustfix coverage file, which is saved in \
145145
`./<build_base>/rustfix_missing_coverage.txt`",
146146
)
147+
.optflag("", "force-rerun", "rerun tests even if the inputs are unchanged")
147148
.optflag("h", "help", "show this message")
148149
.reqopt("", "channel", "current Rust channel", "CHANNEL");
149150

@@ -289,6 +290,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
289290
llvm_components: matches.opt_str("llvm-components").unwrap(),
290291
nodejs: matches.opt_str("nodejs"),
291292
npm: matches.opt_str("npm"),
293+
294+
force_rerun: matches.opt_present("force-rerun"),
292295
}
293296
}
294297

@@ -644,13 +647,15 @@ fn make_test(config: &Config, testpaths: &TestPaths, inputs: &Stamp) -> Vec<test
644647
let test_name = crate::make_test_name(config, testpaths, revision);
645648
let mut desc = make_test_description(config, test_name, &test_path, src_file, cfg);
646649
// Ignore tests that already run and are up to date with respect to inputs.
647-
desc.ignore |= is_up_to_date(
648-
config,
649-
testpaths,
650-
&early_props,
651-
revision.map(|s| s.as_str()),
652-
inputs,
653-
);
650+
if !config.force_rerun {
651+
desc.ignore |= is_up_to_date(
652+
config,
653+
testpaths,
654+
&early_props,
655+
revision.map(|s| s.as_str()),
656+
inputs,
657+
);
658+
}
654659
test::TestDescAndFn { desc, testfn: make_test_closure(config, testpaths, revision) }
655660
})
656661
.collect()

src/tools/linkchecker/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ enum FileEntry {
129129
/// An HTML file.
130130
///
131131
/// This includes the contents of the HTML file, and an optional set of
132-
/// HTML IDs. The IDs are used for checking fragments. The are computed
132+
/// HTML IDs. The IDs are used for checking fragments. They are computed
133133
/// as-needed. The source is discarded (replaced with an empty string)
134134
/// after the file has been checked, to conserve on memory.
135135
HtmlFile { source: Rc<String>, ids: RefCell<HashSet<String>> },

0 commit comments

Comments
 (0)