Skip to content

Commit a502248

Browse files
committed
Make proc_macro Level #[non_exhaustive]
1 parent bbf0b15 commit a502248

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/libproc_macro/diagnostic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use syntax_pos::MultiSpan;
1616
/// An enum representing a diagnostic level.
1717
#[unstable(feature = "proc_macro_diagnostic", issue = "38356")]
1818
#[derive(Copy, Clone, Debug)]
19+
#[non_exhaustive]
1920
pub enum Level {
2021
/// An error.
2122
Error,
@@ -25,8 +26,6 @@ pub enum Level {
2526
Note,
2627
/// A help message.
2728
Help,
28-
#[doc(hidden)]
29-
__Nonexhaustive,
3029
}
3130

3231
/// A structure representing a diagnostic message and associated children

src/libproc_macro/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#![feature(staged_api)]
3737
#![feature(lang_items)]
3838
#![feature(optin_builtin_traits)]
39+
#![feature(non_exhaustive)]
3940

4041
#![recursion_limit="256"]
4142

src/libproc_macro/rustc.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ impl Level {
278278
Level::Warning => errors::Level::Warning,
279279
Level::Note => errors::Level::Note,
280280
Level::Help => errors::Level::Help,
281-
Level::__Nonexhaustive => unreachable!("Level::__Nonexhaustive"),
282281
}
283282
}
284283
}

0 commit comments

Comments
 (0)