chiark / gitweb /
wip
[talk-2019-ghm-rust.git] / dangling.txt
index e4b884cecbc1075dffe847eb49e1568007e70b98..b27b01a491263cd26015be8ecb8777a5690d7990 100644 (file)
@@ -6,14 +6,3 @@ fn dangle() -> &String {
     let s = String::from("hello");
     &s
 }
-
-
-error[E0106]: missing lifetime specifier
- --> main.rs:5:16
-  |
-5 | fn dangle() -> &String {
-  |                ^ expected lifetime parameter
-  |
-  = help: this function's return type contains a borrowed
-    value, but there is no value for it to be borrowed from
-  = help: consider giving it a 'static lifetime