I created a lib and when publish to crates error: failed to verify package tarball

hi.

  1. create ( cargo new cru2 --lib)

  2. write to .toml

  3. create and push to github repo

  4. run command: ( cargo publish ) result show
    error : failed to verify package tarball

where is Problem ???

               [package]
               name = "cru2"
               version = "0.1.0"
               edition = "2021"
               authors = ["DanyalMhai@gmail.com"]
               readme = "README.md"
               license = "MIT OR Apache-2.0"
               keywords = ["gamedev", "graphics"]
               homepage = "https://github.com/Rustixir/cru2"
               repository = "https://github.com/Rustixir/cru2"
               [dependencies]

               [lib]
               path = "lib.rs"

What else is in the error?

dumbelldor@Dumbelldor:~/Documents/Rust/2022/cru2$ cargo publish 
    Updating crates.io index
warning: manifest has no description.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging cru2 v0.1.0 (/home/dumbelldor/Documents/Rust/2022/cru2)
   Verifying cru2 v0.1.0 (/home/dumbelldor/Documents/Rust/2022/cru2)
   Compiling cru2 v0.1.0 (/home/dumbelldor/Documents/Rust/2022/cru2/target/package/cru2-0.1.0)
error: couldn't read lib.rs: No such file or directory (os error 2)

error: failed to verify package tarball

Caused by:
  could not compile `cru2` due to previous error

after remove this line works, but why ??
root file was ( src/lib.rs )

[lib]
path = "lib.rs"

solved.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.