Skip to content

Commit d637120

Browse files
authored
Merge pull request #307 from oli-obk/push-vpovvplukwyp
Also show the full output if there was a diff
2 parents 2edee31 + a589f91 commit d637120

File tree

11 files changed

+130
-9
lines changed

11 files changed

+130
-9
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ui_test"
3-
version = "0.29.0"
3+
version = "0.29.1"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66
description = "A test framework for testing rustc diagnostics output"

src/status_emitter/text.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,11 @@ fn print_error(error: &Error, path: &Path) {
753753
.green()
754754
);
755755
crate::diff::print_diff(expected, actual);
756+
757+
println!(
758+
"Full unnormalized output:\n{}",
759+
String::from_utf8_lossy(output)
760+
);
756761
}
757762
}
758763
Error::ErrorsWithoutPattern { path, msgs } => {

tests/integrations/basic-bin/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integrations/basic-fail-mode/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integrations/basic-fail/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integrations/basic-fail/Cargo.stdout

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ Execute `DO NOT BLESS. These are meant to fail` to update `tests/actual_tests/ba
3838

3939
For more information about this error, try `rustc --explain E0308`.
4040

41+
Full unnormalized output:
42+
error[E0308]: mismatched types
43+
--> tests/actual_tests/bad_pattern.rs:4:9
44+
|
45+
4 | add("42", 3);
46+
| --- ^^^^ expected `usize`, found `&str`
47+
| |
48+
| arguments to this function are incorrect
49+
|
50+
note: function defined here
51+
--> $DIR/tests/integrations/basic-fail/src/lib.rs:LL:CC
52+
|
53+
1 | pub fn add(left: usize, right: usize) -> usize {
54+
| ^^^
55+
56+
error: aborting due to 1 previous error
57+
58+
For more information about this error, try `rustc --explain E0308`.
59+
4160

4261
error: `miesmätsched types` not found in diagnostics on line 4
4362
--> tests/actual_tests/bad_pattern.rs:5:17
@@ -86,6 +105,9 @@ Execute `DO NOT BLESS. These are meant to fail` to update `tests/actual_tests/ex
86105
-69
87106
+42
88107

108+
Full unnormalized output:
109+
42
110+
89111

90112
full stderr:
91113

@@ -193,6 +215,25 @@ Execute `DO NOT BLESS. These are meant to fail` to update `tests/actual_tests/fo
193215

194216
For more information about this error, try `rustc --explain E0308`.
195217

218+
Full unnormalized output:
219+
error[E0308]: mismatched types
220+
--> tests/actual_tests/foomp.rs:4:9
221+
|
222+
4 | add("42", 3);
223+
| --- ^^^^ expected `usize`, found `&str`
224+
| |
225+
| arguments to this function are incorrect
226+
|
227+
note: function defined here
228+
--> $DIR/tests/integrations/basic-fail/src/lib.rs:LL:CC
229+
|
230+
1 | pub fn add(left: usize, right: usize) -> usize {
231+
| ^^^
232+
233+
error: aborting due to 1 previous error
234+
235+
For more information about this error, try `rustc --explain E0308`.
236+
196237

197238
full stderr:
198239
error[E0308]: mismatched types
@@ -234,6 +275,25 @@ Execute `DO NOT BLESS. These are meant to fail` to update `tests/actual_tests/fo
234275

235276
For more information about this error, try `rustc --explain E0308`.
236277

278+
Full unnormalized output:
279+
error[E0308]: mismatched types
280+
--> tests/actual_tests/foomp2.rs:4:9
281+
|
282+
4 | add("42", 3);
283+
| --- ^^^^ expected `usize`, found `&str`
284+
| |
285+
| arguments to this function are incorrect
286+
|
287+
note: function defined here
288+
--> $DIR/tests/integrations/basic-fail/src/lib.rs:LL:CC
289+
|
290+
1 | pub fn add(left: usize, right: usize) -> usize {
291+
| ^^^
292+
293+
error: aborting due to 1 previous error
294+
295+
For more information about this error, try `rustc --explain E0308`.
296+
237297

238298
full stderr:
239299
error[E0308]: mismatched types
@@ -1179,6 +1239,17 @@ Execute `DO NOT BLESS. These are meant to fail` to update `tests/actual_tests/ba
11791239
-For more information about this error, try `rustc --explain E0308`.
11801240
+For more information about this error, try `rustc --explain E0432`.
11811241

1242+
Full unnormalized output:
1243+
error[E0432]: unresolved import `basic_fail`
1244+
--> tests/actual_tests/bad_pattern.rs:1:5
1245+
|
1246+
1 | use basic_fail::add;
1247+
| ^^^^^^^^^^ use of undeclared crate or module `basic_fail`
1248+
1249+
error: aborting due to 1 previous error
1250+
1251+
For more information about this error, try `rustc --explain E0432`.
1252+
11821253

11831254
error: `miesmätsched types` not found in diagnostics on line 4
11841255
--> tests/actual_tests/bad_pattern.rs:5:17
@@ -1289,6 +1360,17 @@ Execute `DO NOT BLESS. These are meant to fail` to update `tests/actual_tests/fo
12891360
-For more information about this error, try `rustc --explain E0308`.
12901361
+For more information about this error, try `rustc --explain E0432`.
12911362

1363+
Full unnormalized output:
1364+
error[E0432]: unresolved import `basic_fail`
1365+
--> tests/actual_tests/foomp.rs:1:5
1366+
|
1367+
1 | use basic_fail::add;
1368+
| ^^^^^^^^^^ use of undeclared crate or module `basic_fail`
1369+
1370+
error: aborting due to 1 previous error
1371+
1372+
For more information about this error, try `rustc --explain E0432`.
1373+
12921374

12931375
error: `mismatched types` not found in diagnostics on line 4
12941376
--> tests/actual_tests/foomp.rs:5:17
@@ -1328,6 +1410,17 @@ Execute `DO NOT BLESS. These are meant to fail` to update `tests/actual_tests/fo
13281410
-For more information about this error, try `rustc --explain E0308`.
13291411
+For more information about this error, try `rustc --explain E0432`.
13301412

1413+
Full unnormalized output:
1414+
error[E0432]: unresolved import `basic_fail`
1415+
--> tests/actual_tests/foomp2.rs:1:5
1416+
|
1417+
1 | use basic_fail::add;
1418+
| ^^^^^^^^^^ use of undeclared crate or module `basic_fail`
1419+
1420+
error: aborting due to 1 previous error
1421+
1422+
For more information about this error, try `rustc --explain E0432`.
1423+
13311424

13321425
error: `mismatched types` not found in diagnostics on line 4
13331426
--> tests/actual_tests/foomp2.rs:5:17
@@ -1428,6 +1521,29 @@ Execute `DO NOT BLESS. These are meant to fail` to update `tests/actual_tests/ru
14281521

14291522
thread 'rustc' panicked
14301523

1524+
Full unnormalized output:
1525+
error: internal compiler error[E0432]: unresolved import `basic_fail`
1526+
--> tests/actual_tests/rustc_ice.rs:5:5
1527+
|
1528+
5 | use basic_fail::add;
1529+
| ^^^^^^^^^^ use of undeclared crate or module `basic_fail`
1530+
1531+
thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:
1532+
aborting due to `-Z treat-err-as-bug=1`
1533+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1534+
1535+
error: the compiler unexpectedly panicked. this is a bug.
1536+
1537+
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
1538+
1539+
1540+
1541+
note: compiler flags: -Z treat-err-as-bug
1542+
1543+
query stack during panic:
1544+
#0 [resolver_for_lowering_raw] getting the resolver for lowering
1545+
end of query stack
1546+
14311547

14321548
error: `mismatched types` not found in diagnostics on line 8
14331549
--> tests/actual_tests/rustc_ice.rs:9:17

tests/integrations/basic/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integrations/cargo-run/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integrations/dep-fail/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)