https://linen.dev logo
no function or associated item named `new` found f...
# help
r
The
shuttle_service::main
macro expansion started generating an odd compiler error after I updated (from 0.9.0, I think) to 0.14.0. Here are the errors given by rustc 1.68.2:
Copy code
error[E0599]: no function or associated item named `new` found for struct `Secrets` in the current scope
    --> src/lib.rs:1303:50
     |
1303 |     let secret_store = shuttle_secrets::Secrets::new()
     |                                                  ^^^ function or associated item not found in `Secrets`
     |
     = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
     |
1    | use shuttle_service::ResourceBuilder;
     |

error[E0599]: no function or associated item named `new` found for struct `Postgres` in the current scope
    --> src/lib.rs:1310:45
     |
1310 |     let pool = shuttle_shared_db::Postgres::new()
     |                                             ^^^ function or associated item not found in `Postgres`
     |
     = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
     |
1    | use shuttle_service::ResourceBuilder;
     |

warning: unused import: `shuttle_service::Context`
    --> src/lib.rs:1275:9
     |
1275 |     use shuttle_service::Context;
     |         ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: `#[warn(unused_imports)]` on by default

warning: unused import: `shuttle_service::ResourceBuilder`
    --> src/lib.rs:1276:9
     |
1276 |     use shuttle_service::ResourceBuilder;
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The odd thing is that the suggested
use
directives are present in the macro expansion, and if I add them manually I get warnings about useless
use
statements instead. Has anyone seen an issue like this before?
a
Is your cargo shuttle version 0.14.0?
r
... I think I updated it yesterday, but let me check
Yes, 0.14.0
a
oh you need to migrate to main.rs
r
Ah!
I skimmed the release notes, but only made a brief mental note to see if I needed to do anything
a
The release notes for 0.13.0 should be able to assist you, but if you can't find them on gh I can help once I get home if someone else doesn't already get to it
r
So, simply migrating to main.rs following the instructions hasn't affected those errors
e
Wait... Oh, okay. No that's weird. Is this code public somewhere we can check it out?
r
Wait, that was my bad
I'd missed the move from the
bot-poise
feature to the
shuttle_poise
crate, and
cargo
was being confused
it works now -- thanks for the pointer 👍