diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-07-03 15:43:14 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-07-04 18:34:59 +0200 |
| commit | d72c3076e1f5099923bdd54f6ab726d796cd8907 (patch) | |
| tree | 841d6016724c667ad8b44f756f612cbc8e063541 | |
| parent | 18848ca7846fb6f72f6614fea4fd4a4565f8102a (diff) | |
| download | rust-d72c3076e1f5099923bdd54f6ab726d796cd8907.tar.gz rust-d72c3076e1f5099923bdd54f6ab726d796cd8907.zip | |
Add E0134 error explanation
| -rw-r--r-- | src/librustc/diagnostics.rs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 8b09161fd99..d616b4f90b8 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -411,6 +411,24 @@ fn main() { See also https://doc.rust-lang.org/book/unsafe.html "##, +E0134: r##" +You tried to modify the str type, which isn't allowed. Erroneous code +example: + +``` +let s = "salut"; +let c = &mut s[0..1]; // error: modification of string types is not + // allowed +``` + +I you want to modify an str, please use the String type. Example: + +``` +let mut s = "salut"; +let mut c = s[0..1].to_owned(); // ok! +``` +"##, + E0135: r##" You tried to modify the str type, which isn't allowed. Erroneous code example: @@ -421,7 +439,7 @@ let c = &mut (*s)[0..1]; // error: modification of string types is not // allowed ``` -I you want to modify an str, please use the String type. Example: +If you want to modify an str, please use the String type. Example: ``` let mut s = "salut"; |
