Skip to content

Commit e2905b9

Browse files
committed
tests: remove explicit long type filename hash normalization from some ui tests
1 parent ee211c8 commit e2905b9

Some content is hidden

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

48 files changed

+97
-140
lines changed

Diff for: 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

Diff for: 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
}

Diff for: 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

Diff for: 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);

Diff for: 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

Diff for: 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

Diff for: 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;

Diff for: 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

Diff for: 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);

Diff for: 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

Diff for: tests/ui/diagnostic-width/non-copy-type-moved.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

53
type A = (String, String, String, String);
64
type B = (A, A, A, A);

Diff for: tests/ui/diagnostic-width/non-copy-type-moved.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0382]: use of moved value: `x`
2-
--> $DIR/non-copy-type-moved.rs:16:14
2+
--> $DIR/non-copy-type-moved.rs:14:14
33
|
44
LL | fn foo(x: D) {
55
| - move occurs because `x` has type `(..., ..., ..., ...)`, which does not implement the `Copy` trait
@@ -8,7 +8,7 @@ LL | let _a = x;
88
LL | let _b = x;
99
| ^ value used here after move
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/non-copy-type-moved.long-type-$LONG_TYPE_HASH.txt'
1212
= note: consider using `--verbose` to print the full type name to the console
1313
help: consider cloning the value if the performance cost is acceptable
1414
|

Diff for: tests/ui/diagnostic-width/secondary-label-with-long-type.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
//@ compile-flags: --diagnostic-width=100 -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

53
type A = (i32, i32, i32, i32);
64
type B = (A, A, A, A);

Diff for: tests/ui/diagnostic-width/secondary-label-with-long-type.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/secondary-label-with-long-type.rs:11:9
2+
--> $DIR/secondary-label-with-long-type.rs:9:9
33
|
44
LL | let () = x;
55
| ^^ - this expression has type `((..., ..., ..., ...), ..., ..., ...)`
@@ -8,7 +8,7 @@ LL | let () = x;
88
|
99
= note: expected tuple `((..., ..., ..., ...), ..., ..., ...)`
1010
found unit type `()`
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/secondary-label-with-long-type.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

Diff for: tests/ui/error-codes/E0275.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"
21
trait Foo {}
32

43
struct Bar<T>(T);

Diff for: tests/ui/error-codes/E0275.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0275]: overflow evaluating the requirement `Bar<Bar<Bar<Bar<Bar<Bar<Bar<...>>>>>>>: Foo`
2-
--> $DIR/E0275.rs:6:33
2+
--> $DIR/E0275.rs:5:33
33
|
44
LL | impl<T> Foo for T where Bar<T>: Foo {}
55
| ^^^
66
|
77
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`E0275`)
88
note: required for `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Foo`
9-
--> $DIR/E0275.rs:6:9
9+
--> $DIR/E0275.rs:5:9
1010
|
1111
LL | impl<T> Foo for T where Bar<T>: Foo {}
1212
| ^^^ ^ --- unsatisfied trait bound introduced here

Diff for: tests/ui/higher-ranked/trait-bounds/hang-on-deeply-nested-dyn.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"
2-
31
fn id(
42
f: &dyn Fn(u32),
53
) -> &dyn Fn(

Diff for: tests/ui/higher-ranked/trait-bounds/hang-on-deeply-nested-dyn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/hang-on-deeply-nested-dyn.rs:12:5
2+
--> $DIR/hang-on-deeply-nested-dyn.rs:10:5
33
|
44
LL | ) -> &dyn Fn(
55
| ______-

Diff for: tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"
2-
31
// rust-lang/rust#30786: the use of `for<'b> &'b mut A: Stream<Item=T>`
42
// should act as assertion that item does not borrow from its stream;
53
// but an earlier buggy rustc allowed `.map(|x: &_| x)` which does

Diff for: tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
error[E0599]: the method `filterx` exists for struct `Map<Repeat, {[email protected]:115:27}>`, but its trait bounds were not satisfied
2-
--> $DIR/hrtb-doesnt-borrow-self-1.rs:116:22
1+
error[E0599]: the method `filterx` exists for struct `Map<Repeat, {[email protected]:113:27}>`, but its trait bounds were not satisfied
2+
--> $DIR/hrtb-doesnt-borrow-self-1.rs:114:22
33
|
44
LL | pub struct Map<S, F> {
55
| -------------------- method `filterx` not found for this struct because it doesn't satisfy `_: StreamExt`
@@ -8,16 +8,16 @@ LL | let filter = map.filterx(|x: &_| true);
88
| ^^^^^^^ method cannot be called due to unsatisfied trait bounds
99
|
1010
note: the following trait bounds were not satisfied:
11-
`&'a mut &Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:115:27: 115:34}>: Stream`
12-
`&'a mut &mut Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:115:27: 115:34}>: Stream`
13-
`&'a mut Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:115:27: 115:34}>: Stream`
14-
--> $DIR/hrtb-doesnt-borrow-self-1.rs:98:50
11+
`&'a mut &Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:113:27: 113:34}>: Stream`
12+
`&'a mut &mut Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:113:27: 113:34}>: Stream`
13+
`&'a mut Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:113:27: 113:34}>: Stream`
14+
--> $DIR/hrtb-doesnt-borrow-self-1.rs:96:50
1515
|
1616
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
1717
| --------- - ^^^^^^ unsatisfied trait bound introduced here
1818
= help: items from traits can only be used if the trait is implemented and in scope
1919
note: `StreamExt` defines an item `filterx`, perhaps you need to implement it
20-
--> $DIR/hrtb-doesnt-borrow-self-1.rs:66:1
20+
--> $DIR/hrtb-doesnt-borrow-self-1.rs:64:1
2121
|
2222
LL | pub trait StreamExt
2323
| ^^^^^^^^^^^^^^^^^^^

Diff for: tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"
2-
31
// rust-lang/rust#30786: the use of `for<'b> &'b mut A: Stream<Item=T`
42
// should act as assertion that item does not borrow from its stream;
53
// but an earlier buggy rustc allowed `.map(|x: &_| x)` which does

Diff for: tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, fn(&u64) -> &u64 {identity::<u64>}>, {[email protected]:111:30}>`, but its trait bounds were not satisfied
2-
--> $DIR/hrtb-doesnt-borrow-self-2.rs:112:24
1+
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, fn(&u64) -> &u64 {identity::<u64>}>, {[email protected]:109:30}>`, but its trait bounds were not satisfied
2+
--> $DIR/hrtb-doesnt-borrow-self-2.rs:110:24
33
|
44
LL | pub struct Filter<S, F> {
55
| ----------------------- method `countx` not found for this struct because it doesn't satisfy `_: StreamExt`
@@ -8,16 +8,16 @@ LL | let count = filter.countx();
88
| ^^^^^^ method cannot be called due to unsatisfied trait bounds
99
|
1010
note: the following trait bounds were not satisfied:
11-
`&'a mut &Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/hrtb-doesnt-borrow-self-2.rs:111:30: 111:37}>: Stream`
12-
`&'a mut &mut Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/hrtb-doesnt-borrow-self-2.rs:111:30: 111:37}>: Stream`
13-
`&'a mut Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/hrtb-doesnt-borrow-self-2.rs:111:30: 111:37}>: Stream`
14-
--> $DIR/hrtb-doesnt-borrow-self-2.rs:98:50
11+
`&'a mut &Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/hrtb-doesnt-borrow-self-2.rs:109:30: 109:37}>: Stream`
12+
`&'a mut &mut Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/hrtb-doesnt-borrow-self-2.rs:109:30: 109:37}>: Stream`
13+
`&'a mut Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/hrtb-doesnt-borrow-self-2.rs:109:30: 109:37}>: Stream`
14+
--> $DIR/hrtb-doesnt-borrow-self-2.rs:96:50
1515
|
1616
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
1717
| --------- - ^^^^^^ unsatisfied trait bound introduced here
1818
= help: items from traits can only be used if the trait is implemented and in scope
1919
note: `StreamExt` defines an item `countx`, perhaps you need to implement it
20-
--> $DIR/hrtb-doesnt-borrow-self-2.rs:66:1
20+
--> $DIR/hrtb-doesnt-borrow-self-2.rs:64:1
2121
|
2222
LL | pub trait StreamExt
2323
| ^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)