]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #26133 - steveklabnik:gh25573, r=alexcrichton
authorSteve Klabnik <steve@steveklabnik.com>
Tue, 9 Jun 2015 21:24:44 +0000 (17:24 -0400)
committerSteve Klabnik <steve@steveklabnik.com>
Tue, 9 Jun 2015 21:24:44 +0000 (17:24 -0400)
This obscures more than it helps.

Fixes #25573

mk/cfg/x86_64-pc-windows-msvc.mk
src/doc/reference.md
src/doc/trpl/patterns.md
src/doc/trpl/references-and-borrowing.md
src/librustc/middle/traits/README.md
src/libstd/sys/common/backtrace.rs

index 1e1906a298084dce9f7efc0690efb37ace352903..c718c19d366cea67f4a37f4894b1f492f18e9659 100644 (file)
@@ -9,8 +9,8 @@ CFG_STATIC_LIB_NAME_x86_64-pc-windows-msvc=$(1).lib
 CFG_LIB_GLOB_x86_64-pc-windows-msvc=$(1)-*.dll
 CFG_LIB_DSYM_GLOB_x86_64-pc-windows-msvc=$(1)-*.dylib.dSYM
 CFG_JEMALLOC_CFLAGS_x86_64-pc-windows-msvc :=
-CFG_GCCISH_CFLAGS_x86_64-pc-windows-msvc :=
-CFG_GCCISH_CXXFLAGS_x86_64-pc-windows-msvc :=
+CFG_GCCISH_CFLAGS_x86_64-pc-windows-msvc := -MD
+CFG_GCCISH_CXXFLAGS_x86_64-pc-windows-msvc := -MD
 CFG_GCCISH_LINK_FLAGS_x86_64-pc-windows-msvc :=
 CFG_GCCISH_DEF_FLAG_x86_64-pc-windows-msvc :=
 CFG_LLC_FLAGS_x86_64-pc-windows-msvc :=
index 875a65e69fa9ff993e670e9e25a3bb51ec48df7b..8d57238dc175d4c99d63449e2c00e93d9df5e83d 100644 (file)
@@ -1367,7 +1367,6 @@ Traits can include default implementations of methods, as in:
 ```
 trait Foo {
     fn bar(&self);
-
     fn baz(&self) { println!("We called baz."); }
 }
 ```
index 93df0f19e8eeb087283649842bcb5f64273c3247..0f356d75abc86d45fa7f67db1966c5c4a3499bba 100644 (file)
@@ -154,6 +154,31 @@ match x {
 
 This prints `Got an int!`.
 
+If you’re using `if` with multiple patterns, the `if` applies to both sides:
+
+```rust
+let x = 4;
+let y = false;
+
+match x {
+    4 | 5 if y => println!("yes"),
+    _ => println!("no"),
+}
+```
+
+This prints `no`, because the `if` applies to the whole of `4 | 5`, and not to
+just the `5`, In other words, the the precedence of `if` behaves like this:
+
+```text
+(4 | 5) if y => ...
+```
+
+not this:
+
+```text
+4 | (5 if y) => ...
+```
+
 # ref and ref mut
 
 If you want to get a [reference][ref], use the `ref` keyword:
index 775a6fbd293589337529cad99097d18e00bd2b7f..b27db2ab7bea8c0ac120f59b9d3540ee05269159 100644 (file)
@@ -151,9 +151,9 @@ As it turns out, there are rules.
 
 Here’s the rules about borrowing in Rust:
 
-First, any borrow must last for a smaller scope than the owner. Second, you may
-have one or the other of these two kinds of borrows, but not both at the same
-time:
+First, any borrow must last for a scope no greater than that of the owner.
+Second, you may have one or the other of these two kinds of borrows, but not
+both at the same time:
 
 * one or more references (`&T`) to a resource.
 * exactly one mutable reference (`&mut T`)
index 9c47d7f217aac183d663e3bc3b65b86aa740bc22..853d12172af5ef67010e6db28f4f987958d099c0 100644 (file)
@@ -120,7 +120,7 @@ implement `Convert` like so:
 
 ```rust
 impl Convert<uint> for int { ... } // int -> uint
-impl Convert<int> for uint { ... } // uint -> uint
+impl Convert<int> for uint { ... } // uint -> int
 ```
 
 Now imagine there is some code like the following:
index 580d970af0c3da3d77a1a484da9c7497ea085e93..00932712a07a436c2526c75ced2ea6931944054c 100644 (file)
@@ -27,7 +27,7 @@
 // 2. For each element of the path, emit the length plus the element
 // 3. End the path with "E"
 //
-// For example, "_ZN4testE" => "test" and "_ZN3foo3bar" => "foo::bar".
+// For example, "_ZN4testE" => "test" and "_ZN3foo3barE" => "foo::bar".
 //
 // We're the ones printing our backtraces, so we can't rely on anything else to
 // demangle our symbols. It's *much* nicer to look at demangled symbols, so