rust-obsolete Questions

3

Solved

The tutorial shows some very basic examples of pattern matching, such as matching over an integer to emulate a c-style switch statement. The tutorial also shows how to do basic destructuring over a...
Macfarlane asked 14/2, 2012 at 19:16

4

Editor's note: This question predates Rust 0.1 (tagged 2013-07-03) and is not syntactically valid Rust 1.0 code. Answers may still contain valuable information. Does anyone know how to create mut...
Citizenship asked 27/10, 2012 at 18:9

4

Solved

What does TypeState refer to in respect to language design? I saw it mentioned in some discussions regarding a new language by mozilla called Rust.
Disembroil asked 9/7, 2010 at 5:22

4

Solved

Editor's note: This code example is from a version of Rust prior to 1.0 and is not syntactically valid Rust 1.0 code. Updated versions of this code produce different errors, but the answers still...
Fanfaron asked 30/10, 2013 at 0:47

3

Solved

This question pertains to a pre-release version of Rust. This younger question is similar. I tried to print one symbol with println: fn main() { println!('c'); } But I got next error: $ rustc ...
Psychophysiology asked 28/4, 2013 at 20:38

2

Solved

I have the following code: pub mod a { #[test] pub fn test() { println!("{:?}", std::fs::remove_file("Somefilehere")); } } I get errors when I compile this: error[E0433]: failed to resolve....
Foulmouthed asked 2/5, 2014 at 18:9

4

Solved

Editor's note: This code example is from a version of Rust prior to 1.0 and is not syntactically valid Rust 1.0 code. Is it possible to share a mutable variable between multiple threads in Rust? G...
Brickwork asked 26/7, 2013 at 17:2

3

Solved

I can see I have to import like this: use std::io::IoResult; use std::num::{Int, ToPrimitive}; use std::rand::{OsRng, Rng}; Then make a new instance of OsRng, and try to generate a new u32 int f...
Lagging asked 8/12, 2014 at 16:35

3

Solved

Are there any socket or net libraries for Rust? The net page in the standard library documentation seems to only include address-related functions.
Remsen asked 24/1, 2012 at 9:1

2

Editor's note: The code in this question predates Rust 1.0. The equivalent modern version of this code compiles as-is. I'm still taking baby steps at learning Rust, and was surprised at the fol...
Anallise asked 3/5, 2014 at 5:48

2

Solved

Editor's note: The code presented in the question compiles as-is in Rust 1.0. I've tried: trait Inner {} struct Outer<'a> { inner: &'a Inner, } but the compiler complains: Comp...
Rodin asked 14/10, 2014 at 15:14

4

Solved

Editor's note: This code example is from a version of Rust prior to 1.0 and is not syntactically valid Rust 1.0 code. Updated versions of this code produce different errors, but the answers still...
Typography asked 20/5, 2013 at 10:0

3

Solved

Note that this question refers to a version of Rust before Rust 1.0. Although the syntax has changed, the concepts are still valid. You can easily implement a forwards only linked list using ow...
Handmade asked 8/3, 2014 at 11:43

2

Solved

With today's Rust nightly the following code doesn't compile anymore: #[derive(Show)] enum S { A, B } fn main() { println!("{}", S::A); } Instead it gives me the following error message: er...
Jagannath asked 10/1, 2015 at 10:7

1

Solved

Can somebody help me to rewrite this piece of code with new unboxed closures: struct Builder; pub fn build(rules: |params: &mut Builder|) -> Builder { let mut builder = Builder::new(); ru...
Hodgkins asked 7/1, 2015 at 8:35

2

Solved

When I run the following code, I get some output: use std::thread::Thread; static DELAY: i64 = 1000; fn main() { Thread::spawn(move || { println!("some output"); }); std::io::timer::sleep(s...
Cingulum asked 6/1, 2015 at 17:0

2

Solved

Editor's note: This code no longer produces the same error after RFC 599 was implemented, but the concepts discussed in the answers are still valid. I'm trying to compile this code: trait A { ...
Bristol asked 21/9, 2014 at 12:16

1

Note: This question is obsolete since Rust 1.0. The Iterator trait now has an associated type, Item, instead of a type parameter and a blanket Iterator implementation was added for Box<Iterato...
Dvinsk asked 21/8, 2014 at 21:37

2

Solved

I'm wondering what the difference is between: "some string".to_string() And "some string".into_string() The former seems to come from ToString, which is quite clear. However, the latter seem...
Jezabella asked 14/8, 2014 at 19:28

1

Solved

I am trying to collect into an vec of strings in rust using the following: let fields : ~[~str] = row.split_str(",").collect(); I get the following error: expected std::iter::FromIterator<&am...
Davies asked 11/7, 2014 at 3:7

1

Solved

Editor's note: This question was asked before Rust 1.0 and before certain features were implemented. The code as-is works today. I'm writing a board game AI in Rust. There are multiple rulesets...
Pericynthion asked 23/6, 2014 at 10:12

1

Solved

I have been using 0.10 and recently setup a build of nightly to experiment with Box and friends. Now I have code for 0.10 using ~str and code for pre0.11 using String because of to_owned being obs...
Laryssa asked 19/6, 2014 at 0:50

1

Solved

Editor's note: This question was asked before Rust 1.0 and uses syntax which is no longer valid. Additionally, the specific problem in this question no longer occurs in Rust 1.0. There is a str...
Carrycarryall asked 18/4, 2014 at 6:34

1

Editor's note: This code example is from a version of Rust prior to 1.0 and is not syntactically valid Rust 1.0 code. Updated versions of this code produce different errors, but the answers still...
Hardspun asked 27/1, 2014 at 19:25

1

Solved

Note that this question pertains to a version of Rust before 1.0 was released Do I understand correctly that it is now impossible to return a closure from a function, unless it was provided to ...
Killebrew asked 15/1, 2014 at 6:10

© 2022 - 2025 — McMap. All rights reserved.