Skip to content

the generated rust code can't compile(rustc 1.64.0; flatc 22.9.29; 5.15.71-1-MANJARO) #7573

@hxzhao527

Description

@hxzhao527

Just follow the Tutorial.

  1. schema from monster.fbs
  2. use flatc to generate
❯ flatc --version
flatc version 22.9.29
❯ flatc --rust --gen-mutable --rust-serialize src/monster.fbs
  1. Cargo.toml
[dependencies]
flatbuffers = "2.1.2"
  1. compile check
❯ cargo check
error[E0437]: type `Scalar` is not a member of trait `flatbuffers::EndianScalar`
   --> src/./monster_generated.rs:112:3
    |
112 |   type Scalar = i8;
    |   ^^^^^^^^^^^^^^^^^ not a member of trait `flatbuffers::EndianScalar`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions