Skip to content

Commit e7053b8

Browse files
committed
Auto merge of #155228 - Zalathar:incr-test-diag, r=<try>
Check diagnostic output in incremental `cpass` and `rpass` revisions try-job: x86_64-gnu
2 parents 14196db + e8fae41 commit e7053b8

File tree

13 files changed

+38
-41
lines changed

13 files changed

+38
-41
lines changed

‎src/tools/compiletest/src/runtest.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,7 @@ impl<'test> TestCx<'test> {
995995
AllowUnused::No
996996
}
997997
}
998+
TestMode::Incremental => AllowUnused::Yes,
998999
_ => AllowUnused::No,
9991000
};
10001001

‎src/tools/compiletest/src/runtest/incremental.rs‎

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use super::{FailMode, TestCx, WillExecute};
2-
use crate::errors;
1+
use super::{FailMode, ProcRes, TestCx, WillExecute};
32

43
impl TestCx<'_> {
54
pub(super) fn run_incremental_test(&self) {
@@ -57,10 +56,7 @@ impl TestCx<'_> {
5756
self.fatal_proc_rec("compilation failed!", &proc_res);
5857
}
5958

60-
// FIXME(#41968): Move this check to tidy?
61-
if !errors::load_errors(&self.testpaths.file, self.revision).is_empty() {
62-
self.fatal("build-pass tests with expected warnings should be moved to ui/");
63-
}
59+
self.check_compiler_output_for_incr(&proc_res);
6460
}
6561

6662
fn run_rpass_test(&self) {
@@ -72,10 +68,7 @@ impl TestCx<'_> {
7268
self.fatal_proc_rec("compilation failed!", &proc_res);
7369
}
7470

75-
// FIXME(#41968): Move this check to tidy?
76-
if !errors::load_errors(&self.testpaths.file, self.revision).is_empty() {
77-
self.fatal("run-pass tests with expected warnings should be moved to ui/");
78-
}
71+
self.check_compiler_output_for_incr(&proc_res);
7972

8073
if let WillExecute::Disabled = should_run {
8174
return;
@@ -93,16 +86,20 @@ impl TestCx<'_> {
9386
self.check_if_test_should_compile(Some(FailMode::Build), pm, &proc_res);
9487
self.check_no_compiler_crash(&proc_res, self.props.should_ice);
9588

96-
let output_to_check = self.get_output(&proc_res);
97-
self.check_expected_errors(&proc_res);
98-
self.check_all_error_patterns(&output_to_check, &proc_res);
89+
self.check_compiler_output_for_incr(&proc_res);
90+
9991
if self.props.should_ice {
10092
match proc_res.status.code() {
10193
Some(101) => (),
10294
_ => self.fatal("expected ICE"),
10395
}
10496
}
97+
}
10598

106-
self.check_forbid_output(&output_to_check, &proc_res);
99+
fn check_compiler_output_for_incr(&self, proc_res: &ProcRes) {
100+
let output_to_check = self.get_output(proc_res);
101+
self.check_expected_errors(&proc_res);
102+
self.check_all_error_patterns(&output_to_check, proc_res);
103+
self.check_forbid_output(&output_to_check, proc_res);
107104
}
108105
}

‎tests/incremental/const-generics/change-const-param-gat.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ revisions: rpass1 rpass2 rpass3
22
//@ compile-flags: -Zincremental-ignore-spans
33
//@ ignore-backends: gcc
4-
#![feature(generic_associated_types)]
54

65
// This test unsures that with_opt_const_param returns the
76
// def_id of the N param in the Foo::Assoc GAT.

‎tests/incremental/krate_reassign_34991/main.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
extern crate a;
99

