about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2015-07-03 15:40:42 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2015-07-04 18:34:44 +0200
commit18848ca7846fb6f72f6614fea4fd4a4565f8102a (patch)
tree53792a8939b4e74847ca94bf19c21ce2282302f4
parent0d1deb521c79207611f4a9b74811535150f4a031 (diff)
downloadrust-18848ca7846fb6f72f6614fea4fd4a4565f8102a.tar.gz
rust-18848ca7846fb6f72f6614fea4fd4a4565f8102a.zip
Add E0135 error explanation
-rw-r--r--src/librustc/diagnostics.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs
index eb504d03209..8b09161fd99 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
 "##,
 
+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