Live data from Hacker News

Announcing Rust 1.27.2

blog.rust-lang.org

31–34 of 34 posts

Re: Announcing Rust 1.27.2

#31

The bug being fixed was that you could use `match` to return a borrowed object with a new lifetime? Am I interpreting this correctly? You should never be able to do this, right?

Yes, you should never be able to do this, thus it is a bug. The bug, at least as it appears in the example presented in the blog post, allows you to obtain a reference to a member of a tuple that will outlive the tuple itself.

Re: Announcing Rust 1.27.2

#32
post #25
post #16

To reiterate what the OP suggests at the bottom, the new (in-progress) borrow checker (the one designed from the ground-up to support non-lexical lifetimes (NLL)) suffers from none of the match bugs that have inspired the recent slew of patch releases. It does indeed appear as though the new match features were designed with the theoretical model of the borrow checker in mind, to which the new borrow checker hews muc…

I was under the impression that the upcoming, shiny, great borrow checker is a tad slow, pathologically so in some cases. https://github.com/rust-lang-nursery/polonius But I do love the way they're tackling the issue know, as this is a much more generic solution.

Polonius is NLLv2. It is not being stabilized for now.

http://smallcultfollowing.com/babysteps/blog/2018/06/15/mir-...

Re: Announcing Rust 1.27.2

#33
Despite these bugs, I still feel confident in Rust's ability to provide strong memory-safety guarantees. Two reasons:

1. The Rust team is on top of releasing fixes for these bugs. Additionally, the new borrow checker has detected all of the recent borrowck bugs.

2. The code required to produce this does not look like idiomatic Rust. One would hope an organization adopting Rust would choose to review such blocks of code with more scrutiny. That said, this isn't enough of a guarantee -- such code could be buried deep inside a large patch, making it challenging to discover.

I eagerly await the new borrow checker, and other projects aimed at increasing confidence in the Rust compiler's checks.

Re: Announcing Rust 1.27.2

#34
post #9

Earlier quoted context omitted.

If you're familiar with rust syntax, that function is readable: A function 'transmute_lifetime' that takes a tuple of generic type T with lifetime 'a and returns a T with lifetime 'b... And then the code itself, beyond the function signature, is trivial destructuring matching. If you're not familiar with the syntax of a language, of course it won't be easy to read. perl and bash can rapidly devolve into symbol salad…

and that is where the problem lies. All code is readable if you spend an hour or two. The point is that it is not lucid. You have to strain to understand such code. The issue is people thinking this code is acceptable.

What is a language that you claim I can't find a similarly difficult sample of?
Post reply on HN