1010
#[cfg(rpass1)]
11-
pub fn use_X() -> u32 {
11+
pub fn use_x() -> u32 {
1212
let x: a::X = 22;
1313
x as u32
1414
}
1515

1616
#[cfg(rpass2)]
17-
pub fn use_X() -> u32 {
17+
pub fn use_x() -> u32 {
1818
22
1919
}
2020

‎tests/incremental/rlib_cross_crate/b.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ extern crate a;
1515

1616
#[rustc_clean(except="typeck_root,optimized_mir", cfg="rpass2")]
1717
#[rustc_clean(cfg="rpass3")]
18-
pub fn use_X() -> u32 {
18+
pub fn use_x() -> u32 {
1919
let x: a::X = 22;
2020
x as u32
2121
}
2222

2323
#[rustc_clean(cfg="rpass2")]
2424
#[rustc_clean(cfg="rpass3")]
25-
pub fn use_Y() {
25+
pub fn use_y() {
2626
let x: a::Y = 'c';
2727
}
2828

‎tests/incremental/static_cycle/b.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#![cfg_attr(rpass2, warn(dead_code))]
55

6-
pub static mut BAA: *const i8 = unsafe { &BOO as *const _ as *const i8 };
6+
pub static mut BAA: *const i8 = unsafe { &raw const BOO as *const i8 };
77

8-
pub static mut BOO: *const i8 = unsafe { &BAA as *const _ as *const i8 };
8+
pub static mut BOO: *const i8 = unsafe { &raw const BAA as *const i8 };
99

1010
fn main() {}

‎tests/incremental/struct_add_field.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ pub struct Y {
2323
}
2424

2525
#[rustc_clean(except="fn_sig,typeck_root", cfg="rpass2")]
26-
pub fn use_X(x: X) -> u32 {
26+
pub fn use_x(x: X) -> u32 {
2727
x.x as u32
2828
}
2929

3030
#[rustc_clean(except="typeck_root", cfg="rpass2")]
31-
pub fn use_EmbedX(embed: EmbedX) -> u32 {
31+
pub fn use_embed_x(embed: EmbedX) -> u32 {
3232
embed.x.x as u32
3333
}
3434

3535
#[rustc_clean(cfg="rpass2")]
36-
pub fn use_Y() {
36+
pub fn use_y() {
3737
let x: Y = Y { y: 'c' };
3838
}
3939

‎tests/incremental/struct_change_field_name.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ pub struct Y {
2727
}
2828

2929
#[rustc_clean(except="typeck_root", cfg="cfail2")]
30-
pub fn use_X() -> u32 {
30+
pub fn use_x() -> u32 {
3131
let x: X = X { x: 22 };
3232
//[cfail2]~^ ERROR struct `X` has no field named `x`
3333
x.x as u32
3434
//[cfail2]~^ ERROR no field `x` on type `X`
3535
}
3636

3737
#[rustc_clean(except="typeck_root", cfg="cfail2")]
38-
pub fn use_EmbedX(embed: EmbedX) -> u32 {
38+
pub fn use_embed_x(embed: EmbedX) -> u32 {
3939
embed.x.x as u32
4040
//[cfail2]~^ ERROR no field `x` on type `X`
4141
}
4242

4343
#[rustc_clean(cfg="cfail2")]
44-
pub fn use_Y() {
44+
pub fn use_y() {
4545
let x: Y = Y { y: 'c' };
4646
}
4747

‎tests/incremental/struct_change_field_type.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ pub struct Y {
2626
}
2727

2828
#[rustc_clean(except="typeck_root", cfg="rpass2")]
29-
pub fn use_X() -> u32 {
29+
pub fn use_x() -> u32 {
3030
let x: X = X { x: 22 };
3131
x.x as u32
3232
}
3333

3434
#[rustc_clean(except="typeck_root", cfg="rpass2")]
35-
pub fn use_EmbedX(x: EmbedX) -> u32 {
35+
pub fn use_embed_x(x: EmbedX) -> u32 {
3636
let x: X = X { x: 22 };
3737
x.x as u32
3838
}
3939

4040
#[rustc_clean(cfg="rpass2")]
41-
pub fn use_Y() {
41+
pub fn use_y() {
4242
let x: Y = Y { y: 'c' };
4343
}
4444

‎tests/incremental/struct_change_field_type_cross_crate/b.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ extern crate a;
1010
use a::*;
1111

1212
#[rustc_clean(except="typeck_root", cfg="rpass2")]
13-
pub fn use_X() -> u32 {
13+
pub fn use_x() -> u32 {
1414
let x: X = X { x: 22 };
1515
x.x as u32
1616
}
1717

1818
#[rustc_clean(except="typeck_root", cfg="rpass2")]
19-
pub fn use_EmbedX(embed: EmbedX) -> u32 {
19+
pub fn use_embed_x(embed: EmbedX) -> u32 {
2020
embed.x.x as u32
2121
}
2222

2323
#[rustc_clean(cfg="rpass2")]
24-
pub fn use_Y() {
24+
pub fn use_y() {
2525
let x: Y = Y { y: 'c' };
2626
}
2727

0 commit comments

Comments
 (0)