Skip to content

Commit ec8c0b3

Browse files
Make annotations mandatory for internal ui tests
1 parent e4d3b0a commit ec8c0b3

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

tests/compile-test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ fn run_internal_tests(cx: &TestContext) {
220220
if !RUN_INTERNAL_TESTS {
221221
return;
222222
}
223-
let mut config = cx.base_config("ui-internal", false);
223+
let mut config = cx.base_config("ui-internal", true);
224224
config.bless_command = Some("cargo uitest --features internal -- -- --bless".into());
225225

226226
ui_test::run_tests_generic(

tests/ui-internal/custom_ice_message.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
#![allow(clippy::missing_clippy_version_attribute)]
1111

1212
fn it_looks_like_you_are_trying_to_kill_clippy() {}
13+
//~^ ice: Would you like some help with that?
1314

1415
fn main() {}
Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
2-
thread '<unnamed>' panicked at clippy_lints/src/utils/internal_lints/produce_ice.rs:
3-
Would you like some help with that?
4-
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
5-
6-
error: the compiler unexpectedly panicked. this is a bug.
1+
note: no errors encountered even though delayed bugs were created
2+
3+
note: those delayed bugs will now be shown as internal compiler errors
4+
5+
error: internal compiler error: Would you like some help with that?
6+
--> tests/ui-internal/custom_ice_message.rs:12:1
7+
|
8+
LL | fn it_looks_like_you_are_trying_to_kill_clippy() {}
9+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10+
|
11+
note: delayed at clippy_lints/src/utils/internal_lints/produce_ice.rs - disabled backtrace
12+
--> tests/ui-internal/custom_ice_message.rs:12:1
13+
|
14+
LL | fn it_looks_like_you_are_trying_to_kill_clippy() {}
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
716

817
note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new?template=ice.yml
918

@@ -13,9 +22,5 @@ note: rustc <version> running on <target>
1322

1423
note: compiler flags: -Z ui-testing -Z deduplicate-diagnostics=no
1524

16-
query stack during panic:
17-
#0 [early_lint_checks] perform lints prior to AST lowering
18-
#1 [hir_crate] getting the crate HIR
19-
... and 3 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
2025
note: Clippy version: foo
2126

0 commit comments

Comments
 (0)