-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cannot find derive macro FromForm
in this scope
#274
Comments
Can you post the complete error output? |
Sure!
|
Which OS are you on? I can't replicate this on either OS X or Linux (Debian, Arch, or CoreOS). This is unlikely to be an issue with Rocket, and instead, and issue with |
I am running Ubuntu 16.04. I'll try upgrading my nightly. |
That didn't work, nor did re-ordering/removing some derives. |
Try other version of nightly. This works for me:
|
@rofrol negatory. Does not work. |
I boot up a VM with Ubuntu 16.04 to verify this issue and was unable to. As such, I don't believe there is an issue with Looking at your example code, it's not clear how you're structuring your project. I had assumed that If these hints don't resolve your issue, please post a minimally reproducing example. |
@SergioBenitez The folder structure is like this:
I'm rather new to Rust, so I might be structuring my project the wrong way. |
Im able to compile the current state of master on OS X, assuming we're talking about https://github.com/tekknolagi/holdthedoor. Are you doing something fancier than simply For reference, I have the following installed at the moment:
|
@tekknolagi Ah, alright. So this is indeed what I described earlier:
In this case, you have two crates. One is |
@Sunspar the current state of master contains my workaround for this problem, which includes a new struct @SergioBenitez Interesting. I'll give that a go! |
It worked and I pushed the update to master of holdthedoor. Thank you so much @SergioBenitez! |
I am using
rocket
,rocket_codegen
, androcket_contrib
all version 0.2.6. Rust is 1.18.0-nightly (252d3da8a). I've poked around docs, general Rust documentation about custom derive macros, RFCs, and previous issues on Rocket. It feels like https://api.rocket.rs/rocket/request/trait.FromForm.html should answer this question, but it doesn't.How can I have a struct deriving FromForm in one file,
util.rs
, and use it in the main webserver fileweb.rs
? And if I can't, what are the best practices for receiving form input meant to create a resource?My code currently looks something like:
Currently
util.rs
throws an error about the derive macroFromForm
not being in scope. When I make a struct inweb.rs
, however, that does not happen.The text was updated successfully, but these errors were encountered: