proposed @noreturn attribute
Meta via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jul 19 06:25:50 PDT 2017
On Wednesday, 19 July 2017 at 11:02:07 UTC, Marc Schütz wrote:
> On Wednesday, 12 July 2017 at 13:22:46 UTC, Meta wrote:
>> D is not ML or Haskell or Idris. Rust has trod this ground
>> before us and they saw it prudent to not make ! a first-class
>> type.
>
> Only to turn around after they realized their mistake:
>
> https://doc.rust-lang.org/stable/book/second-edition/ch19-04-advanced-types.html#the-never-type--that-never-returns
That page doesn't say anything about passing ! as a type to
generic functions (what I'm referring to), but it seems the
following code does compile on Rust nightly with the
#![feature(never_type)] directive:
fn test<T>() {}
fn main() {
test::<!>();
}
So it seems my Rust knowledge is about a year out of date.
More information about the Digitalmars-d
mailing list