Skip to content

Commit b543044

Browse files
committed
Modify other tests to align the change
Signed-off-by: Shunpoco <[email protected]>
1 parent db80405 commit b543044

6 files changed

+25
-17
lines changed

tests/ui/consts/do-not-ice-on-field-access-of-err-type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ impl<T> Foo for T {}
44
fn main() {
55
let array = [(); { loop {} }]; //~ ERROR constant evaluation is taking a long time
66

7-
let tup = (7,);
7+
let tup = (7,); //~ ERROR type annotations needed for `({integer},)` [E0282]
88
let x: &dyn Foo = &tup.0;
99
}

tests/ui/consts/do-not-ice-on-field-access-of-err-type.stderr

+13-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,17 @@ LL | let array = [(); { loop {} }];
1313
| ^^^^^^^^^^^
1414
= note: `#[deny(long_running_const_eval)]` on by default
1515

16-
error: aborting due to 1 previous error
16+
error[E0282]: type annotations needed for `({integer},)`
17+
--> $DIR/do-not-ice-on-field-access-of-err-type.rs:7:9
18+
|
19+
LL | let tup = (7,);
20+
| ^^^
21+
|
22+
help: consider giving `tup` an explicit type, where the type for tuple `({integer},)` is specified
23+
|
24+
LL | let tup: ({integer},) = (7,);
25+
| ++++++++++++++
26+
27+
error: aborting due to 2 previous errors
1728

29+
For more information about this error, try `rustc --explain E0282`.

tests/ui/privacy/no-ice-on-inference-failure.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fn main_ref() {
1010
}];
1111

1212
let mut ptrs: Vec<*const [u8]> = vec![&array[0..0], &array[0..1], &array, &array[1..]];
13+
//~^ ERROR type annotations needed [E0282]
1314
}
1415

1516
fn main() {}

tests/ui/privacy/no-ice-on-inference-failure.stderr

+8-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,12 @@ LL | | }];
2323
| |_____^
2424
= note: `#[deny(long_running_const_eval)]` on by default
2525

26-
error: aborting due to 1 previous error
26+
error[E0282]: type annotations needed
27+
--> $DIR/no-ice-on-inference-failure.rs:12:50
28+
|
29+
LL | let mut ptrs: Vec<*const [u8]> = vec![&array[0..0], &array[0..1], &array, &array[1..]];
30+
| ^^^^ cannot infer type for struct `std::ops::Range<{integer}>`
31+
32+
error: aborting due to 2 previous errors
2733

34+
For more information about this error, try `rustc --explain E0282`.

tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ fn main() {
44
//~| ERROR cannot find type `T` in this scope
55
//~| ERROR const and type arguments are not allowed on builtin type `str`
66
//~| ERROR expected unit struct, unit variant or constant, found associated function `str<
7-
//~| ERROR type annotations needed
87
}

tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr

+2-13
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,7 @@ error[E0533]: expected unit struct, unit variant or constant, found associated f
3434
LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes;
3535
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a unit struct, unit variant or constant
3636

37-
error[E0282]: type annotations needed
38-
--> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:31
39-
|
40-
LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes;
41-
| ^^^^^^^^^^^^^^^^^^
42-
|
43-
help: consider giving this pattern a type
44-
|
45-
LL | let str::<{fn str() { let str::T>>::as_bytes: /* Type */; }}, T>::as_bytes;
46-
| ++++++++++++
47-
48-
error: aborting due to 5 previous errors
37+
error: aborting due to 4 previous errors
4938

50-
Some errors have detailed explanations: E0109, E0282, E0412, E0533.
39+
Some errors have detailed explanations: E0109, E0412, E0533.
5140
For more information about an error, try `rustc --explain E0109`.

0 commit comments

Comments
 (0)