Skip to content

Commit e57dbe7

Browse files
authored
Unrolled build for rust-lang#136865
Rollup merge of rust-lang#136865 - jieyouxu:long-type-path-compare-mode, r=lqd Perform deeper compiletest path normalization for `$TEST_BUILD_DIR` to account for compare-mode/debugger cases, and normalize long type file filename hashes Fixes rust-lang#136510. ### Summary - Whereas previously `$TEST_BUILD_DIR` is a normalization of `/path/to/build/test/<test_suite_name>/`, we now more deeply normalize. `$TEST_BUILD_DIR` now becomes a normalization of `/path/to/build/test/<test_suite_name>/<subdirs>/$name.$revision.$compare_mode.$debugger/` to normalize away path name differences when `--compare-mode` and/or `--debugger` are specified. - We also centralize the normalization of long type name hashes cf. rust-lang#136328 (comment). ### Review advice - Best reviewed commit-by-commit. - Split into 3 commits: - **Commit 1**: compiletest changes to have `$TEST_BUILD_DIR` more deeply normalize. - **Commit 2**: remove per-test hacks for long type path hash normalizations, and rebless tests *specifically* affected by that. - **Commit 3**: rebless other tests that were changed as a side-effect of deeper `$TEST_BUILD_DIR` normalizations. **Commit 2** is created via first finding tests that try to perform long type file hash normalizations on an ad hoc, per-test basis: ``` rg --no-ignore -l --no-ignore -F -e "long-type" tests/ui/**/*.rs ``` <details> <summary>Tests with ad hoc long-type hash normalizations</summary> ``` tests/ui/type_length_limit.rs tests/ui/traits/on_unimplemented_long_types.rs tests/ui/regions/issue-102374.rs tests/ui/recursion/recursion.rs tests/ui/recursion/issue-83150.rs tests/ui/recursion/issue-23122-2.rs tests/ui/methods/inherent-bound-in-probe.rs tests/ui/issues/issue-67552.rs tests/ui/issues/issue-37311-type-length-limit/issue-37311.rs tests/ui/issues/issue-20413.rs tests/ui/issues/issue-8727.rs tests/ui/infinite/infinite-instantiation.rs tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.rs tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.rs tests/ui/higher-ranked/trait-bounds/hang-on-deeply-nested-dyn.rs tests/ui/error-codes/E0275.rs tests/ui/diagnostic-width/secondary-label-with-long-type.rs tests/ui/diagnostic-width/long-e0277.rs tests/ui/diagnostic-width/non-copy-type-moved.rs tests/ui/diagnostic-width/long-E0308.rs tests/ui/diagnostic-width/E0271.rs tests/ui/diagnostic-width/binop.rs ``` </details> These ad hoc normalizations were removed, and they are reblessed. r? `````@lqd`````
2 parents 4559163 + 4f2a3dc commit e57dbe7

File tree

67 files changed

+143
-177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+143
-177
lines changed

src/tools/compiletest/src/runtest.rs

