Live data from Hacker News

Announcing Rust 1.27.2

blog.rust-lang.org

1–10 of 34 posts

Re: Announcing Rust 1.27.2

#4

Does anyone else here share a concern over numerous patches to the match ergonomics feature?

There’s a whole section on the page with the header “Concern over numerous patches to the match ergonomics feature”.

So if your question is literally, “Does anybody else...” then the answer is yes:

“Users have expressed concern with the frequency of patch releases to fix bugs in the match ergonomics verification by the current borrow checker on a variety of Rust’s forums. ”

If the question is more about being concerned yourself, do the reasons listed in the link address your concerns?

Re: Announcing Rust 1.27.2

#5
Sample Code:

=======================

fn transmute_lifetime(t: &'a (T,)) -> &'b T {

    match (&t, ()) {

        ((t,), ()) => t,

    }
}

=======================

I thought Obfuscated-C was hard to read. Then C++ with all its templates. Now, I'm thinking Rust has taken the prize.

Re: Announcing Rust 1.27.2

#6

Sample Code: ======================= fn transmute_lifetime (t: &'a (T,)) -> &'b T { match (&t, ()) { ((t,), ()) => t, } } ======================= I thought Obfuscated-C was hard to read. Then C++ with all its templates. Now, I'm thinking Rust has taken the prize.

The post says Rust 1.27.2 will reject that code.

Re: Announcing Rust 1.27.2

#7

Does anyone else here share a concern over numerous patches to the match ergonomics feature?

There have been 3 patch releases that include borrow checker fixes related to the match ergonomics work in the last 45 days.

  [1] https://blog.rust-lang.org/2018/06/05/Rust-1.26.2.html (June 5)
  [2] https://blog.rust-lang.org/2018/07/10/Rust-1.27.1.html (June 10)
  [3] https://blog.rust-lang.org/2018/07/20/Rust-1.27.2.html (July 20)
The latest of these actually address your concern directly.

Re: Announcing Rust 1.27.2

#8
post #4

Does anyone else here share a concern over numerous patches to the match ergonomics feature?

There’s a whole section on the page with the header “Concern over numerous patches to the match ergonomics feature”. So if your question is literally, “Does anybody else...” then the answer is yes: “Users have expressed concern with the frequency of patch releases to fix bugs in the match ergonomics verification by the current borrow checker on a variety of Rust’s forums. ” If the question is more about being concern…

Check out the username. Troll/novelty account.

Re: Announcing Rust 1.27.2

#9

Sample Code: ======================= fn transmute_lifetime (t: &'a (T,)) -> &'b T { match (&t, ()) { ((t,), ()) => t, } } ======================= I thought Obfuscated-C was hard to read. Then C++ with all its templates. Now, I'm thinking Rust has taken the prize.

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 if you don't know them. If you don't know es6, javascript's spread and destructuring assignment syntax can look every bit as strange.

That all being said, the point of this rust code was to be a minimal example. Minimal reproducers are often nonsensical and unidiomatic, which helps put this in further context.

I think the original un-minimized crashing code was this: https://github.com/rust-lang/rust/issues/52213#issuecomment-...

That's clearly more readable, and that's what more typical rust looks like.

Post reply on HN