Skip to content

Commit 8062bee

Browse files
committed
Bless tests
1 parent 955f775 commit 8062bee

19 files changed

Lines changed: 225 additions & 263 deletions

tests/incremental/const-generics/issue-64087.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ fn combinator<T, const S: usize>() -> [T; S] {}
66
fn main() {
77
combinator().into_iter();
88
//[cfail1]~^ ERROR type annotations needed
9-
//[cfail1]~| ERROR type annotations needed
10-
//[cfail1]~| ERROR type annotations needed
119
}

tests/ui/associated-inherent-types/inference-fail.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed
22
--> $DIR/inference-fail.rs:10:12
33
|
44
LL | let _: S<_>::P = ();
5-
| ^^^^^^^ cannot infer type for type parameter `T`
5+
| ^^^^^^^ cannot infer type
66

77
error: aborting due to 1 previous error
88

tests/ui/coherence/warn-when-cycle-is-error-in-coherence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::cmp::Ordering;
33
use std::marker::PhantomData;
44

55
#[derive(PartialEq, Default)]
6-
//~^ ERROR conflicting implementations of trait `PartialEq<Interval<_>>` for type `Interval<_>`
6+
//~^ ERROR conflicting implementations of trait `PartialEq` for type `Interval<_>`
77
pub(crate) struct Interval<T>(PhantomData<T>);
88

99
// This impl overlaps with the `derive` unless we reject the nested

tests/ui/coherence/warn-when-cycle-is-error-in-coherence.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `PartialEq<Interval<_>>` for type `Interval<_>`
1+
error[E0119]: conflicting implementations of trait `PartialEq` for type `Interval<_>`
22
--> $DIR/warn-when-cycle-is-error-in-coherence.rs:5:10
33
|
44
LL | #[derive(PartialEq, Default)]

tests/ui/const-generics/generic_const_exprs/dyn-compatibility-ok-infer-err.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
1818
fn main() {
1919
use_dyn(&());
2020
//~^ ERROR type annotations needed
21-
//~| ERROR type annotations needed
2221
}

tests/ui/const-generics/generic_const_exprs/dyn-compatibility-ok-infer-err.stderr

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,6 @@ help: consider specifying the generic argument
1414
LL | use_dyn::<N>(&());
1515
| +++++
1616

