You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use LaunchBuilder::custom the compiler complains with the following diagnostic:
error[E0277]: the size for values of type `dyn std::ops::Fn() -> Box<(dyn std::any::Any + 'static)> + Send + Sync` cannot be known at compilation time
--> src/main.rs:49:27
|
49 | LaunchBuilder::custom(launch_server).with_cfg(config).launch(App);
| --------------------- ^^^^^^^^^^^^^ doesn't have a size known at compile-time
| |
| required by a bound introduced by this call
|
= help: the trait `Sized` is not implemented for `dyn std::ops::Fn() -> Box<(dyn std::any::Any + 'static)> + Send + Sync`
note: required by an implicit `Sized` bound in `dioxus::prelude::LaunchBuilder::custom`
--> /home/enbyted/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dioxus-0.5.6/src/launch.rs:87:24
|
87 | pub fn custom<Cfg, List>(launch_fn: LaunchFn<Cfg, List>) -> LaunchBuilder<Cfg, List> {
| ^^^^ required by the implicit `Sized` requirement on this type parameter in `LaunchBuilder::custom`
It is clear that List type parameter has type dyn Fn /* ... */ which is not Sized. Likely the issue occured during modification of the LanuchFn type alias or misunderstanding of its type params during authoring of the custom function.
The fix is simple, add ?Sized bounds to custom() and rename the generic:
Problem
When trying to use
LaunchBuilder::custom
the compiler complains with the following diagnostic:Steps To Reproduce
Try compiling the following code:
Expected behavior
The code compiles correctly.
Environment:
fullstack
Analysis
The cause is simple, given definitions of
custom()
:and the definition of
LaunchFn<Cfg, List>
:It is clear that
List
type parameter has typedyn Fn /* ... */
which is notSized
. Likely the issue occured during modification of theLanuchFn
type alias or misunderstanding of its type params during authoring of thecustom
function.The fix is simple, add
?Sized
bounds tocustom()
and rename the generic:Questionnaire
The text was updated successfully, but these errors were encountered: