本文介绍了无法编译 ring crate:找不到模块`montgomery` 的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Cargo 未编译并出现以下错误:

Cargo is not compiling with the following error:

$ cargo build
Compiling ring v0.12.1
error[E0583]: file not found for module `montgomery`
    --> 
 C:\Users\jmccrae\.cargo\registry\src\github.com1ecc6299db9ec823\ring-0.12.1\src\arithmetic/arithmetic.rs:15:9
   |
15 | pub mod montgomery;
   |         ^^^^^^^^^^
   |
   = help: name the file either arithmetic\montgomery.rs or arithmetic\montgomery\mod.rs inside the directory 
"C:\\Users\\jmccrae\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\ring-0.12.1\\src\\arithmetic"

该项目是一个新项目,修改了 Cargo.toml 以包含对 ring 箱的最新版本 (0.12.1) 的依赖.Cargo.toml 如下:

The project was a new project with Cargo.toml modified to include a dependency to the most recent version (0.12.1) of the ring crate. The Cargo.toml is as follows:

[package]
name = "testring"
version = "0.1.0"
authors = ["John McCrae <[email protected]>"]

[dependencies]
ring = "0.12.1"

所需文件似乎确实存在:

The required file seems to actually exist:

$ ls  C:\\Users\\jmccrae\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\ring-0.12.1\\src\\arithmetic
arithmetic.rs  montgomery.rs

cargo 版本是 cargo 0.25.0-nightly (930f9d949 2017-12-05) 并且它在 MINGW 上运行.

The cargo version is cargo 0.25.0-nightly (930f9d949 2017-12-05) and it is running on MINGW.

编译器设置有什么问题吗?

Is there anything wrong with the compiler set-up?

推荐答案

这是一个问题Ring 和 Rust 1.24.0 每晚 (2017-12-21).它还有一个相关的 Rust 存储库中的问题.

This is an issue with Ring and Rust 1.24.0-nightly (2017-12-21). It also has an associated issue in the Rust repository.

要解决这个问题,请每晚使用旧版本的 Rust(如果可以,请避免每晚使用).

To work around it, use an older version of Rust nightly (or avoid nightly if you can).

这篇关于无法编译 ring crate:找不到模块`montgomery` 的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 11:34