News for hackers. Stuff that matters.
Re:Oxide: A Formal Semantics for Rust by webkike on Tuesday March 05, 2019 @09:01PM (#19315878)
I believe you can actually name the lifetime of a block, via the same mechanism that makes labeled breaks and continues possible.
Re:Oxide: A Formal Semantics for Rust by Retra on Wednesday March 06, 2019 @09:18AM (#19319045)
I think that was just a proposal that never got accepted? Never see it in real code either way.
Re:Oxide: A Formal Semantics for Rust by bluejekyll on Tuesday March 05, 2019 @09:08PM (#19315901)
Do you have an example of what you mean?
Re:Oxide: A Formal Semantics for Rust by coolreader18 on Tuesday March 05, 2019 @10:45PM (#19316257)
Like this:

  'a: {
      let a_var: u32 = 42;
      let a_ref: &'a u32 = &a_var;
  } //    ^^^^^ only valid in 'a: {}
Re:Oxide: A Formal Semantics for Rust by gpm on Tuesday March 05, 2019 @11:24PM (#19316391)
That doesn't compile with "use of undeclared lifetime name `'a`"
Re:Oxide: A Formal Semantics for Rust by steveklabnik on Wednesday March 06, 2019 @03:55AM (#19317387)
You can name loop labels like this, but you cannot use them to introduce actual lifetimes, that’s right.