Make proc_macro Level #[non_exhaustive]
This commit is contained in:
parent
bbf0b159b7
commit
a50224804d
@ -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
|
||||
|
@ -36,6 +36,7 @@
|
||||
#![feature(staged_api)]
|
||||
#![feature(lang_items)]
|
||||
#![feature(optin_builtin_traits)]
|
||||
#![feature(non_exhaustive)]
|
||||
|
||||
#![recursion_limit="256"]
|
||||
|
||||
|
@ -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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user