+15-2
Original file line numberDiff line numberDiff line change
@@ -2412,8 +2412,9 @@ impl<'test> TestCx<'test> {
24122412
let rust_src_dir = rust_src_dir.read_link().unwrap_or(rust_src_dir.to_path_buf());
24132413
normalize_path(&rust_src_dir.join("library"), "$SRC_DIR_REAL");
24142414

2415-
// eg. /home/user/rust/build/x86_64-unknown-linux-gnu/test/ui
2416-
normalize_path(&self.config.build_test_suite_root, "$TEST_BUILD_DIR");
2415+
// eg.
2416+
// /home/user/rust/build/x86_64-unknown-linux-gnu/test/ui/<test_dir>/$name.$revision.$mode/
2417+
normalize_path(&self.output_base_dir(), "$TEST_BUILD_DIR");
24172418
// eg. /home/user/rust/build
24182419
normalize_path(&self.config.build_root, "$BUILD_DIR");
24192420

@@ -2434,6 +2435,18 @@ impl<'test> TestCx<'test> {
24342435
.into_owned();
24352436

24362437
normalized = Self::normalize_platform_differences(&normalized);
2438+
2439+
// Normalize long type name hash.
2440+
normalized =
2441+
static_regex!(r"\$TEST_BUILD_DIR/(?P<filename>[^\.]+).long-type-(?P<hash>\d+).txt")
2442+
.replace_all(&normalized, |caps: &Captures<'_>| {
2443+
format!(
2444+
"$TEST_BUILD_DIR/{filename}.long-type-$LONG_TYPE_HASH.txt",
2445+
filename = &caps["filename"]
2446+
)
2447+
})
2448+
.into_owned();
2449+
24372450
normalized = normalized.replace("\t", "\\t"); // makes tabs visible
24382451

24392452
// Remove test annotations like `//~ ERROR text` from the output,
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$TEST_BUILD_DIR/codegen-backend/hotplug.bindep/libhotplug.rlib: $DIR/hotplug.rs $TEST_BUILD_DIR/codegen-backend/hotplug.bindep/auxiliary/libthe_backend.so
1+
$TEST_BUILD_DIR/libhotplug.rlib: $DIR/hotplug.rs $TEST_BUILD_DIR/auxiliary/libthe_backend.so
22

33
$DIR/hotplug.rs:
4-
$TEST_BUILD_DIR/codegen-backend/hotplug.bindep/auxiliary/libthe_backend.so:
4+
$TEST_BUILD_DIR/auxiliary/libthe_backend.so:
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
$TEST_BUILD_DIR/codegen-backend/hotplug.dep/libhotplug.rlib: $DIR/hotplug.rs
1+
$TEST_BUILD_DIR/libhotplug.rlib: $DIR/hotplug.rs
22

33
$DIR/hotplug.rs:

tests/ui/crate-loading/crateresolve1.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ error[E0464]: multiple candidates for `rlib` dependency `crateresolve1` found
44
LL | extern crate crateresolve1;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: candidate #1: $TEST_BUILD_DIR/crate-loading/crateresolve1/auxiliary/libcrateresolve1-1.somelib
8-
= note: candidate #2: $TEST_BUILD_DIR/crate-loading/crateresolve1/auxiliary/libcrateresolve1-2.somelib
9-
= note: candidate #3: $TEST_BUILD_DIR/crate-loading/crateresolve1/auxiliary/libcrateresolve1-3.somelib
7+
= note: candidate #1: $TEST_BUILD_DIR/auxiliary/libcrateresolve1-1.somelib
8+
= note: candidate #2: $TEST_BUILD_DIR/auxiliary/libcrateresolve1-2.somelib
9+
= note: candidate #3: $TEST_BUILD_DIR/auxiliary/libcrateresolve1-3.somelib
1010

1111
error: aborting due to 1 previous error
1212

tests/ui/crate-loading/crateresolve2.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ error[E0464]: multiple candidates for `rmeta` dependency `crateresolve2` found
44
LL | extern crate crateresolve2;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: candidate #1: $TEST_BUILD_DIR/crate-loading/crateresolve2/auxiliary/libcrateresolve2-1.rmeta
8-
= note: candidate #2: $TEST_BUILD_DIR/crate-loading/crateresolve2/auxiliary/libcrateresolve2-2.rmeta
9-
= note: candidate #3: $TEST_BUILD_DIR/crate-loading/crateresolve2/auxiliary/libcrateresolve2-3.rmeta
7+
= note: candidate #1: $TEST_BUILD_DIR/auxiliary/libcrateresolve2-1.rmeta
8+
= note: candidate #2: $TEST_BUILD_DIR/auxiliary/libcrateresolve2-2.rmeta
9+
= note: candidate #3: $TEST_BUILD_DIR/auxiliary/libcrateresolve2-3.rmeta
1010

1111
error: aborting due to 1 previous error
1212

tests/ui/diagnostic-width/E0271.ascii.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0271]: type mismatch resolving `<Result<..., ()> as Future>::Error == Foo`
2-
--> $DIR/E0271.rs:20:5
2+
--> $DIR/E0271.rs:19:5
33
|
44
LL | / Box::new(
55
LL | | Ok::<_, ()>(
@@ -10,12 +10,12 @@ LL | | )
1010
| |_____^ type mismatch resolving `<Result<..., ()> as Future>::Error == Foo`
1111
|
1212
note: expected this to be `Foo`
13-
--> $DIR/E0271.rs:10:18
13+
--> $DIR/E0271.rs:9:18
1414
|
1515
LL | type Error = E;
1616
| ^
1717
= note: required for the cast from `Box<Result<..., ()>>` to `Box<...>`
18-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
18+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/E0271.long-type-$LONG_TYPE_HASH.txt'
1919
= note: consider using `--verbose` to print the full type name to the console
2020

2121
error: aborting due to 1 previous error

tests/ui/diagnostic-width/E0271.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ revisions: ascii unicode
22
//@[ascii] compile-flags: --diagnostic-width=40 -Zwrite-long-types-to-disk=yes
33
//@[unicode] compile-flags: -Zunstable-options --error-format=human-unicode --diagnostic-width=40 -Zwrite-long-types-to-disk=yes
4-
//@ normalize-stderr: "'\$TEST_BUILD_DIR/.*\.long-type-\d+.txt'" -> "'$$TEST_BUILD_DIR/$$FILE.long-type-hash.txt'"
54
trait Future {
65
type Error;
76
}

tests/ui/diagnostic-width/E0271.unicode.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0271]: type mismatch resolving `<Result<..., ()> as Future>::Error == Foo`
2-
╭▸ $DIR/E0271.rs:20:5
2+
╭▸ $DIR/E0271.rs:19:5
33
44
LL │ ┏ Box::new(
55
LL │ ┃ Ok::<_, ()>(
@@ -10,12 +10,12 @@ LL │ ┃ )
1010
│ ┗━━━━━┛ type mismatch resolving `<Result<..., ()> as Future>::Error == Foo`
1111
╰╴
1212
note: expected this to be `Foo`
13-
╭▸ $DIR/E0271.rs:10:18
13+
╭▸ $DIR/E0271.rs:9:18
1414
1515
LL │ type Error = E;
1616
│ ━
1717
├ note: required for the cast from `Box<Result<..., ()>>` to `Box<...>`
18-
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
18+
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/E0271.long-type-$LONG_TYPE_HASH.txt'
1919
╰ note: consider using `--verbose` to print the full type name to the console
2020

2121
error: aborting due to 1 previous error

tests/ui/diagnostic-width/binop.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
//@ compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
2-
// The regex below normalizes the long type file name to make it suitable for compare-modes.
3-
//@ normalize-stderr: "'\$TEST_BUILD_DIR/.*\.long-type-\d+.txt'" -> "'$$TEST_BUILD_DIR/$$FILE.long-type-hash.txt'"
42
type A = (i32, i32, i32, i32);
53
type B = (A, A, A, A);
64
type C = (B, B, B, B);

tests/ui/diagnostic-width/binop.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
error[E0369]: cannot add `(..., ..., ..., ...)` to `(..., ..., ..., ...)`
2-
--> $DIR/binop.rs:10:7
2+
--> $DIR/binop.rs:8:7
33
|
44
LL | x + x;
55
| - ^ - (..., ..., ..., ...)
66
| |
77
| (..., ..., ..., ...)
88
|
9-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
9+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/binop.long-type-$LONG_TYPE_HASH.txt'
1010
= note: consider using `--verbose` to print the full type name to the console
1111

1212
error[E0600]: cannot apply unary operator `!` to type `(..., ..., ..., ...)`
13-
--> $DIR/binop.rs:14:5
13+
--> $DIR/binop.rs:12:5
1414
|
1515
LL | !x;
1616
| ^^ cannot apply unary operator `!`
1717
|
18-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
18+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/binop.long-type-$LONG_TYPE_HASH.txt'
1919
= note: consider using `--verbose` to print the full type name to the console
2020

2121
error: aborting due to 2 previous errors

tests/ui/diagnostic-width/long-E0308.ascii.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/long-E0308.rs:48:9
2+
--> $DIR/long-E0308.rs:45:9
33
|
44
LL | let x: Atype<
55
| _____________-
@@ -20,11 +20,11 @@ LL | | ))))))))))))))))))))))))))))));
2020
|
2121
= note: expected struct `Atype<Btype<..., i32>, i32>`
2222
found enum `Result<Result<..., _>, _>`
23-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
23+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0308.long-type-$LONG_TYPE_HASH.txt'
2424
= note: consider using `--verbose` to print the full type name to the console
2525

