]> git.lizzy.rs Git - rust.git/commitdiff
Markdown formatting for error explanations.
authorMichael Sproul <micsproul@gmail.com>
Mon, 11 May 2015 13:04:31 +0000 (23:04 +1000)
committerMichael Sproul <micsproul@gmail.com>
Mon, 11 May 2015 13:04:31 +0000 (23:04 +1000)
src/librustc/diagnostics.rs

index aaf615ee404095c07d84aae94d46fecd6299b65a..0f1e55544e1af5f5a02a158c2cbda5aa36ac6f4d 100644 (file)
@@ -745,6 +745,7 @@ fn baz() {
 
 For example:
 
+```
 let x: i32 = "I am not a number!";
 //     ~~~   ~~~~~~~~~~~~~~~~~~~~
 //      |             |
@@ -752,6 +753,7 @@ fn baz() {
 //      |    compiler infers type `&str`
 //      |
 //    type `i32` assigned to variable `x`
+```
 "##,
 
 E0309: r##"
@@ -760,6 +762,7 @@ fn baz() {
 must be as long as the data needs to be alive, and missing the constraint that
 denotes this will cause this error.
 
+```
 // This won't compile because T is not constrained, meaning the data
 // stored in it is not guaranteed to last as long as the reference
 struct Foo<'a, T> {
@@ -770,6 +773,7 @@ struct Foo<'a, T> {
 struct Foo<'a, T: 'a> {
     foo: &'a T
 }
+```
 "##,
 
 E0310: r##"
@@ -778,6 +782,7 @@ struct Foo<'a, T: 'a> {
 must be as long as the data needs to be alive, and missing the constraint that
 denotes this will cause this error.
 
+```
 // This won't compile because T is not constrained to the static lifetime
 // the reference needs
 struct Foo<T> {
@@ -788,6 +793,7 @@ struct Foo<T> {
 struct Foo<T: 'static> {
     foo: &'static T
 }
+```
 "##
 
 }