Make proc_macro Level #[non_exhaustive]

This commit is contained in:
varkor 2018-08-15 16:56:54 +01:00
parent bbf0b159b7
commit a50224804d
3 changed files with 2 additions and 3 deletions

View File

@ -16,6 +16,7 @@ use syntax_pos::MultiSpan;
/// An enum representing a diagnostic level.
#[unstable(feature = "proc_macro_diagnostic", issue = "38356")]
#[derive(Copy, Clone, Debug)]
#[non_exhaustive]
pub enum Level {
/// An error.
Error,
@ -25,8 +26,6 @@ pub enum Level {
Note,
/// A help message.
Help,
#[doc(hidden)]
__Nonexhaustive,
}
/// A structure representing a diagnostic message and associated children

View File

@ -36,6 +36,7 @@
#![feature(staged_api)]
#![feature(lang_items)]
#![feature(optin_builtin_traits)]
#![feature(non_exhaustive)]
#![recursion_limit="256"]

View File

@ -278,7 +278,6 @@ impl Level {
Level::Warning => errors::Level::Warning,
Level::Note => errors::Level::Note,
Level::Help => errors::Level::Help,
Level::__Nonexhaustive => unreachable!("Level::__Nonexhaustive"),
}
}
}