Skip to content

Defensively marking enum variants as non-exhaustive for WASI 0.3.0 #892

@yoshuawuyts

Description

@yoshuawuyts

I originally posted in #891 (comment):

If we want to be defensive about the 0.3.x target, we could also consider adding an additional other variant too. In Rust core::io::ErrorKind has an Other variant which is intended to be used for any variants not captured by the existing variants. This has been historically useful because up to Rust 1.40 (November 2019) Rust did not have support for the #[non_exhaustive] attribute, and so ErrorKind could not be extended with more variants.

I checked and we already have other(string) variants for method and scheme. error-code also has a defensive variant (internal-error(option)). Do people have thoughts about applying that more broadly?

This is broader than just wasi:http though, and relevant before we release WASI 0.3.0. Do folks have thoughts about this?


cc/ @lukewagner I feel like you might have thoughts about this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions