Top "Rust" questions

Rust is a systems programming language without a garbage collector focused on three goals: safety, speed, and concurrency.

How I can mutate a struct's field from a method?

I want to do this: struct Point { x: i32, y: i32, } impl Point { fn up(&self) { self.y += 1; } } fn …

rust mutable
Why does the Rust compiler not optimize code assuming that two mutable references cannot alias?

As far as I know, reference/pointer aliasing can hinder the compiler's ability to generate optimized code, since they must …

rust compiler-optimization llvm-codegen
How to get a slice as an array in Rust?

I have an array of an unknown size, and I would like to get a slice of that array and …

arrays rust
Rust can't find crate

I'm trying to create a module in Rust and then use it from a different file. This is my file …

rust rust-crates
Default function arguments in Rust

Is it possible in Rust to create a function with a default argument? fn add(a: int = 1, b: int = 2) { a + …

function parameters arguments rust
How to switch between Rust toolchains?

rustup help toolchain lists the following sub-commands SUBCOMMANDS: list List installed toolchains install Install or update a given toolchain uninstall …

rust rustup
How to sort a vector in Rust?

What is the currently recommended method for sorting values in a vector?

rust
How to idiomatically copy a slice?

In Go, copying slices is standard-fare and looks like this: # It will figure out the details to match slice sizes …

rust slice
Why are Rust executables so huge?

Just having found Rust and having read the first two chapters of the documentation, I find the approach and the …

rust rust-cargo
Step by step interactive debugger for Rust?

How can I debug Rust application step by step interactively like I'm able to do with "pry" in Ruby? I …

debugging rust