Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#[component] cannot handle empty struct types #7

Open
sassman opened this issue Oct 18, 2022 · 0 comments
Open

#[component] cannot handle empty struct types #7

sassman opened this issue Oct 18, 2022 · 0 comments

Comments

@sassman
Copy link

sassman commented Oct 18, 2022

this works:

#[component]
struct SpecificDuck {}

this does not work:

#[component]
struct SpecificDuck;

the error is:

error[E0618]: expected function, found struct `SpecificDuck`
  --> examples/01-waiter-di.rs:11:8
   |
10 | #[component]
   | ------------ call expression requires function
11 | struct SpecificDuck;
   | -------^^^^^^^^^^^^
   | |
   | struct `SpecificDuck` defined here
   |
help: `SpecificDuck` is a unit struct, and does not take parentheses to be constructed
   |
10 - #[component]
10 + #[component]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant