]> git.lizzy.rs Git - rust.git/commitdiff
Make proc_macro Level #[non_exhaustive]
authorvarkor <github@varkor.com>
Wed, 15 Aug 2018 15:56:54 +0000 (16:56 +0100)
committervarkor <github@varkor.com>
Wed, 15 Aug 2018 16:11:42 +0000 (17:11 +0100)
src/libproc_macro/diagnostic.rs
src/libproc_macro/lib.rs
src/libproc_macro/rustc.rs

index 51e7647f36cc2f9673d49e27a1100182fe995f46..af7790164183c7dbfed11cc9b671173b1876f2ae 100644 (file)
@@ -16,6 +16,7 @@
 /// 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
index fec90008c6701ec2d074091d68c8302cf58ca8fd..97cf4c14c0cbb6ca139e861db0e02b77e07b7801 100644 (file)
@@ -36,6 +36,7 @@
 #![feature(staged_api)]
 #![feature(lang_items)]
 #![feature(optin_builtin_traits)]
+#![feature(non_exhaustive)]
 
 #![recursion_limit="256"]
 
index a54c695f6376fc0e817d42ea2c58fc9c0cb5067b..21229d3299d7e5a7251e7e52252aec82900539eb 100644 (file)
@@ -278,7 +278,6 @@ pub(crate) fn to_internal(self) -> errors::Level {
             Level::Warning => errors::Level::Warning,
             Level::Note => errors::Level::Note,
             Level::Help => errors::Level::Help,
-            Level::__Nonexhaustive => unreachable!("Level::__Nonexhaustive"),
         }
     }
 }