From 00a246e77b8cf8fd84812844de7bca78f220b2c5 Mon Sep 17 00:00:00 2001 From: Antonio Ognio Date: Fri, 15 May 2015 17:12:45 -0500 Subject: Updating rust.html.markdown for Rust 1.0 --- rust.html.markdown | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index dcb54733..17f7dc90 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -6,14 +6,21 @@ filename: learnrust.rs --- Rust is an in-development programming language developed by Mozilla Research. -It is relatively unique among systems languages in that it can assert memory -safety *at compile time* without resorting to garbage collection. Rust’s first -release, 0.1, occurred in January 2012, and development moves so quickly that at -the moment the use of stable releases is discouraged, and instead one should use -nightly builds. On January 9 2015, Rust 1.0 Alpha was released, and the rate of -changes to the Rust compiler that break existing code has dropped significantly -since. However, a complete guarantee of backward compatibility will not exist -until the final 1.0 release. +Rust combines low-level control over performance with high-level convenience and +safety guarantees. + +It achieves these goals without requiring a garbage collector or runtime, making +it possible to use Rust libraries as a "drop-in replacement" for C. + +Rust’s first release, 0.1, occurred in January 2012, and for 3 years development +moved so quickly that until recently the use of stable releases was discouraged +and instead the general advise was to use nightly builds. + +On May 15th 2015, Rust 1.0 was released with a complete guarantee of backward +compatibility. Improvements to compile times and other aspects of the compiler are +currently available in the nightly builds. Rust has adopted a train-based release +model with regular releases every six weeks. Rust 1.1 beta was made available at +the same time of the release of Rust 1.0. Although Rust is a relatively low-level language, Rust has some functional concepts that are generally found in higher-level languages. This makes -- cgit v1.2.3 From 337710e13d726b91fd6cdde9e58d8c0db24c73f0 Mon Sep 17 00:00:00 2001 From: Jingwen Date: Sat, 13 Jun 2015 17:27:05 +0800 Subject: Fixed typo: changing an immutable ref will not compile --- rust.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 17f7dc90..49303b0d 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -281,7 +281,7 @@ fn main() { println!("{}", var); // Unlike `box`, `var` can still be used println!("{}", *ref_var); // var = 5; // this would not compile because `var` is borrowed - // *ref_var = 6; // this would too, because `ref_var` is an immutable reference + // *ref_var = 6; // this would not too, because `ref_var` is an immutable reference // Mutable reference // While a value is mutably borrowed, it cannot be accessed at all. -- cgit v1.2.3 From ad344ac7c68ecbfa55f5d7d50bc8b3e7c162f14b Mon Sep 17 00:00:00 2001 From: Esption Date: Wed, 17 Jun 2015 18:35:32 -0500 Subject: Rust: Change '&*' to '&' --- rust.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 17f7dc90..fbfa4cdf 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -84,7 +84,7 @@ fn main() { // This is basically an immutable pointer to a string – it doesn’t // actually contain the contents of a string, just a pointer to // something that does (in this case, `s`) - let s_slice: &str = &*s; + let s_slice: &str = &s; println!("{} {}", s, s_slice); // hello world hello world @@ -99,7 +99,7 @@ fn main() { // A slice – an immutable view into a vector or array // This is much like a string slice, but for vectors - let slice: &[i32] = &*vector; + let slice: &[i32] = &vector; // Use `{:?}` to print something debug-style println!("{:?} {:?}", vector, slice); // [1, 2, 3, 4, 5] [1, 2, 3, 4, 5] -- cgit v1.2.3 From 8d22be8f85339a73f4dcf09be4feefe1be9156b9 Mon Sep 17 00:00:00 2001 From: Michael Simpson Date: Mon, 22 Jun 2015 16:03:24 -0400 Subject: Remove in-development from Rust's description Now that Rust is stable at 1.0 saying "in-development" might not be appropriate any more. --- rust.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index fbfa4cdf..dd03acdd 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -5,7 +5,7 @@ contributors: filename: learnrust.rs --- -Rust is an in-development programming language developed by Mozilla Research. +Rust is a programming language developed by Mozilla Research. Rust combines low-level control over performance with high-level convenience and safety guarantees. -- cgit v1.2.3 From 5e11d06a4f131302956334e76c989fb935ad9709 Mon Sep 17 00:00:00 2001 From: Tim Heaney Date: Mon, 5 Oct 2015 22:19:59 -0400 Subject: Typo: should be advice, not advise. --- rust.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 4fbd6144..3157fcf4 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -14,7 +14,7 @@ it possible to use Rust libraries as a "drop-in replacement" for C. Rust’s first release, 0.1, occurred in January 2012, and for 3 years development moved so quickly that until recently the use of stable releases was discouraged -and instead the general advise was to use nightly builds. +and instead the general advice was to use nightly builds. On May 15th 2015, Rust 1.0 was released with a complete guarantee of backward compatibility. Improvements to compile times and other aspects of the compiler are -- cgit v1.2.3 From 960ee4a1856db8eadb96277bb2422edfa8f2a81c Mon Sep 17 00:00:00 2001 From: Gabriel Halley Date: Wed, 7 Oct 2015 23:11:24 -0400 Subject: removing whitespace all over --- rust.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 3157fcf4..b2854b0c 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -6,20 +6,20 @@ filename: learnrust.rs --- Rust is a programming language developed by Mozilla Research. -Rust combines low-level control over performance with high-level convenience and -safety guarantees. +Rust combines low-level control over performance with high-level convenience and +safety guarantees. -It achieves these goals without requiring a garbage collector or runtime, making +It achieves these goals without requiring a garbage collector or runtime, making it possible to use Rust libraries as a "drop-in replacement" for C. -Rust’s first release, 0.1, occurred in January 2012, and for 3 years development +Rust’s first release, 0.1, occurred in January 2012, and for 3 years development moved so quickly that until recently the use of stable releases was discouraged -and instead the general advice was to use nightly builds. +and instead the general advice was to use nightly builds. -On May 15th 2015, Rust 1.0 was released with a complete guarantee of backward +On May 15th 2015, Rust 1.0 was released with a complete guarantee of backward compatibility. Improvements to compile times and other aspects of the compiler are currently available in the nightly builds. Rust has adopted a train-based release -model with regular releases every six weeks. Rust 1.1 beta was made available at +model with regular releases every six weeks. Rust 1.1 beta was made available at the same time of the release of Rust 1.0. Although Rust is a relatively low-level language, Rust has some functional -- cgit v1.2.3 From 2b8fe51af6d03cbae2f5139b368006c80c9ff544 Mon Sep 17 00:00:00 2001 From: Pushkar Sharma Date: Sun, 11 Oct 2015 09:39:39 +0530 Subject: Mention meaning of asterisk. Explain *ref_var2 Issue #1398 --- rust.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index b2854b0c..d0c56b4a 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -287,9 +287,9 @@ fn main() { // While a value is mutably borrowed, it cannot be accessed at all. let mut var2 = 4; let ref_var2: &mut i32 = &mut var2; - *ref_var2 += 2; + *ref_var2 += 2; // '*' is used to point to the mutably borrowed var2 - println!("{}", *ref_var2); // 6 + println!("{}", *ref_var2); // 6 , //var2 would not compile. //ref_var2 is of type &mut i32, so //stores a reference to an i32 not the value. // var2 = 2; // this would not compile because `var2` is borrowed } ``` -- cgit v1.2.3 From 08c653ad62e0e21cf7873aa6a8e5195d25f15240 Mon Sep 17 00:00:00 2001 From: Carlo Milanesi Date: Sat, 28 May 2016 15:22:22 +0200 Subject: Corrected definition of "slice" concept --- rust.html.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index d0c56b4a..f82f7785 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -81,9 +81,10 @@ fn main() { let s: String = "hello world".to_string(); // A string slice – an immutable view into another string - // This is basically an immutable pointer to a string – it doesn’t + // This is basically an immutable pair of pointers to a string – it doesn’t // actually contain the contents of a string, just a pointer to - // something that does (in this case, `s`) + // the begin and a pointer to the end of a string buffer, + // statically allocated or contained in another object (in this case, `s`) let s_slice: &str = &s; println!("{} {}", s, s_slice); // hello world hello world -- cgit v1.2.3 From a7015a0f8592d49f62bbafae1dcffcf1619ec92d Mon Sep 17 00:00:00 2001 From: Adam Heins Date: Sun, 26 Jun 2016 06:21:27 -0700 Subject: Minor formatting and wording change in rust doc. (#2277) --- rust.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index d0c56b4a..440cd9eb 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -281,7 +281,7 @@ fn main() { println!("{}", var); // Unlike `box`, `var` can still be used println!("{}", *ref_var); // var = 5; // this would not compile because `var` is borrowed - // *ref_var = 6; // this would not too, because `ref_var` is an immutable reference + // *ref_var = 6; // this would not either, because `ref_var` is an immutable reference // Mutable reference // While a value is mutably borrowed, it cannot be accessed at all. @@ -289,8 +289,9 @@ fn main() { let ref_var2: &mut i32 = &mut var2; *ref_var2 += 2; // '*' is used to point to the mutably borrowed var2 - println!("{}", *ref_var2); // 6 , //var2 would not compile. //ref_var2 is of type &mut i32, so //stores a reference to an i32 not the value. - // var2 = 2; // this would not compile because `var2` is borrowed + println!("{}", *ref_var2); // 6 , // var2 would not compile. + // ref_var2 is of type &mut i32, so stores a reference to an i32, not the value. + // var2 = 2; // this would not compile because `var2` is borrowed. } ``` -- cgit v1.2.3 From 5d39704b57bc3e163df6f9ac510ea7e56439db0e Mon Sep 17 00:00:00 2001 From: Kyle Mendes Date: Sun, 26 Jun 2016 15:46:16 -0400 Subject: [rust/en] Updating comment examples (#1883) --- rust.html.markdown | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index 440cd9eb..cce91683 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -2,6 +2,7 @@ language: rust contributors: - ["P1start", "http://p1start.github.io/"] + - ["Pink401k", "http://github.com/Pink401k"] filename: learnrust.rs --- @@ -27,8 +28,15 @@ concepts that are generally found in higher-level languages. This makes Rust not only fast, but also easy and efficient to code in. ```rust -// This is a comment. Single-line look like this... -/* ...and multi-line comment look like this */ +// This is a comment. Line comments look like this... +// and extend multiple lines like this. + +/// Documentation comments look like this and support markdown notation. +/// # Examples +/// +/// ``` +/// let five = 5 +/// ``` /////////////// // 1. Basics // -- cgit v1.2.3 From 5977df5be45c0f3468abf402921cf925c996a472 Mon Sep 17 00:00:00 2001 From: ven Date: Sun, 26 Jun 2016 21:46:57 +0200 Subject: Update rust.html.markdown --- rust.html.markdown | 1 - 1 file changed, 1 deletion(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index cce91683..4aa9ca7c 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -2,7 +2,6 @@ language: rust contributors: - ["P1start", "http://p1start.github.io/"] - - ["Pink401k", "http://github.com/Pink401k"] filename: learnrust.rs --- -- cgit v1.2.3 From 970aff0dadeeed4362881f8088e81f4d703000a7 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Tue, 27 Sep 2016 16:42:40 +0200 Subject: Fix comment in Rust docs: box -> mine (#2365) The "box" is referring to the Box variable a few lines back, but that is called "mine", not "box". --- rust.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust.html.markdown') diff --git a/rust.html.markdown b/rust.html.markdown index f1b62ef4..6b75fa87 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -286,7 +286,7 @@ fn main() { var = 3; let ref_var: &i32 = &var; - println!("{}", var); // Unlike `box`, `var` can still be used + println!("{}", var); // Unlike `mine`, `var` can still be used println!("{}", *ref_var); // var = 5; // this would not compile because `var` is borrowed // *ref_var = 6; // this would not either, because `ref_var` is an immutable reference -- cgit v1.2.3