Skip to content

Commit

Permalink
Stabilize todo macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Stjepan Glavina committed Jun 15, 2019
1 parent 7096ff0 commit 8e3b9d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
16 changes: 10 additions & 6 deletions src/libcore/macros.rs
Expand Up @@ -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
///
Expand All @@ -459,6 +459,7 @@ macro_rules! writeln {
/// This will always [`panic!`]
///
/// [`panic!`]: ../std/macro.panic.html
///
/// # Examples
///
/// Match arms:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
///
Expand All @@ -587,8 +593,6 @@ macro_rules! unimplemented {
/// `baz()`, so we can use `todo!`:
///
/// ```
/// #![feature(todo_macro)]
///
/// # trait Foo {
/// # fn bar(&self);
/// # fn baz(&self);
Expand All @@ -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)*)));
Expand Down
1 change: 0 additions & 1 deletion src/libstd/lib.rs
Expand Up @@ -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)]
Expand Down

0 comments on commit 8e3b9d2

Please sign in to comment.