Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc: Stabilize the proc_macro feature #52081

Merged
merged 1 commit into from
Jul 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
241 changes: 0 additions & 241 deletions src/doc/unstable-book/src/language-features/proc-macro.md

This file was deleted.

16 changes: 8 additions & 8 deletions src/libproc_macro/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Span;
use rustc_errors as rustc;

/// An enum representing a diagnostic level.
#[unstable(feature = "proc_macro", issue = "38356")]
#[unstable(feature = "proc_macro_diagnostic", issue = "38356")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point in renaming unstable library features?
This is only breaking all the code using them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proc_macro feature at this point has been used-and-abused I think a bit too much. This PR is, afaik, the main thrust of proc_macro for stabilization. The renamings here aren't intended to purely break everyone else's code, but rather clearly singify different groupings of features instead of leaving them all in a perpetual singular proc_macro bucket

#[derive(Copy, Clone, Debug)]
pub enum Level {
/// An error.
Expand All @@ -30,7 +30,7 @@ pub enum Level {

/// A structure representing a diagnostic message and associated children
/// messages.
#[unstable(feature = "proc_macro", issue = "38356")]
#[unstable(feature = "proc_macro_diagnostic", issue = "38356")]
#[derive(Clone, Debug)]
pub struct Diagnostic {
level: Level,
Expand All @@ -43,15 +43,15 @@ macro_rules! diagnostic_child_methods {
($spanned:ident, $regular:ident, $level:expr) => (
/// Add a new child diagnostic message to `self` with the level
/// identified by this methods name with the given `span` and `message`.
#[unstable(feature = "proc_macro", issue = "38356")]
#[unstable(feature = "proc_macro_diagnostic", issue = "38356")]
pub fn $spanned<T: Into<String>>(mut self, span: Span, message: T) -> Diagnostic {
self.children.push(Diagnostic::spanned(span, $level, message));
self
}

/// Add a new child diagnostic message to `self` with the level
/// identified by this method's name with the given `message`.
#[unstable(feature = "proc_macro", issue = "38356")]
#[unstable(feature = "proc_macro_diagnostic", issue = "38356")]
pub fn $regular<T: Into<String>>(mut self, message: T) -> Diagnostic {
self.children.push(Diagnostic::new($level, message));
self
Expand All @@ -61,7 +61,7 @@ macro_rules! diagnostic_child_methods {

impl Diagnostic {
/// Create a new diagnostic with the given `level` and `message`.
#[unstable(feature = "proc_macro", issue = "38356")]
#[unstable(feature = "proc_macro_diagnostic", issue = "38356")]
pub fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic {
Diagnostic {
level: level,
Expand All @@ -73,7 +73,7 @@ impl Diagnostic {

/// Create a new diagnostic with the given `level` and `message` pointing to
/// the given `span`.
#[unstable(feature = "proc_macro", issue = "38356")]
#[unstable(feature = "proc_macro_diagnostic", issue = "38356")]
pub fn spanned<T: Into<String>>(span: Span, level: Level, message: T) -> Diagnostic {
Diagnostic {
level: level,
Expand All @@ -89,13 +89,13 @@ impl Diagnostic {
diagnostic_child_methods!(span_help, help, Level::Help);

/// Returns the diagnostic `level` for `self`.
#[unstable(feature = "proc_macro", issue = "38356")]
#[unstable(feature = "proc_macro_diagnostic", issue = "38356")]
pub fn level(&self) -> Level {
self.level
}

/// Emit the diagnostic.
#[unstable(feature = "proc_macro", issue = "38356")]
#[unstable(feature = "proc_macro_diagnostic", issue = "38356")]
pub fn emit(self) {
::__internal::with_sess(move |sess, _| {
let handler = &sess.span_diagnostic;
Expand Down
Loading