Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make proc_macro Level #[non_exhaustive]
  • Loading branch information
varkor committed Aug 15, 2018
commit a50224804d7bd8c492ecd83c4f2d81d33145ba88
3 changes: 1 addition & 2 deletions src/libproc_macro/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -25,8 +26,6 @@ pub enum Level {
Note,
/// A help message.
Help,
#[doc(hidden)]
__Nonexhaustive,
}

/// A structure representing a diagnostic message and associated children
Expand Down
1 change: 1 addition & 0 deletions src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#![feature(staged_api)]
#![feature(lang_items)]
#![feature(optin_builtin_traits)]
#![feature(non_exhaustive)]

#![recursion_limit="256"]

Expand Down
1 change: 0 additions & 1 deletion src/libproc_macro/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}
}