2

macOS Sierra 10.12.6 で bitflags v1.0.1 を使用して Rust でプロジェクトをビルドしようとすると、コードは次のエラーで失敗します。

Compiling bitflags v1.0.1
error: expected ident, found #
   --> /Users/kenneth.marete/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.1/src/lib.rs:423:29
    |
423 |                               #[allow(deprecated)]
    |                               ^
    | 
   ::: /Users/kenneth.marete/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.1/src/example_generated.rs
    |
4   | / bitflags! {
5   | |     /// This is the same `Flags` struct defined in the [crate level example](../index.html#example).
6   | |     /// Note that this struct is just for documentation purposes only, it must not be used outside
7   | |     /// this crate.
...   |
13  | |     }
14  | | }
    | |_- in this macro invocation

私はそれがうまく構築されることを期待していました。

4

1 に答える 1

7

最低限必要なバージョンよりも古いバージョンの Rust でコンパイルすると、一部のクレートがコンパイルに失敗する場合があります。OSのバージョンやアプリ自体とは関係ありません。

関連する定数を使用してrustc 1.19.0 (0ade33941 2017-07-17)いるため、bitflags バージョン 1.0.1 にはサポートされている Rust の最小バージョンが 1.20 でした。

ときどき、Rust コンパイラを実行して更新しますrustup update

于 2017-12-06T20:40:17.230 に答える