Skip to content

Commit 96d34dc

Browse files
committed
Update tests
1 parent 083bd7c commit 96d34dc

4 files changed

+10
-7
lines changed

src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
1616
}
1717

1818
fn main() {
19-
// FIXME(generic_const_exprs): Improve the error message here.
2019
use_dyn(&());
2120
//~^ ERROR type annotations needed
2221
}

src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.stderr

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
error[E0284]: type annotations needed: cannot satisfy `the constant `use_dyn::<{_: usize}>::{constant#0}` can be evaluated`
2-
--> $DIR/object-safety-ok-infer-err.rs:20:5
1+
error[E0284]: type annotations needed
2+
--> $DIR/object-safety-ok-infer-err.rs:19:5
33
|
44
LL | use_dyn(&());
5-
| ^^^^^^^ cannot satisfy `the constant `use_dyn::<{_: usize}>::{constant#0}` can be evaluated`
5+
| ^^^^^^^ cannot infer the value of the const parameter `N` declared on the function `use_dyn`
66
|
77
note: required by a bound in `use_dyn`
88
--> $DIR/object-safety-ok-infer-err.rs:14:55
99
|
1010
LL | fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
1111
| ^^^^^ required by this bound in `use_dyn`
12+
help: consider specifying the generic argument
13+
|
14+
LL | use_dyn::<N>(&());
15+
| +++++
1216

1317
error: aborting due to previous error
1418

src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ extern crate generics_of_parent_impl_trait;
77
fn main() {
88
// check for `impl Trait<{ const }>` which has a parent of a `DefKind::TyParam`
99
generics_of_parent_impl_trait::foo([()]);
10-
//~^ error: type annotations needed:
10+
//~^ error: type annotations needed
1111
}

src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0284]: type annotations needed: cannot satisfy `the constant `foo::{opaque#0}::{constant#0}` can be evaluated`
1+
error[E0284]: type annotations needed
22
--> $DIR/parent_generics_of_encoding_impl_trait.rs:9:5
33
|
44
LL | generics_of_parent_impl_trait::foo([()]);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `foo::{opaque#0}::{constant#0}` can be evaluated`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer the value of const parameter `N` declared on the function `foo`
66
|
77
note: required by a bound in `foo`
88
--> $DIR/auxiliary/generics_of_parent_impl_trait.rs:6:48

0 commit comments

Comments
 (0)