]> git.lizzy.rs Git - rust.git/commitdiff
Update diagnostics.rs
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Tue, 21 Apr 2015 09:51:49 +0000 (11:51 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 23 Apr 2015 16:43:58 +0000 (18:43 +0200)
src/librustc/diagnostics.rs

index 055129b35df9eb58a876a30aec490ce23f707f41..73abac5abbb167199b1fa8c2836378c11d7bbb23 100644 (file)
@@ -187,8 +187,10 @@ struct X { x: (), }
 You can build a free-standing crate by adding `#![no_std]` to the crate
 attributes:
 
+```
 #![feature(no_std)]
 #![no_std]
+```
 
 See also https://doc.rust-lang.org/book/no-stdlib.html
 "##,
@@ -204,11 +206,13 @@ struct X { x: (), }
 
 If you want to match against a `static`, consider using a guard instead:
 
+```
 static FORTY_TWO: i32 = 42;
 match Some(42) {
     Some(x) if x == FORTY_TWO => ...
     ...
 }
+```
 "##,
 
 E0161: r##"
@@ -265,17 +269,21 @@ struct X { x: (), }
 E0170: r##"
 Enum variants are qualified by default. For example, given this type:
 
+```
 enum Method {
     GET,
     POST
 }
+```
 
 you would match it using:
 
+```
 match m {
     Method::GET => ...
     Method::POST => ...
 }
+```
 
 If you don't qualify the names, the code will bind new variables named "GET" and
 "POST" instead. This behavior is likely not what you want, so rustc warns when
@@ -284,8 +292,10 @@ enum Method {
 Qualified names are good practice, and most code works well with them. But if
 you prefer them unqualified, you can import the variants into scope:
 
+```
 use Method::*;
 enum Method { GET, POST }
+```
 "##,
 
 E0267: r##"
@@ -305,7 +315,9 @@ enum Method { GET, POST }
 This error indicates that the given recursion limit could not be parsed. Ensure
 that the value provided is a positive integer between quotes, like so:
 
+```
 #![recursion_limit="1000"]
+```
 "##,
 
 E0297: r##"