Update tests

This commit is contained in:
Katherine Philip 2022-07-13 17:28:11 -07:00
parent 083bd7cb1d
commit 96d34dc9ff
4 changed files with 10 additions and 7 deletions

View File

@ -16,7 +16,6 @@ fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
}
fn main() {
// FIXME(generic_const_exprs): Improve the error message here.
use_dyn(&());
//~^ ERROR type annotations needed
}

View File

@ -1,14 +1,18 @@
error[E0284]: type annotations needed: cannot satisfy `the constant `use_dyn::<{_: usize}>::{constant#0}` can be evaluated`
--> $DIR/object-safety-ok-infer-err.rs:20:5
error[E0284]: type annotations needed
--> $DIR/object-safety-ok-infer-err.rs:19:5
|
LL | use_dyn(&());
| ^^^^^^^ cannot satisfy `the constant `use_dyn::<{_: usize}>::{constant#0}` can be evaluated`
| ^^^^^^^ cannot infer the value of the const parameter `N` declared on the function `use_dyn`
|
note: required by a bound in `use_dyn`
--> $DIR/object-safety-ok-infer-err.rs:14:55
|
LL | fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
| ^^^^^ required by this bound in `use_dyn`
help: consider specifying the generic argument
|
LL | use_dyn::<N>(&());
| +++++
error: aborting due to previous error

View File

@ -7,5 +7,5 @@ extern crate generics_of_parent_impl_trait;
fn main() {
// check for `impl Trait<{ const }>` which has a parent of a `DefKind::TyParam`
generics_of_parent_impl_trait::foo([()]);
//~^ error: type annotations needed:
//~^ error: type annotations needed
}

View File

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