提交 d2552faa 编写于 作者: A Alex Crichton

rollup merge of #27665: frewsxcv/patch-25

They are currently rendered incorrectly

https://doc.rust-lang.org/error-index.html#E0067

https://doc.rust-lang.org/error-index.html#E0070
...@@ -642,6 +642,7 @@ enum variant, one of the fields was not provided. Each field should be ...@@ -642,6 +642,7 @@ enum variant, one of the fields was not provided. Each field should be
and field references. and field references.
Let's start with some bad examples: Let's start with some bad examples:
``` ```
use std::collections::LinkedList; use std::collections::LinkedList;
...@@ -653,8 +654,10 @@ enum variant, one of the fields was not provided. Each field should be ...@@ -653,8 +654,10 @@ enum variant, one of the fields was not provided. Each field should be
fn some_func(i: &mut i32) { fn some_func(i: &mut i32) {
i += 12; // Error : '+=' operation cannot be applied on a reference ! i += 12; // Error : '+=' operation cannot be applied on a reference !
} }
```
And now some good examples: And now some good examples:
``` ```
let mut i : i32 = 0; let mut i : i32 = 0;
...@@ -665,7 +668,6 @@ fn some_func(i: &mut i32) { ...@@ -665,7 +668,6 @@ fn some_func(i: &mut i32) {
fn some_func(i: &mut i32) { fn some_func(i: &mut i32) {
*i += 12; // Good ! *i += 12; // Good !
} }
``` ```
"##, "##,
...@@ -694,6 +696,7 @@ fn foo() -> u8 { ...@@ -694,6 +696,7 @@ fn foo() -> u8 {
https://doc.rust-lang.org/reference.html#lvalues,-rvalues-and-temporaries https://doc.rust-lang.org/reference.html#lvalues,-rvalues-and-temporaries
Now, we can go further. Here are some bad examples: Now, we can go further. Here are some bad examples:
``` ```
struct SomeStruct { struct SomeStruct {
x: i32, x: i32,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册