about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2015-04-21 11:51:49 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2015-04-23 18:43:58 +0200
commit2ddc8f5eb53a1966f17991a3920295e080b09097 (patch)
treef3053e82256ebe0ad6f08204608707bfece13a0e
parent1d7d0192d264aa03358fab1d683b984ed6eef2d7 (diff)
downloadrust-2ddc8f5eb53a1966f17991a3920295e080b09097.tar.gz
rust-2ddc8f5eb53a1966f17991a3920295e080b09097.zip
Update diagnostics.rs
-rw-r--r--src/librustc/diagnostics.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs
index 055129b35df..73abac5abbb 100644
--- a/src/librustc/diagnostics.rs
+++ b/src/librustc/diagnostics.rs
@@ -187,8 +187,10 @@ them yourself.
 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 @@ mutex can be declared `static` as well.
 
 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 @@ loop {
 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 @@ that happens.
 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 @@ E0296: r##"
 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##"