1
Fork 0

Change syntax of the never type attribute thingy

Previous:
  ```rust
  #![rustc_never_type_mode = "fallback_to_unit|..."]
  ```

New:
  ```rust
  #![rustc_never_type_options(fallback = "unit|...")]
  ```
This allows adding other options for other never-related experiments.
This commit is contained in:
Maybe Waffle 2024-03-21 19:47:46 +00:00
parent 94b72d6beb
commit 6f2c6efe01
4 changed files with 63 additions and 40 deletions

View file

@ -597,9 +597,12 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
),
rustc_attr!(
rustc_never_type_mode, Normal, template!(NameValueStr: "fallback_to_unit|fallback_to_niko|fallback_to_never|no_fallback"), ErrorFollowing,
rustc_never_type_options,
Normal,
template!(List: r#"/*opt*/ fallback = "unit|niko|never|no""#),
ErrorFollowing,
EncodeCrossCrate::No,
"`rustc_never_type_fallback` is used to experiment with never type fallback and work on \
"`rustc_never_type_options` is used to experiment with never type fallback and work on \
never type stabilization, and will never be stable"
),