]> git.lizzy.rs Git - rust.git/commitdiff
Add E0135 error explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 3 Jul 2015 13:40:42 +0000 (15:40 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 4 Jul 2015 16:34:44 +0000 (18:34 +0200)
src/librustc/diagnostics.rs

index eb504d03209f60216eb5ddcaf9be322aae916dd6..8b09161fd99761ef488f4cfeacb3ba572192a964 100644 (file)
@@ -411,6 +411,24 @@ fn main() {
 See also https://doc.rust-lang.org/book/unsafe.html
 "##,
 
+E0135: 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!
+```
+"##,
+
 E0137: r##"
 This error indicates that the compiler found multiple functions with the
 `#[main]` attribute. This is an error because there must be a unique entry