Skip to content

frb v2.0.0-dev.38 generated reference to private module and get errors #2073

Closed Answered by svr2kos2
svr2kos2 asked this question in Q&A
Discussion options

You must be logged in to vote

With a new flutter_rust_bridge_codegen project
add api/internal_mod.rs

pub fn internal_hello() {
    println!("Hello from internal_mod.rs!");
}

add api/external_mod.rs

#[path ="internal_mod.rs"] mod internal_hello;
pub fn external_hello() {
    println!("Hello from external_mod.rs!");
    internal_hello::internal_hello();
}

modify api/mod.rs

pub mod simple;
pub mod external_mod;

flutter_rust_bridge_codegen generate and build(web or windows) then get

error[E0603]: module `internal_hello` is private
   --> src\frb_generated.rs:103:51
    |
103 |                         crate::api::external_mod::internal_hello::internal_hello();        
    |                                                  …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@svr2kos2
Comment options

Answer selected by svr2kos2
@fzyzcjy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants