2017-12-06 7 views
2

私は、コードは次のエラーで失敗したのMacOSシエラ10.12.6におけるビットフラグv1.0.1デベロッパーとのラストで、プロジェクト構築しようとした際:bitflags 1.0をコンパイルすると、 "expected ident、found#"エラーが発生するのはなぜですか?

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 

を、私はそれが正常にビルドすると予想。

+1

あなたが提供したテンプレートの一部は次のように書いています:*問題を示すコードの部分を貼り付けます*、あなたはそのステップを忘れてしまったようです。それがないと情報を提供することはできません。 – Shepmaster

+0

あなたはどのバージョンのRustを使用していますか? – Shepmaster

+0

コードはどのように見えますか? – csmckelvey

答えて

7

必要最小限より古いバージョンのRustでコンパイルすると、一部のテンプレートがコンパイルに失敗することがあります。それは、OSのバージョンやアプリケーション自体とは関係ありません。

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

時々、rustup updateを実行してRustコンパイラを更新します。

関連する問題