2626
error[E0308]: mismatched types
27-
--> $DIR/long-E0308.rs:61:26
27+
--> $DIR/long-E0308.rs:58:26
2828
|
2929
LL | ))))))))))))))))) == Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(O...
3030
| __________________________^
@@ -36,11 +36,11 @@ LL | | ))))))))))))))))))))))));
3636
|
3737
= note: expected enum `Option<Result<Option<...>, _>>`
3838
found enum `Result<Result<..., _>, _>`
39-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
39+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0308.long-type-$LONG_TYPE_HASH.txt'
4040
= note: consider using `--verbose` to print the full type name to the console
4141

4242
error[E0308]: mismatched types
43-
--> $DIR/long-E0308.rs:92:9
43+
--> $DIR/long-E0308.rs:89:9
4444
|
4545
LL | let x: Atype<
4646
| ____________-
@@ -56,11 +56,11 @@ LL | | > = ();
5656
|
5757
= note: expected struct `Atype<Btype<..., i32>, i32>`
5858
found unit type `()`
59-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
59+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0308.long-type-$LONG_TYPE_HASH.txt'
6060
= note: consider using `--verbose` to print the full type name to the console
6161

6262
error[E0308]: mismatched types
63-
--> $DIR/long-E0308.rs:95:17
63+
--> $DIR/long-E0308.rs:92:17
6464
|
6565
LL | let _: () = Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(O...
6666
| ____________--___^
@@ -74,7 +74,7 @@ LL | | ))))))))))))))))))))))));
7474
|
7575
= note: expected unit type `()`
7676
found enum `Result<Result<..., _>, _>`
77-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
77+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0308.long-type-$LONG_TYPE_HASH.txt'
7878
= note: consider using `--verbose` to print the full type name to the console
7979

