vim - 在 crate `rust_out` 中找不到 `main` 函数:考虑在 vim/ale 的 crate 级别添加一个 `main` 函数
问题描述
我有一些只有另一个 modu 的 Rust 代码
// main.rs
mod foo;
fn main() {
foo::hello();
}
// foo.rs
pub fn hello() {
println!("Hello, world!");
}
但是 vim ale https://github.com/dense-analysis/ale一直声称:
`main` function not found in crate `rust_out`: consider adding a `main` function at the crate level
这是配置
...
Plug 'rust-lang/rust.vim'
...
let g:ale_linters = {
\ 'rust': ['rls', 'rustc', 'cargo'],
\ }
...
cargo build
运行良好,是麦酒出了问题!?
解决方案
推荐阅读
- geometry - 寻找点云最密集区域的质心
- javascript - 材质ui选择组件下拉定位
- logstash - Grok 无法创建可选字段
- reactjs - 子状态为真时如何将父状态设置为假
- python - Pandas DataFrame 的多循环和多拆分
- django - 由于 manage.py 文件中的错误,无法运行 django 项目
- cloudflare-workers - 牧马人工人:HTMLRewriter.on 与 ElementHandler 不工作
- python - 如何使用 tkinter 添加和移动图像?
- python - 使用 Paramiko 设置 SSH 隧道以访问 PostgreSQL
- swift - 小部件仅在模拟器中选择时运行