Skip to content

Commit 73b5236

Browse files
authored
Rollup merge of #74153 - ehuss:fix-bootstrap-test-librustc, r=Mark-Simulacrum
Fix x.py test for librustc crates. #73352 introduced a bug where `x.py test src/librustc_ast` would fail to actually run the tests. The issue is that `krate` and `all_krates` were changed to return relative paths. This caused the code to do a test of "relative_path ends with absolute path" which is always false. The solution is to swap that around. The change to `Crate` isn't necessary, it just simplifies the code and makes it uniform with `CrateLibrustc`.
2 parents 0a2bacf + 7238726 commit 73b5236

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/bootstrap/test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ impl Step for CrateLibrustc {
15621562
let compiler = builder.compiler(builder.top_stage, run.host);
15631563

15641564
for krate in builder.in_tree_crates("rustc-main") {
1565-
if run.path.ends_with(&krate.path) {
1565+
if krate.path.ends_with(&run.path) {
15661566
let test_kind = builder.kind.into();
15671567

15681568
builder.ensure(CrateLibrustc {
@@ -1669,7 +1669,7 @@ impl Step for Crate {
16691669
};
16701670

16711671
for krate in builder.in_tree_crates("test") {
1672-
if run.path.ends_with(&krate.local_path(&builder)) {
1672+
if krate.path.ends_with(&run.path) {
16731673
make(Mode::Std, krate);
16741674
}
16751675
}

src/librustc_errors/json/tests.rs

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) {
5959
sm,
6060
true,
6161
HumanReadableErrorType::Short(ColorConfig::Never),
62+
None,
6263
false,
6364
);
6465

0 commit comments

Comments
 (0)