8080
error: aborting due to 4 previous errors

tests/ui/diagnostic-width/long-E0308.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
//@[ascii] compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
33
//@[unicode] compile-flags: -Zunstable-options --json=diagnostic-unicode --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
44

5-
// The regex below normalizes the long type file name to make it suitable for compare-modes.
6-
//@ normalize-stderr: "'\$TEST_BUILD_DIR/.*\.long-type-\d+.txt'" -> "'$$TEST_BUILD_DIR/$$FILE.long-type-hash.txt'"
7-
85
mod a {
96
// Force the "short path for unique types" machinery to trip up
107
pub struct Atype;

tests/ui/diagnostic-width/long-E0308.unicode.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
╭▸ $DIR/long-E0308.rs:48:9
2+
╭▸ $DIR/long-E0308.rs:45:9
33
44
LL │ let x: Atype<
55
│ ┌─────────────┘
@@ -20,11 +20,11 @@ LL │ ┃ ))))))))))))))))))))))))))))));
2020
2121
├ note: expected struct `Atype<Btype<..., i32>, i32>`
2222
│ found enum `Result<Result<..., _>, _>`
23-
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
23+
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0308.long-type-$LONG_TYPE_HASH.txt'
2424
╰ note: consider using `--verbose` to print the full type name to the console
2525

