From 8e3b9d21186ee0b48c72c1af5296aeb75876d2af Mon Sep 17 00:00:00 2001 From: Stjepan Glavina Date: Sun, 16 Jun 2019 01:24:37 +0200 Subject: [PATCH 1/3] Stabilize todo macro --- src/libcore/macros.rs | 16 ++++++++++------ src/libstd/lib.rs | 1 - 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 9dfa09cf8a512..c6b4433eb0a8f 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -450,7 +450,7 @@ macro_rules! writeln { /// The unsafe counterpart of this macro is the [`unreachable_unchecked`] function, which /// will cause undefined behavior if the code is reached. /// -/// [`panic!`]: ../std/macro.panic.html +/// [`panic!`]: ../std/macro.panic.html /// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html /// [`std::hint`]: ../std/hint/index.html /// @@ -459,6 +459,7 @@ macro_rules! writeln { /// This will always [`panic!`] /// /// [`panic!`]: ../std/macro.panic.html +/// /// # Examples /// /// Match arms: @@ -510,6 +511,9 @@ macro_rules! unreachable { /// code type-check, or if you're implementing a trait that requires multiple /// methods, and you're only planning on using one of them. /// +/// There is no difference between `unimplemented!` and `todo!` apart from the +/// name. +/// /// # Panics /// /// This will always [panic!](macro.panic.html) @@ -564,8 +568,10 @@ macro_rules! unimplemented { /// Indicates unfinished code. /// /// This can be useful if you are prototyping and are just looking to have your -/// code typecheck. `todo!` works exactly like `unimplemented!`. The only -/// difference between the two macros is the name. +/// code typecheck. +/// +/// There is no difference between `unimplemented!` and `todo!` apart from the +/// name. /// /// # Panics /// @@ -587,8 +593,6 @@ macro_rules! unimplemented { /// `baz()`, so we can use `todo!`: /// /// ``` -/// #![feature(todo_macro)] -/// /// # trait Foo { /// # fn bar(&self); /// # fn baz(&self); @@ -614,7 +618,7 @@ macro_rules! unimplemented { /// } /// ``` #[macro_export] -#[unstable(feature = "todo_macro", issue = "59277")] +#[stable(feature = "todo_macro", since = "1.37.0")] macro_rules! todo { () => (panic!("not yet implemented")); ($($arg:tt)+) => (panic!("not yet implemented: {}", format_args!($($arg)*))); diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index e044b46e0d076..84c2968b71d71 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -298,7 +298,6 @@ #![feature(stmt_expr_attributes)] #![feature(str_internals)] #![feature(thread_local)] -#![feature(todo_macro)] #![feature(toowned_clone_into)] #![feature(try_reserve)] #![feature(unboxed_closures)] From 560bf1ba0cb476305dcccd4365d750620833f761 Mon Sep 17 00:00:00 2001 From: Stjepan Glavina Date: Wed, 4 Sep 2019 19:34:41 +0200 Subject: [PATCH 2/3] Update src/libcore/macros.rs Co-Authored-By: Mazdak Farrokhzad --- src/libcore/macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index c6b4433eb0a8f..627ceade5cc16 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -618,7 +618,7 @@ macro_rules! unimplemented { /// } /// ``` #[macro_export] -#[stable(feature = "todo_macro", since = "1.37.0")] +#[stable(feature = "todo_macro", since = "1.38.0")] macro_rules! todo { () => (panic!("not yet implemented")); ($($arg:tt)+) => (panic!("not yet implemented: {}", format_args!($($arg)*))); From 711f6735bc9461392331842b317abb0525973949 Mon Sep 17 00:00:00 2001 From: Stjepan Glavina Date: Wed, 4 Sep 2019 19:35:57 +0200 Subject: [PATCH 3/3] Update macros.rs --- src/libcore/macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 627ceade5cc16..a9a30ed80add0 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -618,7 +618,7 @@ macro_rules! unimplemented { /// } /// ``` #[macro_export] -#[stable(feature = "todo_macro", since = "1.38.0")] +#[stable(feature = "todo_macro", since = "1.39.0")] macro_rules! todo { () => (panic!("not yet implemented")); ($($arg:tt)+) => (panic!("not yet implemented: {}", format_args!($($arg)*)));