6 comments

  • wrs8 hours ago
    My only complaint with this excellent list is that it treats &quot;generics&quot; and &quot;lifetimes&quot; as separate things. There&#x27;s a reason the lifetime is inside the generic brackets. The code is <i>generic over some lifetimes</i> just as it can be generic over some types.<p>As a Rust beginner I read lifetimes backwards, thinking &lt;&#x27;a&gt; means I&#x27;m &quot;declaring a lifetime&quot; which I then use. What that actually declares is a <i>placeholder</i> for a lifetime the compiler will attempt to find wherever that struct or function is used, just as it would attempt to find a valid type for a type generic &lt;T&gt; at the points of usage.<p>Once I fixed that misconception everything made much more sense. Reminding myself that <i>only the function signature matters</i>, not the actual code, was the other thing I needed to really internalize.<p>The compiler messages hinder this sometimes, as when the compiler says &quot;X doesn&#x27;t live long enough&quot; it actually means &quot;using my limited and ever-evolving ability to infer possible lifetimes from your code, I can&#x27;t find one that I can use here&quot;.<p>This is also (for me, anyway) a common &quot;it&#x27;s fine but it won&#x27;t compile&quot; case, where you don&#x27;t have <i>enough</i> lifetime parameters. In other words, you&#x27;re accidentally giving two things the same lifetime parameter when it&#x27;s not actually necessary to require that the compiler come up with a <i>single</i> lifetime that works for both. The compiler error for that does not typically lead you to a solution directly.
    • estebank8 hours ago
      If you have a good repro case, I&#x27;d appreciate a bug report. Bad diagnostics are considered bugs.
      • wrs6 hours ago
        It&#x27;s actually a classic and much-repeated case in Rust education:<p><pre><code> fn pick_first&lt;&#x27;a&gt;(x: &amp;&#x27;a str, y: &amp;&#x27;a str) -&gt; &amp;&#x27;a str { x &#x2F;&#x2F; We only actually return x, never y } fn main() { let s1 = String::from(&quot;long-lived&quot;); let result; { let s2 = String::from(&quot;short-lived&quot;); result = pick_first(&amp;s1, &amp;s2); } &#x2F;&#x2F; s2 dropped here println!(&quot;{}&quot;, result); } </code></pre> The error here is &quot;borrowed value [pointing to &amp;s2] does not live long enough&quot;. Of course it <i>does</i> live long enough, it&#x27;s just that the constraints in the function <i>signature</i> don&#x27;t say this usage is valid.<p>Thinking as a beginner, I think part of the problem here is the compiler is overstating its case. With experience, one learns to read this message as &quot;borrowed value could not be proved to live as long as required by the function declaration&quot;, but that&#x27;s not what it <i>says</i>! It asserts that the value in fact does not live long enough, which is clearly not true.<p>(Edit: having said this, I now realize the short version confuses beginners because of the definition of “enough”. They read it as “does not live long enough <i>to be safe</i>”, which the compiler is not—and cannot be—definitively saying.)<p>When this happens in a more complex situation (say, involving a deeper call tree and struct member lifetimes as well), you just get this same basic message, and finding the place where you&#x27;ve unnecessarily tied two lifetimes together can be a bit of a hunt.<p>My impression is that it&#x27;s difficult or impossible for the compiler to &quot;explain its reasoning&quot; in a more complex case (I made an example at [0] [1]), which is understandable, but it does mean you always get this bare assertion &quot;does not live long enough&quot; and have to work through the tree of definitions yourself to find the bad constraint.<p>[0] <a href="https:&#x2F;&#x2F;play.rust-lang.org&#x2F;?version=stable&amp;mode=debug&amp;edition=2024&amp;gist=bd5be9af6d58b1ae36efad68e99c31c3" rel="nofollow">https:&#x2F;&#x2F;play.rust-lang.org&#x2F;?version=stable&amp;mode=debug&amp;editio...</a><p>[1] <a href="https:&#x2F;&#x2F;play.rust-lang.org&#x2F;?version=stable&amp;mode=debug&amp;edition=2024&amp;gist=6ae902d81a05fa196f011912443a9c4f" rel="nofollow">https:&#x2F;&#x2F;play.rust-lang.org&#x2F;?version=stable&amp;mode=debug&amp;editio...</a>
    • penguin_booze5 hours ago
      I&#x27;m fairly out of touch with Rust. I think generics and lifetimes are also separate in the sense that only the generics get monomorphised, while lifetimes don&#x27;t. I.e., you get distinct structs Foo&lt;u32&gt; and Foo&lt;i32&gt;, depending on the (type) argument with which Foo was instantiated (just like it is in C++), but only one Bar&lt;&#x27;a&gt; no matter what (lifetime) argument it was &quot;instantiated&quot; with.
      • steveklabnik5 hours ago
        You&#x27;re slightly incorrect. Lifetimes do get &quot;monomorphized&quot; in the sense that you can have multiple concrete lifetimes be filled in for a given lifetime parameter (that&#x27;s why they&#x27;re called parameters) but also, lifetimes are fully erased far before you get to codegen monomorphization, which is what happens with generics.
  • nromiun16 hours ago
    &gt; It&#x27;s possible for a Rust program to be technically compilable but still semantically wrong.<p>This was my biggest problem when I used to write Rust. The article has a small example but when you start working on large codebases these problems pop up more frequently.<p>Everyone says the Rust compiler will save you from bugs like this but as the article shows you can compile bugs into your codebase and when you finally get an unrelated error you have to debug all the bugs in your code. Even the ones that were working previously.<p>&gt; Rust does not know more about the semantics of your program than you do<p>Also this. Some people absolutely refuse to believe it though.
    • MrJohz14 hours ago
      I think the key idea is that Rust gives you a lot of tools to encode semantics into your program. So you&#x27;ve got a much greater ability for the compiler to understand your semantics than in a language like JavaScript (say) where the compiler has very little way of knowing any information about lifetimes.<p>However, you&#x27;ve still got to do that job of encoding the semantics. Moreover, the default semantics may not necessarily be the semantics you are interested in. So you need to understand the default semantics enough to know when you need something different. This is the big disadvantage of lifetime elision: in most cases it works well, but it creates defaults that may not be what you&#x27;re after.<p>The other side is that sometimes the semantics you want to encode can&#x27;t be expressed in the type system, either because the type system explicitly disallows them, or because it doesn&#x27;t comprehend them. At this point you start running into issues like disjoint borrows, where you know two attributes in a struct can be borrowed independently, but it&#x27;s very difficult to express this to the compiler.<p>That said, I think Rust gives you more power to express semantics in the type system than a lot of other languages (particularly a lot of more mainstream languages) which I think is what gives rise to this idea that &quot;if it compiles, it works&quot;. The more you express, the more likely that statement is to be true, although the more you need to check that what you&#x27;ve expressed does match the semantics you&#x27;re aiming for.
    • LtdJorge16 hours ago
      Yes, that&#x27;s a very common misconception.<p>Of course, if your program compiles, that doesn&#x27;t mean the logic is correct. However, if your program compiles _and_ the logic is correct, there&#x27;s a high likelihood that your program won&#x27;t crash (provided you handle errors and such, you cannot trust data coming from outside, allocations to always work, etc). In Rust&#x27;s case, this means that the compiler is much more restrictive, exhaustive and pedantic than others like C&#x27;s and C++&#x27;s.<p>In those languages, correct logic and getting the program to compile doesn&#x27;t guarantee you are free from data races or segmentation faults.<p>Also, Rust&#x27;s type system being so strong, it allows you to encode so many invariants that it makes implementing the correct logic easier (although not simpler).
      • wakawaka2813 hours ago
        &gt;In those languages, correct logic and getting the program to compile doesn&#x27;t guarantee you are free from data races or segmentation faults.<p>I don&#x27;t believe that it&#x27;s guaranteed in Rust either, despite much marketing to the contrary. It just doesn&#x27;t sound appealing to say &quot;somewhat reduces many common problems&quot; lol<p>&gt;Also, Rust&#x27;s type system being so strong, it allows you to encode so many invariants that it makes implementing the correct logic easier (although not simpler).<p>C++ has a strong type system too, probably fancier than Rust&#x27;s or at least similar. Most people do not want to write complex type system constraints. I&#x27;m guessing that at most 25% of C++ codebases at most use complex templates with recursive templates, traits, concepts, `requires`, etc.
        • simonask10 hours ago
          Comparing type systems is difficult, but the general experience is that it is significantly easier to encode logic invariants in Rust than in C++.<p>Some of the things you <i>can</i> do, often with a wild amount of boilerplate (tagged unions, niches, etc.), and some of the things are fundamentally impossible (movable non-null owning references).<p>C++ templates are more powerful than Rust generics, but the available tools in Rust are more sophisticated.
          • sunshowers9 hours ago
            Note that while C++ templates are more powerful than Rust generics at being able to express different patterns of code, Rust generics are better at producing useful error messages. To me, personally, good error messages are the most fundamental part of a compiler frontend.
            • wakawaka288 hours ago
              Concepts make it possible to generate very clear (even user-friendly) template errors.
              • sunshowers8 hours ago
                True but you lose out on much of the functionality of templates, right? Also you only get errors when instantiating concretely, rather than getting errors within the template definition.
                • aw16211077 hours ago
                  &gt; but you lose out on much of the functionality of templates, right?<p>I don&#x27;t think so? From my understanding what you can do with concepts isn&#x27;t much different from what you can do with SFINAE. It (primarily?) just allows for friendlier diagnostics further up in the call chain.
                  • wakawaka285 hours ago
                    You&#x27;re right but concepts do more than SFINAE, and with much less code. Concept matching is also interesting. There is a notion of the most specific concept that matches a given instantiation. The most specific concept wins, of course.
                    • aw16211073 hours ago
                      Oh, interesting! I didn&#x27;t know about that particular feature of concepts. I&#x27;ll have to keep an eye out for potential places it can be used.
                • wakawaka285 hours ago
                  No, concepts interoperate with templates. I guess if you consider duck typing to be a feature, then using concepts can put constraints on that, but that is literally the purpose of them and nobody makes you use them.<p>If you aren&#x27;t instantiating a template, then it isn&#x27;t used, so who cares if it has theoretical errors to be figured out later? This behavior is in fact used to decide between alternative template specializations for the same template. Concepts do it better in some ways.
                  • aw16211071 hour ago
                    &gt; If you aren&#x27;t instantiating a template, then it isn&#x27;t used, so who cares if it has theoretical errors to be figured out later?<p>Just because <i>you</i> aren&#x27;t instantiating a template a particular way doesn&#x27;t necessarily mean <i>no one</i> is instantiating a template a particular way.<p>A big concern here would be accidentally depending on something that isn&#x27;t declared in the concept, which can result in a downstream consumer who otherwise satisfies the concept being unable to use the template. You also don&#x27;t get nicer error messages in these cases since as far as concepts are concerned nothing is wrong.<p>It&#x27;s a tradeoff, as usual. You get more flexibility but get fewer guarantees in return.
          • wakawaka288 hours ago
            I don&#x27;t agree that Rust tools are more sophisticated and they definitely are not more abundant. You just have a language that is more anal up front. C++ has many different compilers, analyzers, debuggers, linting tools, leak detectors, profilers, etc. It turns out that 40 years of use leads to significant development that is hard to rebuild from scratch.<p>I seem to have struck a nerve with my post, which got 4 downvotes so far. Just for saying Rust is not actually better than C++ in this one regard lol.
      • irishcoffee12 hours ago
        &gt; However, if your program compiles _and_ the logic is correct, there&#x27;s a high likelihood that your program won&#x27;t crash (provided you handle errors and such, you cannot trust data coming from outside, allocations to always work, etc).<p>That is one hell of a copium disclaimer. &quot;If you hold it right...&quot;
        • kibwen12 hours ago
          Rust certainly doesn&#x27;t make it impossible to write bad code. What it does do is nudge you towards writing good code to a noticeably appreciable degree, which is laudable compared to the state of the industry at large.
          • irishcoffee11 hours ago
            Rust is just a tool. It’s as fallible as any other tool. I wish we took it off the pedestal and treated it as such.
            • steveklabnik11 hours ago
              Are all tools equal in all dimensions or can they be compared for fitness of purpose?
            • estebank11 hours ago
              A hand saw, a table saw and a SawStop are all tools, but they have different characteristics even though they all are meant to cut the same wood.
              • irishcoffee11 hours ago
                Ada, C, and lisp are all tools, but they have different characteristics even though they are all meant to cut through the same problems.
                • yuriks10 hours ago
                  ...yes?
                  • irishcoffee10 hours ago
                    A tool is a tool. I didn’t realize I needed to spell it out.<p>Cloudflare used a tool, broke parts of the internet.
                    • bigstrat200310 hours ago
                      I feel like you&#x27;re attacking a strawman here. Of course you can write unreliable software in Rust. I&#x27;m not aware of anyone who says you can&#x27;t. The point is not that it&#x27;s a magic talisman that makes your software good, the point is that it helps you to make your software good in ways other languages (in particular C&#x2F;C++ which are the primary point of comparison for Rust) do not. That&#x27;s all.
                      • irishcoffee4 hours ago
                        &gt; The point is not that it&#x27;s a magic talisman that makes your software good, the point is that it helps you to make your software good in ways other languages (in particular C&#x2F;C++ which are the primary point of comparison for Rust) do not.<p>Citation needed.
    • treyd9 hours ago
      &gt; Some people absolutely refuse to believe it though.<p>Who says this? I&#x27;ve never seen someone argue it makes it impossible to write incorrect code. If that were the case then there&#x27;s no reason for it to have an integrated unit testing system. That would be an absurd statement to make, even if you can encode the entire program spec into the type system, there&#x27;s always the possibly the description of a solution is not aligned with the problem being solved.
    • alkonaut15 hours ago
      &quot;If it compiles it works&quot; isn&#x27;t true. But &quot;If it compiles it won&#x27;t eat your homework&quot; sort of is.
      • embedding-shape15 hours ago
        Neither are true, `std:fs::remove_dir_all(&quot;&#x2F;home&#x2F;user&#x2F;homework&quot;)` will happily compile and run, no matter if that&#x27;s what you wanted or not.<p>Rust programs can&#x27;t know what you want to do, period.
        • qouteall12 hours ago
          The better phrase is that &quot;if it compiles, then many possible Heisenbugs vanish&quot;<p><a href="https:&#x2F;&#x2F;qouteall.fun&#x2F;qouteall-blog&#x2F;2025&#x2F;How%20to%20Avoid%20Fighting%20Rust%20Borrow%20Checker#the-yields-of-paying-rust-cost" rel="nofollow">https:&#x2F;&#x2F;qouteall.fun&#x2F;qouteall-blog&#x2F;2025&#x2F;How%20to%20Avoid%20F...</a>
        • throwawayqqq1114 hours ago
          They certainly know that you dont want to process garbage data from freed memory.<p>Soundness does not cover semantic correctness. Maybe you want to wipe $HOME.
          • wakawaka2813 hours ago
            &gt;They certainly know that you dont want to process garbage data from freed memory.<p>It depends on what you mean by &quot;freed&quot;. Can one write a custom allocator in Rust? How does one handle reading from special addresses that represent hardware? In both of these scenarios, one might read from or write to memory that is not obviously allocated.
            • brooke2k1 hour ago
              You can indeed write custom allocators, and you can read to or write from special addresses. The former will usually, and the latter will always, require some use of `unsafe` in order to declare to the compiler: &quot;I have verified that the rules of ownership and borrowing are respected in this block of code&quot;.
            • ameliaquining11 hours ago
              Both of those things can be done in Rust, but not in <i>safe</i> Rust, you have to use unsafe APIs that don&#x27;t check lifetimes at compile time. <i>Safe</i> Rust assumes a clear distinction between memory allocations that are still live and those that have been deallocated, and that you never want to access the latter, which of course is true for most applications.
        • alkonaut11 hours ago
          &quot;If it compiles, then only logical bugs will make it eat your homework&quot;
    • littlestymaar16 hours ago
      I don&#x27;t think anyone believes the “if it compile it works” phrase literally.<p>It&#x27;s just that once it compiles Rust code will work more often than most languages, but that doesn&#x27;t mean Rust code will automatically be bug free and I don&#x27;t think anyone believes that.
      • emilbratt15 hours ago
        Yeah, even the official Rust book points it out and if my memory serves me right (not punintended) also gives an example in the form of creating a memory leak (not to be confused with memory unsafe).
        • spookie14 hours ago
          A memory leak can be unsafe though.
          • 20198412 hours ago
            Then why is Box::leak not marked unsafe?
          • estebank12 hours ago
            &quot;unsafe&quot; or `unsafe`? One is the general meaning of the word, the latter is &quot;it invokes undefined-behavior&quot;.
            • spookie10 hours ago
              As &quot;unsafe&quot;. An example would be of how AMD GPUs some time ago didn&#x27;t free a programs&#x27; last rendered buffers and you could see the literal last frame in its entirety. Fun stuff.<p>Could&#x27;ve been clearer above.
              • yuriks9 hours ago
                That is not a memory leak though! That&#x27;s using&#x2F;exposing an uninitialized buffer, which can happen even if you allocate and free your allocations correctly. Leaking the buffer would prevent the memory region from being allocated by another application, and would in fact prevent that from happening.<p>This is also something that Rust does protect against in safe code, by requiring initialization of all memory before use, or using MaybeUninit for buffers that aren&#x27;t, where reading the buffer or asserting that it has been initialized is an unsafe operation.
                • jmalicki4 hours ago
                  It&#x27;s a security hole. Rust doesn&#x27;t prevent you from writing unsafe code that reads it. The bug wasn&#x27;t that it could be read by a well conforming language, it was that it was handed off uninitialized to use space at all.
                • spookie9 hours ago
                  Fair, bad example.
      • embedding-shape15 hours ago
        There are definitively people in the ecosystem who peddle sentiments like &quot;Woah, Rust helps so much that I can basically think &#x27;if this compiles, everything will work&#x27;, and most of the times it does!&quot;, and that&#x27;s the confusing part for many people. Examples found in 30 seconds of searching:<p>- <a href="https:&#x2F;&#x2F;bsky.app&#x2F;profile&#x2F;codewright.bsky.social&#x2F;post&#x2F;3m4m5mvn6r22b" rel="nofollow">https:&#x2F;&#x2F;bsky.app&#x2F;profile&#x2F;codewright.bsky.social&#x2F;post&#x2F;3m4m5mv...</a><p>- <a href="https:&#x2F;&#x2F;bsky.app&#x2F;profile&#x2F;naps62.bsky.social&#x2F;post&#x2F;3lpopqwznfs2g" rel="nofollow">https:&#x2F;&#x2F;bsky.app&#x2F;profile&#x2F;naps62.bsky.social&#x2F;post&#x2F;3lpopqwznfs...</a>
        • muixoozie14 hours ago
          I read the comments you linked and don&#x27;t really think they literally believe Rust is magic. I dunno though I guess I could imagine a vibe coder tacitly believing that. Not saying you&#x27;re wrong. I just think most people say that tongue in cheek. This saying has been around forever in the Haskell community for decades. Feels like a long running joke at this point
          • binary13212 hours ago
            There is no hint of irony in the linked posts.
          • echelon11 hours ago
            Rust isn&#x27;t magic, but it has an incredibly low software defect rate. Google published a few studies on this.<p>If Rust code compiles, it probably has a lower defect rate than corresponding code written by the same team in another language, all else being equal.
        • kstrauser9 hours ago
          When I’ve said that, I’ve meant that almost the only remaining bugs were bad logic on my part. It’s free from the usual dumb mistakes I would make in other languages.
        • goku1213 hours ago
          Both examples you linked are people talking casually about the nature of Rust, rather than about the specific rule. That goes very much with your parent commenter&#x27;s assertion that nobody takes it <i>literally</i>. The first example even starts with &#x27;Most of the time&#x27; (this is true, though not guaranteed. I will explain further down). Human languages are imperfect and exaggerations and superlatives are common in casual communication.<p>But I have not seen any resource or anyone making technical points ever assert that the Rust compiler can verify program logic. That doesn&#x27;t even make sense - the compiler isn&#x27;t an AI that knows your intentions. Everybody is always clear that it only verifies memory safety.<p>Now regarding the &#x27;most of the time&#x27; part. The part below is based purely on my experience and your mileage may vary. It&#x27;s certainly possible to compile Rust programs with logical&#x2F;semantic errors. I have made plenty. But the nature of C&#x2F;C++ or similar manually memory-managed languages is such that you can make memory safety bugs quiet easily and miss them entirely. They also stay hidden longer.<p>And while logical errors are also possible, most people write and test code in chunks of sizes small enough where they feel confident enough to understand and analyze it entirely within their mind. Thus they tend to get caught and eliminated earlier than the memory safety bugs.<p>Now since Rust handles the memory safety bugs for you and you&#x27;re reasonably good at dealing with logical bugs, the final integrated code tends to be bug-free, surprisingly more often than in other languages - but not every time.<p>There is another effect that makes Rust programs <i>relatively</i> more bug-free. This time, It&#x27;s about the design of the code. Regular safe Rust, without any runtime features (like Rc, Arc, RefCell, Mutex, etc) is extremely restrictive in what designs it accepts. It accepts data structures that have a clear tree hierarchy, and thus a single-owner pattern. But once you get into stuff like cyclic references, mutual references, self references, etc, Rust will simply reject your code even if it can be proven to be correct at compile time. You have three options in that case: Use runtime safety checks (Rc, RefCell, Mutex, etc. This is slightly slower) OR use unsafe block and verify it manually, OR use a library that does the previous one for you.<p>Most of the code we write can be expressed in the restricted form that safe Rust allows without runtime checks. So whenever I face such issues, my immediate effort is to refactor the code in such way. I reach for the other three methods only if this is not possible - and that&#x27;s actually rare. The big advantage of this method is that such designs are relatively free of the vast number of logical bugs you can make with a non-tree&#x2F;cyclic ownership hierarchy. (Runtime checks convert memory safety bugs into logical bugs. If you make a mistake there, the program will panic at runtime.) Therefore, the refactored design ends up very elegant and bug-free much more often than in other languages.
        • spoiler14 hours ago
          I don&#x27;t know the authors of those posts, so I don&#x27;t want to put word in their mouth, but neither seem to be delusional about the &quot;if it compiles, it works&quot; phrase. The first one qualifies it with &quot;most of the time&quot;, and the second one explicitly mentions using type state as a tool to aid correctness...<p>But I don&#x27;t doubt there <i>are</i> people who take that phrase too literally, though.
        • littlestymaar14 hours ago
          &gt; &quot;Woah, Rust helps so much that I can basically think &#x27;if this compiles, everything will work&#x27;, and most of the times it does!&quot;<p>I think is is a fairly bad example to pick, because the fact that the person says “I can basically think” and “<i>most of the time</i> it does” (emphasis mine) shows that they don&#x27;t actually believes it will makes bug-free programs.<p>They are just saying that <i>“most of the time”</i> the compiler is very very helpful (I agree with them on that).
  • yuriks12 hours ago
    Needs a (2020) in the title. I don&#x27;t think anything major is outdated, but in particular in section 10, one of the desired syntaxes is now supported as an unstable feature but there wasn&#x27;t any mention of that:<p><pre><code> #![feature(closure_lifetime_binder)] fn main() { let identity = for&lt;&#x27;a&gt; |x: &amp;&#x27;a i32| -&gt; &amp;&#x27;a i32 { x }; }</code></pre>
  • bigstrat200310 hours ago
    I don&#x27;t see how it&#x27;s a misconception to say that a &#x27;static lifetime lives for the life of the program. The author says &quot;it can live arbitrarily long&quot;, which by definition must include... the life of the program. Where exactly is the error then?
    • oersted8 hours ago
      Because something with &#x27;static lifetime does not in fact live for the entire program.<p>It just means that it <i>could</i> live until the end of the program and that case should be considered when dealing with it, there&#x27;s no guarantee that it will drop earlier. But it may drop at any time, as long as there are no remaining references to it, it does not need to be in memory forever.<p>It&#x27;s a subtle distinction and it is easy to misinterpret. For instance Tokio tasks are &#x27;static and it felt wrong initially because I thought it would never drop them and leak memory. But it just means that it doesn&#x27;t know when they will be dropped and it cannot make any promises about it., that&#x27;s all.
    • jayd1610 hours ago
      &gt; Well yes, but a type with a &#x27;static lifetime is different from a type bounded by a &#x27;static lifetime. The latter can be dynamically allocated at run-time, can be safely and freely mutated, can be dropped, and can live for arbitrary durations.
    • yuriks9 hours ago
      A &#x27;static lifetime does not live for the rest of the program. It rather is guaranteed to live for as long as anyone is able to observe it. Data allocated in an Rc for example, lives as long as there are references to it. The ref count will keep it alive, but it will in fact still be deallocated once all references are gone (and it cannot be observed anymore).
    • enricozb10 hours ago
      I think if the compiler determines that it can drop a &#x27;static, because nothing uses it after a certain point, it may drop it.
      • k__9 hours ago
        How does this lead to confusion?
    • nickitolas8 hours ago
      &quot;life of the program&quot; might imply it needs to begin life at program start. But it can be allocated at runtime, like an example in the list shows. So its rather &quot;lives until the end of the program&quot;, but it doesnt need to start life at the start of the program
    • wrs8 hours ago
      &quot;Arbitrarily long&quot; means &quot;however long any code needs it to live&quot;, not &quot;whatever lifetime a human reading the code can conceive of&quot;.
  • qouteall12 hours ago
    I want to add Contagious Borrow Issue <a href="https:&#x2F;&#x2F;qouteall.fun&#x2F;qouteall-blog&#x2F;2025&#x2F;How%20to%20Avoid%20Fighting%20Rust%20Borrow%20Checker#contagious-borrow-issue" rel="nofollow">https:&#x2F;&#x2F;qouteall.fun&#x2F;qouteall-blog&#x2F;2025&#x2F;How%20to%20Avoid%20F...</a><p>Contagious borrow issue is a common problem for beginners.
  • hsywuwuf15 hours ago
    [flagged]
    • simonask15 hours ago
      FTA:<p>&gt; Others think someone from the Rust (programming language, not video game) development community was responsible due to how critical René has been of that project, but those claims are entirely unsubstantiated.<p>What is this culture war you&#x27;re fighting?
    • Tuna-Fish15 hours ago
      Rebe isn&#x27;t blaming this on rust proponents, but on a troll he banned 30 minutes before he got swatted. Where are you getting the rust connection from?