Category "rust-cargo"

cargo install cargo-generate --features vendored-openssl failed

I am trying to install terrain from terra-money. For that, the instructions said to follow the commands. I have run these instructions on ubuntu 20.04 1. Set 's

How to use .cargo/config.toml file with both stable and nightly rust toolchain?

I have installed both nightly and stable rust toolchains and make some -Z ... compile flags for nightly, but the stable rust can't recognize it and stops compil

Newtype pattern error: cannot move out of dereference of

I want to create a Wrapper around an existing type/struct. According to the Newtype pattern, as per Rust Book ch 19, "implementing Deref trait on the Wrapper to

Cargo error: duplicate lang item in crate `casper_contract` (which `contract` depends on): `panic_impl`

I am trying to use the standard casper demo project as generated by command "cargo casper my-project" but with some std::io. I want to read a value from the con

Problem trying to install diesel (Mac air m1)

I am following the diesel guide: LINK When i try this: cargo install diesel_cli --no-default-features --features postgres i receive this error: error: failed t

Why doesn't the rust create openssl-sys compile?

error: failed to run custom build command for `openssl-sys v0.9.72` Caused by: process didn't exit successfully: `C:\Users\REBERE~1\AppData\Local\Temp\cargo-

Why is rust-analyzer not finding dependencies in workspace member?

I have a cargo workspace with one library "./raytracing" and one binary "./cli". The two workspace members have different dependencies. ./raytracing/Cargo.toml:

note: /usr/bin/ld: cannot find -lpq Rust

il" "-ldl" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" = note: /usr/bin/ld: cannot find -lpq colle

Building rust with LLVM Fork

Following the instructions here, I have tried building rust with a fork of LLVM which has a back-end for a new target. I have: Recursively cloned the Rust repos

Rust build error: unknown `--json` option `future-incompat`

I am trying to build a basic application for the Adafruit CLUE using Rust. When using the peripheral access crate (PAC) everything works fine, but I would like

Set a project to use nightly by default

How do I set a Cargo project to build & run using nightly by default (i.e. cargo build is actually cargo +nightly build) without setting nightly as the glob

How to build the docs.rs documentation of an FFI crate when the native library is not present?

I have a "sys" crate that links statically to a library: Cargo.toml: [package] links = "foo-1.0" build.rs: fn main() { println!("cargo:rustc-link-lib=d

How to fix Rust diesel cli link libpq.lib error on install

I'm trying (for hours now) to install the cargo crate diesel_cli for postgres. However, every time I run the recommended cargo command: cargo install diesel_cli

Anchor build error versions of anchor-spl and anchor-lang

I'm using the following repository of rust: https://github.com/SmartCodeBlockchainDev/Nelson-NFT-stacking when I try to do an anchor build I get the following e

How to use the mold linker with cargo?

I'm using lld as my linker currently for Rust, but recently encountered the mold project, which is faster than lld. I'd like to try it for Rust compilation, but

How to setup default rust compilation target on CI using rustup command on github actions?

I need to compile my code for both 32 and 64 bit windows. As far as I understand, I basically need to configure my CI so that this command: rustup default print

error: component 'clippy' for target {target} is unavailable for download

When using a custom rust-toolchain file with a pinned version 1.59.0 and running cargo clippy in 1.59.0, I get error: the 'cargo-clippy' binary, normally provi

How to Use String instead of ObjectId in "wither" Rust?

I have this code here: pub struct Account { #[serde(rename = "_id", skip_serializing_if = "Option::is_none")] pub id: Option<ObjectId>, pub em

How to Use String instead of ObjectId in "wither" Rust?

I have this code here: pub struct Account { #[serde(rename = "_id", skip_serializing_if = "Option::is_none")] pub id: Option<ObjectId>, pub em

How do you run the main binary and then run tests based on it in Rust?

I have written a webserver which requires some complicated setup and teardown, and am trying to write unit tests. Axum does provide examples using the Tower One