]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-14366.stderr
Rollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_cons...
[rust.git] / src / test / ui / issues / issue-14366.stderr
1 error[E0277]: the size for values of type `str` cannot be known at compilation time
2   --> $DIR/issue-14366.rs:2:14
3    |
4 LL |     let _x = "test" as &dyn (::std::any::Any);
5    |              ^^^^^^ doesn't have a size known at compile-time
6    |
7    = help: the trait `Sized` is not implemented for `str`
8    = note: required for the cast from `str` to the object type `dyn Any`
9 help: consider borrowing the value, since `&str` can be coerced into `dyn Any`
10    |
11 LL |     let _x = &"test" as &dyn (::std::any::Any);
12    |              +
13
14 error: aborting due to previous error
15
16 For more information about this error, try `rustc --explain E0277`.