mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* Make a use_hook hook with the new Hook trait. * Implement Lifetime. * Rewrites function signature. * Only apply lifetime if there're other lifetimes. * Cleanup signature rewrite logic. * Rewrite hook body. * Port some built-in hooks. * Finish porting all built-in hooks. * Port tests. * Fix tests. * Migrate to macro-based hooks. * Fix HookContext, add tests on non-possible locations. * Fix stderr for trybuild. * Add 1 more test case. * Adjust doc location. * Pretty print hook signature. * Fix Items & std::ops::Fn*. * Add use_memo. * Optimise Implementation of hooks. * Use Box to capture function value only. * Detect whether needs boxing. * Add args if boxing not needed. * Enforce hook number. * Deduplicate use_effect. * Optimise Implementation. * Update documentation. * Fix website test. Strip BoxedHook implementation from it. * Allow doc string. * Workaround doc tests. * Optimise codebase & documentation. * Fix website test. * Reduce implementation complexity. * Destructor is no more. * Documentation and macros. * Reduce heap allocation and hook complexity. * Remove Queue as well. * Prefer Generics. * Fix typo. * Remove more allocations. * Add comments. * Remove outdated comment. * Bare Function Pointer for better code size.
80 lines
3.7 KiB
Plaintext
80 lines
3.7 KiB
Plaintext
error[E0412]: cannot find type `INVALID` in this scope
|
|
--> tests/function_component_attr/generic-props-fail.rs:25:19
|
|
|
|
|
20 | fn compile_fail() {
|
|
| - help: you might be missing a type parameter: `<INVALID>`
|
|
...
|
|
25 | html! { <Comp<INVALID> /> };
|
|
| ^^^^^^^ not found in this scope
|
|
|
|
error[E0599]: no method named `build` found for struct `PropsBuilder<PropsBuilderStep_missing_required_prop_a>` in the current scope
|
|
--> tests/function_component_attr/generic-props-fail.rs:22:14
|
|
|
|
|
3 | #[derive(Clone, Properties, PartialEq)]
|
|
| ---------- method `build` not found for this
|
|
...
|
|
22 | html! { <Comp<Props> /> };
|
|
| ^^^^ method not found in `PropsBuilder<PropsBuilderStep_missing_required_prop_a>`
|
|
|
|
|
= note: the method was found for
|
|
- `PropsBuilder<PropsBuilderStepPropsBuilder>`
|
|
|
|
error[E0277]: the trait bound `FunctionComponent<CompFunctionProvider<MissingTypeBounds>>: BaseComponent` is not satisfied
|
|
--> tests/function_component_attr/generic-props-fail.rs:27:14
|
|
|
|
|
27 | html! { <Comp<MissingTypeBounds> /> };
|
|
| ^^^^ the trait `BaseComponent` is not implemented for `FunctionComponent<CompFunctionProvider<MissingTypeBounds>>`
|
|
|
|
|
= help: the following implementations were found:
|
|
<FunctionComponent<T> as BaseComponent>
|
|
|
|
error[E0599]: the function or associated item `new` exists for struct `VChild<FunctionComponent<CompFunctionProvider<MissingTypeBounds>>>`, but its trait bounds were not satisfied
|
|
--> tests/function_component_attr/generic-props-fail.rs:27:14
|
|
|
|
|
27 | html! { <Comp<MissingTypeBounds> /> };
|
|
| ^^^^ function or associated item cannot be called on `VChild<FunctionComponent<CompFunctionProvider<MissingTypeBounds>>>` due to unsatisfied trait bounds
|
|
|
|
|
::: $WORKSPACE/packages/yew/src/functional/mod.rs
|
|
|
|
|
| pub struct FunctionComponent<T: FunctionProvider + 'static> {
|
|
| ----------------------------------------------------------- doesn't satisfy `_: BaseComponent`
|
|
|
|
|
= note: the following trait bounds were not satisfied:
|
|
`FunctionComponent<CompFunctionProvider<MissingTypeBounds>>: BaseComponent`
|
|
|
|
error[E0277]: the trait bound `MissingTypeBounds: yew::Properties` is not satisfied
|
|
--> tests/function_component_attr/generic-props-fail.rs:27:14
|
|
|
|
|
27 | html! { <Comp<MissingTypeBounds> /> };
|
|
| ^^^^ the trait `yew::Properties` is not implemented for `MissingTypeBounds`
|
|
|
|
|
note: required because of the requirements on the impl of `FunctionProvider` for `CompFunctionProvider<MissingTypeBounds>`
|
|
--> tests/function_component_attr/generic-props-fail.rs:8:1
|
|
|
|
|
8 | #[function_component(Comp)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: required by a bound in `FunctionComponent`
|
|
--> $WORKSPACE/packages/yew/src/functional/mod.rs
|
|
|
|
|
| pub struct FunctionComponent<T: FunctionProvider + 'static> {
|
|
| ^^^^^^^^^^^^^^^^ required by this bound in `FunctionComponent`
|
|
= note: this error originates in the attribute macro `function_component` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error[E0107]: missing generics for type alias `Comp`
|
|
--> tests/function_component_attr/generic-props-fail.rs:30:14
|
|
|
|
|
30 | html! { <Comp /> };
|
|
| ^^^^ expected 1 generic argument
|
|
|
|
|
note: type alias defined here, with 1 generic parameter: `P`
|
|
--> tests/function_component_attr/generic-props-fail.rs:8:22
|
|
|
|
|
8 | #[function_component(Comp)]
|
|
| ^^^^
|
|
9 | fn comp<P>(_props: &P) -> Html
|
|
| -
|
|
help: add missing generic argument
|
|
|
|
|
30 | html! { <Comp<P> /> };
|
|
| ~~~~~~~
|