let p: Box<dyn Predicate<str>> = Box::new(always());
I expected to see this happen: It should compile fine
Instead this happened: Build fails with this error:
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> src/constant.rs:86:38
|
86 | let p: Box<dyn Predicate<str>> = Box::new(always());
| ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
= note: required because of the requirements on the impl of `predicates_core::core::Predicate<str>` for `constant::BooleanPredicate`
= note: required for the cast to the object type `dyn predicates_core::core::Predicate<str>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
I tried this code:
I expected to see this happen: It should compile fine
Instead this happened: Build fails with this error:
Meta
predicates-rs version: 1.0.1
rustc --version --verbose
:Originally reported at https://github.com/asomers/mockall/issues/78