I am a newbie to rust. From random searches I found that ownership, borrowing and reference are the USP of rust. I was trying to read about them from here and this one. It is interesting that the link provided in 1 actually compiles and runs. The only difference is that the version of rust compiler in my local machine is 1.60. So my question is, is it an upgrade to the borrower checker for which this code works. Is there any misunderstanding in my comprehension of the link provided in 1.
Asked
Active
Viewed 27 times
-2
-
4[Do not post text as images](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors-when-asking-a-question). – Chayim Friedman May 22 '22 at 08:14
-
2Yes, it is an upgrade called NLL (non lexical lifetimes), and this is a duplicate. Give me a moment to find it out... – Chayim Friedman May 22 '22 at 08:15
-
1Next time, instead of an image just put a text. If you want to show us that a code compiles, you can just say that. We will believe, I promise. And we can always test it ourselves, and ask for more information (e.g. Rust version) if we can't reproduce. You can even put a link to the [playground](https://play.rust-lang.org/): this is also good because it proves to yourself and to us that you indeed created a minimal reproducible example. – Chayim Friedman May 22 '22 at 10:01
-
1Don't get me wrong: there are cases where it's valid to post an image. That is why the option is there. When the information will only be passed only as an image (for example, asking for clarification on some IDE behavior), putting an image is exactly what you should do. It is just that if text is enough, use it (for the various reasons stated in the question I linked above). If in doubt, you can always put both. – Chayim Friedman May 22 '22 at 10:03