Top "Rust-cargo" questions

Cargo is the official package manager for the Rust programming language.

Is there a list of all cfg features?

Rust has the ability to check configuration at build time with, e.g., #[cfg(target_os = "linux")] or if cfg!(…

rust rust-cargo
How to include files from same directory in a module using Cargo/Rust?

I have a Cargo project consisting of three files in the same directory: main.rs, mod1.rs and mod2.rs. …

import module rust rust-cargo
How to move tests into a separate file for binaries in Rust's Cargo?

I created a new binary using Cargo: cargo new my_binary --bin A function in my_binary/src/main.rs …

testing rust rust-cargo
failed to parse manifest - no targets specified

I am new to Rust and attempting to build a test project with Cargo. My Cargo.toml looks like: [package] …

rust rust-cargo
"unresolved import -- maybe a missing extern" When extern declaration exists

I have a small project which built with no issues when it was all in one big .rs file. I …

rust rust-cargo
How do I debug a failing cargo test in GDB?

I have a failing Cargo test: $ cargo test [snip] Running target/gunzip-c62d8688496249d8 running 2 tests test test_extract_failure ... …

gdb rust rust-cargo
Stack trace with line numbers when running cargo run

Doing RUST_BACKTRACE=1 cargo run gives a stack trace when an error occurs as shown below. Is there any way …

rust stack-trace rust-cargo
Linking Rust application with a dynamic library not in the runtime linker search path

I have a shared library that I'd like to dynamically link into several separate binary Cargo applications. I include its …

rust dynamic-linking dynamic-library rust-cargo ldd
How can I specify binary-only dependencies?

I have a crate with both a binary and a library. The library is extremely light on dependencies, while the …

rust rust-cargo
Compilation error: can't find crate for `core`

I'm using Rust 1.35.0 to try out some Rust examples and I could not get it to compile, as I keep …

rust rust-cargo crate