`main` function not found in crate `rust_out`: consider adding a `main` function at the crate level on vim/ale

Viewed 1101

I have some Rust code that just has another modu

// main.rs
mod foo;
fn main() {
    foo::hello();
}

// foo.rs
pub fn hello() {
    println!("Hello, world!");
}

But vim ale https://github.com/dense-analysis/ale keeps claiming:

`main` function not found in crate `rust_out`: consider adding a `main` function at the crate level

Here is the configuration

...
Plug 'rust-lang/rust.vim'
...
let g:ale_linters = {
      \   'rust': ['rls', 'rustc', 'cargo'],
      \ }
...

cargo build runs fine, it's something on ale that is going wrong!?

0 Answers
Related