2626
error[E0308]: mismatched types
27-
╭▸ $DIR/long-E0308.rs:61:26
27+
╭▸ $DIR/long-E0308.rs:58:26
2828
2929
LL │ ))))))))))))))))) == Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(…
3030
│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━┛
@@ -36,11 +36,11 @@ LL │ ┃ ))))))))))))))))))))))));
3636
3737
├ note: expected enum `Option<Result<Option<...>, _>>`
3838
│ found enum `Result<Result<..., _>, _>`
39-
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
39+
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0308.long-type-$LONG_TYPE_HASH.txt'
4040
╰ note: consider using `--verbose` to print the full type name to the console
4141

4242
error[E0308]: mismatched types
43-
╭▸ $DIR/long-E0308.rs:92:9
43+
╭▸ $DIR/long-E0308.rs:89:9
4444
4545
LL │ let x: Atype<
4646
│ ┌────────────┘
@@ -56,11 +56,11 @@ LL │ │ > = ();
5656
5757
├ note: expected struct `Atype<Btype<..., i32>, i32>`
5858
│ found unit type `()`
59-
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
59+
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0308.long-type-$LONG_TYPE_HASH.txt'
6060
╰ note: consider using `--verbose` to print the full type name to the console
6161

6262
error[E0308]: mismatched types
63-
╭▸ $DIR/long-E0308.rs:95:17
63+
╭▸ $DIR/long-E0308.rs:92:17
6464
6565
LL │ let _: () = Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(…
6666
│ ┏━━━━━━━━━━━━┬─━━━┛
@@ -74,7 +74,7 @@ LL │ ┃ ))))))))))))))))))))))));
7474
7575
├ note: expected unit type `()`
7676
│ found enum `Result<Result<..., _>, _>`
77-
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
77+
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0308.long-type-$LONG_TYPE_HASH.txt'
7878
╰ note: consider using `--verbose` to print the full type name to the console
7979

8080
error: aborting due to 4 previous errors

tests/ui/diagnostic-width/long-E0529.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
2-
// The regex below normalizes the long type file name to make it suitable for compare-modes.
3-
//@ normalize-stderr: "'\$TEST_BUILD_DIR/.*\.long-type-\d+.txt'" -> "'$$TEST_BUILD_DIR/$$FILE.long-type-hash.txt'"
2+
43
type A = (i32, i32, i32, i32);
54
type B = (A, A, A, A);
65
type C = (B, B, B, B);

tests/ui/diagnostic-width/long-E0529.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error[E0529]: expected an array or slice, found `(..., ..., ..., ...)`
2-
--> $DIR/long-E0529.rs:10:9
2+
--> $DIR/long-E0529.rs:9:9
33
|
44
LL | let [] = x;
55
| ^^ pattern cannot match with input type `(..., ..., ..., ...)`
66
|
7-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
7+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0529.long-type-$LONG_TYPE_HASH.txt'
88
= note: consider using `--verbose` to print the full type name to the console
99

1010
error: aborting due to 1 previous error

tests/ui/diagnostic-width/long-E0609.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
2-
// The regex below normalizes the long type file name to make it suitable for compare-modes.
3-
//@ normalize-stderr: "'\$TEST_BUILD_DIR/.*\.long-type-\d+.txt'" -> "'$$TEST_BUILD_DIR/$$FILE.long-type-hash.txt'"
2+
43
type A = (i32, i32, i32, i32);
54
type B = (A, A, A, A);
65
type C = (B, B, B, B);

tests/ui/diagnostic-width/long-E0609.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error[E0609]: no field `field` on type `(..., ..., ..., ...)`
2-
--> $DIR/long-E0609.rs:10:7
2+
--> $DIR/long-E0609.rs:9:7
33
|
44
LL | x.field;
55
| ^^^^^ unknown field
66
|
7-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
7+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0609.long-type-$LONG_TYPE_HASH.txt'
88
= note: consider using `--verbose` to print the full type name to the console
99

1010
error: aborting due to 1 previous error

tests/ui/diagnostic-width/long-E0614.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
2-
// The regex below normalizes the long type file name to make it suitable for compare-modes.
3-
//@ normalize-stderr: "'\$TEST_BUILD_DIR/.*\.long-type-\d+.txt'" -> "'$$TEST_BUILD_DIR/$$FILE.long-type-hash.txt'"
2+
43
type A = (i32, i32, i32, i32);
54
type B = (A, A, A, A);
65
type C = (B, B, B, B);

tests/ui/diagnostic-width/long-E0614.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error[E0614]: type `(..., ..., ..., ...)` cannot be dereferenced
2-
--> $DIR/long-E0614.rs:10:5
2+
--> $DIR/long-E0614.rs:9:5
33
|
44
LL | *x;
55
| ^^ can't be dereferenced
66
|
7-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
7+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0614.long-type-$LONG_TYPE_HASH.txt'
88
= note: consider using `--verbose` to print the full type name to the console
99

1010
error: aborting due to 1 previous error

tests/ui/diagnostic-width/long-E0618.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
2-
// The regex below normalizes the long type file name to make it suitable for compare-modes.
3-
//@ normalize-stderr: "'\$TEST_BUILD_DIR/.*\.long-type-\d+.txt'" -> "'$$TEST_BUILD_DIR/$$FILE.long-type-hash.txt'"
2+
43
type A = (i32, i32, i32, i32);
54
type B = (A, A, A, A);
65
type C = (B, B, B, B);

tests/ui/diagnostic-width/long-E0618.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0618]: expected function, found `(..., ..., ..., ...)`
2-
--> $DIR/long-E0618.rs:10:5
2+
--> $DIR/long-E0618.rs:9:5
33
|
44
LL | fn foo(x: D) {
55
| - `x` has type `(..., ..., ..., ...)`
@@ -8,7 +8,7 @@ LL | x();
88
| |
99
| call expression requires function
1010
|
11-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
11+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/long-E0618.long-type-$LONG_TYPE_HASH.txt'
1212
= note: consider using `--verbose` to print the full type name to the console
1313

1414
error: aborting due to 1 previous error

tests/ui/diagnostic-width/long-e0277.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
//@ compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
2-
// The regex below normalizes the long type file name to make it suitable for compare-modes.
3-
//@ normalize-stderr: "'\$TEST_BUILD_DIR/.*\.long-type-\d+.txt'" -> "'$$TEST_BUILD_DIR/$$FILE.long-type-hash.txt'"
42
type A = (i32, i32, i32, i32);
53
type B = (A, A, A, A);
64
type C = (B, B, B, B);

tests/ui/diagnostic-width/long-e0277.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
error[E0277]: the trait bound `(..., ..., ..., ...): Trait` is not satisfied
2-
--> $DIR/long-e0277.rs:14:21
2+
--> $DIR/long-e0277.rs:12:21
33
|
44
LL | require_trait::<D>();
55
| ^ unsatisfied trait bound
66
|
77
= help: the trait `Trait` is not implemented for `(..., ..., ..., ...)`
88
help: this trait has no implementations, consider adding one
9-
--> $DIR/long-e0277.rs:9:1
9+
--> $DIR/long-e0277.rs:7:1
1010
|
1111
LL | trait Trait {}
1212
| ^^^^^^^^^^^
1313
note: required by a bound in `require_trait`
14-
--> $DIR/long-e0277.rs:11:21
14+
--> $DIR/long-e0277.rs:9:21
1515
|
1616
LL | fn require_trait<T: Trait>() {}
1717
| ^^^^^ required by this bound in `require_trait`
18-
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
18+
= note: the full name for the type has been written to '$TEST_BUILD_DIR/long-e0277.long-type-$LONG_TYPE_HASH.txt'
1919
= note: consider using `--verbose` to print the full type name to the console
2020

2121
error: aborting due to 1 previous error

0 commit comments

Comments
 (0)