diff options
| author | varkor <github@varkor.com> | 2018-08-15 16:56:54 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2018-08-15 17:11:42 +0100 |
| commit | a50224804d7bd8c492ecd83c4f2d81d33145ba88 (patch) | |
| tree | a41cc6cdf9c8644194fd2172885bfd52ae82d4a1 /src | |
| parent | bbf0b159b7831b0d6d192e128fded04978931c64 (diff) | |
| download | rust-a50224804d7bd8c492ecd83c4f2d81d33145ba88.tar.gz rust-a50224804d7bd8c492ecd83c4f2d81d33145ba88.zip | |
Make proc_macro Level #[non_exhaustive]
Diffstat (limited to 'src')
| -rw-r--r-- | src/libproc_macro/diagnostic.rs | 3 | ||||
| -rw-r--r-- | src/libproc_macro/lib.rs | 1 | ||||
| -rw-r--r-- | src/libproc_macro/rustc.rs | 1 |
3 files changed, 2 insertions, 3 deletions
diff --git a/src/libproc_macro/diagnostic.rs b/src/libproc_macro/diagnostic.rs index 51e7647f36c..af779016418 100644 --- a/src/libproc_macro/diagnostic.rs +++ b/src/libproc_macro/diagnostic.rs @@ -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 diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index fec90008c67..97cf4c14c0c 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -36,6 +36,7 @@ #![feature(staged_api)] #![feature(lang_items)] #![feature(optin_builtin_traits)] +#![feature(non_exhaustive)] #![recursion_limit="256"] diff --git a/src/libproc_macro/rustc.rs b/src/libproc_macro/rustc.rs index a54c695f637..21229d3299d 100644 --- a/src/libproc_macro/rustc.rs +++ b/src/libproc_macro/rustc.rs @@ -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"), } } } |