17-
error[E0284]: type annotations needed
18-
--> $DIR/dyn-compatibility-ok-infer-err.rs:19:5
19-
|
20-
LL | use_dyn(&());
21-
| ^^^^^^^ --- type must be known at this point
22-
| |
23-
| cannot infer the value of the const parameter `N` declared on the function `use_dyn`
24-
|
25-
note: required for `()` to implement `Foo<_>`
26-
--> $DIR/dyn-compatibility-ok-infer-err.rs:8:22
27-
|
28-
LL | impl<const N: usize> Foo<N> for () {
29-
| -------------- ^^^^^^ ^^
30-
| |
31-
| unsatisfied trait bound introduced here
32-
= note: required for the cast from `&()` to `&dyn Foo<_>`
33-
help: consider specifying the generic argument
34-
|
35-
LL | use_dyn::<N>(&());
36-
| +++++
37-
38-
error: aborting due to 2 previous errors
17+
error: aborting due to 1 previous error
3918

4019
For more information about this error, try `rustc --explain E0284`.

tests/ui/const-generics/infer/issue-77092.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ fn main() {
1010
for i in 1..4 {
1111
println!("{:?}", take_array_from_mut(&mut arr, i));
1212
//~^ ERROR type annotations needed
13-
//~| ERROR type annotations needed
1413
}
1514
}

tests/ui/const-generics/infer/issue-77092.stderr

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,6 @@ help: consider specifying the generic arguments
1414
LL | println!("{:?}", take_array_from_mut::<i32, N>(&mut arr, i));
1515
| ++++++++++
1616

17-
error[E0284]: type annotations needed
18-
--> $DIR/issue-77092.rs:11:26
19-
|
20-
LL | println!("{:?}", take_array_from_mut(&mut arr, i));
21-
| ---- ^^^^^^^^^^^^^^^^^^^ cannot infer the value of the const parameter `N` declared on the function `take_array_from_mut`
22-
| |
23-
| required by this formatting parameter
24-
|
25-
= note: required for `[i32; _]` to implement `Debug`
26-
= note: 1 redundant requirement hidden
27-
= note: required for `&mut [i32; _]` to implement `Debug`
28-
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug`
29-
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
30-
help: consider specifying the generic arguments
31-
|
32-
LL | println!("{:?}", take_array_from_mut::<i32, N>(&mut arr, i));
33-
| ++++++++++
34-
35-
error: aborting due to 2 previous errors
17+
error: aborting due to 1 previous error
3618

3719
For more information about this error, try `rustc --explain E0284`.

tests/ui/const-generics/try-from-with-const-genericsrs-98299.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ use std::convert::TryFrom;
44
pub fn test_usage(p: ()) {
55
SmallCString::try_from(p).map(|cstr| cstr);
66
//~^ ERROR: type annotations needed
7-
//~| ERROR: type annotations needed
8-
//~| ERROR: type annotations needed
97
}
108

119
pub struct SmallCString<const N: usize> {}

tests/ui/const-generics/try-from-with-const-genericsrs-98299.stderr

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | SmallCString::try_from(p).map(|cstr| cstr);
77
| type must be known at this point
88
|
99
note: required by a const generic parameter in `SmallCString`
10-
--> $DIR/try-from-with-const-genericsrs-98299.rs:11:25
10+
--> $DIR/try-from-with-const-genericsrs-98299.rs:9:25
1111
|
1212
LL | pub struct SmallCString<const N: usize> {}
1313
| ^^^^^^^^^^^^^^ required by this const generic parameter in `SmallCString`
@@ -16,46 +16,6 @@ help: consider giving this closure parameter an explicit type, where the value o
1616
LL | SmallCString::try_from(p).map(|cstr: SmallCString<N>| cstr);
1717
| +++++++++++++++++
1818

19-
error[E0284]: type annotations needed for `SmallCString<_>`
20-
--> $DIR/try-from-with-const-genericsrs-98299.rs:5:36
21-
|
22-
LL | SmallCString::try_from(p).map(|cstr| cstr);
23-
| ------------ ^^^^
24-
| |
25-
| type must be known at this point
26-
|
27-
note: required for `SmallCString<_>` to implement `TryFrom<()>`
28-
--> $DIR/try-from-with-const-genericsrs-98299.rs:13:22
29-
|
30-
LL | impl<const N: usize> TryFrom<()> for SmallCString<N> {
31-
| -------------- ^^^^^^^^^^^ ^^^^^^^^^^^^^^^
32-
| |
33-
| unsatisfied trait bound introduced here
34-
help: consider giving this closure parameter an explicit type, where the value of const parameter `N` is specified
35-
|
36-
LL | SmallCString::try_from(p).map(|cstr: SmallCString<N>| cstr);
37-
| +++++++++++++++++
38-
39-
error[E0284]: type annotations needed for `SmallCString<_>`
40-
--> $DIR/try-from-with-const-genericsrs-98299.rs:5:36
41-
|
42-
LL | SmallCString::try_from(p).map(|cstr| cstr);
43-
| ------------------------- ^^^^
44-
| |
45-
| type must be known at this point
46-
|
47-
note: required for `SmallCString<_>` to implement `TryFrom<()>`
48-
--> $DIR/try-from-with-const-genericsrs-98299.rs:13:22
49-
|
50-
LL | impl<const N: usize> TryFrom<()> for SmallCString<N> {
51-
| -------------- ^^^^^^^^^^^ ^^^^^^^^^^^^^^^
52-
| |
53-
| unsatisfied trait bound introduced here
54-
help: consider giving this closure parameter an explicit type, where the value of const parameter `N` is specified
55-
|
56-
LL | SmallCString::try_from(p).map(|cstr: SmallCString<N>| cstr);
57-
| +++++++++++++++++
58-
59-
error: aborting due to 3 previous errors
19+
error: aborting due to 1 previous error
6020

6121
For more information about this error, try `rustc --explain E0284`.

0 commit comments

Comments
 (0)