Skip to main content

All Questions

Tagged with
0 votes
0 answers
11 views

Rust stm32g4-hal crate rcc.cfgr unknown field

I am a rust newbie. I am trying to do some coding experiments on STM32G4 dev board . I want to set the system clock to 128Mhz and I have been using the code below . But the compiler is complaining ...
pranathi's user avatar
  • 393
0 votes
0 answers
30 views

Using an .a library to compile with "rustc" in Rust

Is there a way to compile a crate Rust and its dependencies into an .a (or .rlib) file that can then be used when compiling another .rs file with "rustc" ? For example, here is the Cargo....
John S's user avatar
  • 231
0 votes
2 answers
72 views

Rust dependency inconsistency: The versions on crates.io and GitHub match, but the code fails to compile

I have a dependency in cargo.toml.: alloy-dyn-abi = { version = "=0.8.22", default-features = false } Its cargo.lock is: name = "alloy-dyn-abi" version = "0.8.22" source ...
LEVI_104's user avatar
0 votes
0 answers
49 views

Error: `cargo metadata` exited with an error

I cloned a rust project that compiled rust-analyzer to wasm for use in a monaco editor in browser, I was able to run the project locally and the pkg directory was generated succesfully using wasm-pack ...
Abdulbasit Yusuf's user avatar
1 vote
1 answer
197 views

cargo build fails with "error: failed to build archive: no such file or directory" after adding any dependencies

I have a working Rust setup on Windows 11 and can run the hello world program with the PowerShell command line: PS C:\Users\Michael\Desktop\trying-cargo\%TEST> cargo new helloworld Creating ...
Michael's user avatar
  • 191
0 votes
2 answers
134 views

How to prepare a crate for cargo publish when it needs to be built with the nightly rust toolchain?

I have extracted some functionality into a crate that I think would also be useful to others, so i would like to publish it on crates.io. However, my code makes use of some features that are not in ...
lucidbrot's user avatar
  • 6,301
0 votes
1 answer
154 views

unresolved import rust in workspace with multiple crates [duplicate]

I have a workspace with 3 crates, game_nft, backend and tests. Here is my root Cargo.toml [workspace] members = ["backend", "game_nft", "tests"] resolver = "2" ...
IBeFrogs's user avatar
0 votes
0 answers
21 views

Loosen overly specific transitive dependency requirement in Cargo.toml [duplicate]

Consider the following dependency situation. My crate depends on two other crates, parser-foo and parser-bar, both of which depend on parser-core. The parser-core crate links to a native library, so ...
pintoch's user avatar
  • 2,488
0 votes
2 answers
124 views

Failed to resolve polars_core, arrow::legacy, Dataframe is polars-lazy = "0.44.2"

Despite the: reading of the polar_lazy 0.44.2 sucessful installation of cargo add polars-lazy the following code results in errors: error[E0433]: failed to resolve: could not find legacy in arrow ...
dark.vador's user avatar
0 votes
0 answers
21 views

How do I convert a virtual manifest into a package manifest? [duplicate]

This is almost a duplicate of existing questions about the error message below, but not quite. I have a Cargo.toml that contains the line: wgpu = "22.1" and everything works just fine. But ...
Frank Yellin's user avatar
  • 11.5k
3 votes
1 answer
170 views

Why should/shoudn't I use lib.rs in binary crates? [closed]

When I search the internet for design examples how to structure my code, I frequently find setups with main.rs only containing the main function and usages of lib, while lib.rs contains all the actual ...
Skru's user avatar
  • 125
1 vote
1 answer
49 views

Importing leading to Circular Modules Imports

My folder structure is: ├── Cargo.toml ├── program │ ├── Cargo.lock │ ├── Cargo.toml │ └── src │ ├── instruction.rs │ ├── lib.rs │ ├── mod.rs │ └── state.rs ├── program....
zubayr khalid's user avatar
2 votes
0 answers
155 views

How to install the CoinCbc library for Windows?

I would like to solve a mixed integer problem in Rust, using the good_lp crate. As a first step, I want the starting example to run: use std::error::Error; use good_lp::{constraint, default_solver, ...
Rust94's user avatar
  • 21
0 votes
0 answers
70 views

`cargo package` fails saying warning: no `Cargo.toml` file found when packaging

Here is the full output: PS C:\ox\ditrit\specimen\rust\writable> cargo package warning: no `Cargo.toml` file found when packaging `specimen__writable` (note the case of the file name). Packaging ...
Mathieu CAROFF's user avatar
-1 votes
1 answer
82 views

How to import functions from another file in Rust?

I have the following Rust project: ./ ├── Cargo.lock ├── Cargo.toml ├── src │   ├── Easy │   │   ├── 001_Two_Sum.rs │   │   ├── 083_Remove_Duplicates_from_Sorted_List.rs │   │   └── bin │   ├── lib.rs ...
Ουιλιαμ Αρκευα's user avatar

15 30 50 per page
1
2 3 4 5
16