Skip to content

Commit

Permalink
Rollup merge of rust-lang#61879 - stjepang:stabilize-todo, r=withoutb…
Browse files Browse the repository at this point in the history
…oats

Stabilize todo macro

The `todo!` macro is just another name for `unimplemented!`.

Tracking issue: rust-lang#59277

This PR needs a FCP to merge.

r? @withoutboats
  • Loading branch information
tmandry authored Oct 3, 2019
2 parents 032a53a + 711f673 commit f7ee31e
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
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,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 @@ -474,6 +474,7 @@ macro_rules! writeln {
/// This will always [`panic!`]
///
/// [`panic!`]: ../std/macro.panic.html
///
/// # Examples
///
/// Match arms:
Expand Down Expand Up @@ -525,6 +526,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 @@ -579,8 +583,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 @@ -602,8 +608,6 @@ macro_rules! unimplemented {
/// `baz()`, so we can use `todo!`:
///
/// ```
/// #![feature(todo_macro)]
///
/// # trait Foo {
/// # fn bar(&self);
/// # fn baz(&self);
Expand All @@ -629,7 +633,7 @@ macro_rules! unimplemented {
/// }
/// ```
#[macro_export]
#[unstable(feature = "todo_macro", issue = "59277")]
#[stable(feature = "todo_macro", since = "1.39.0")]
macro_rules! todo {
() => (panic!("not yet implemented"));
($($arg:tt)+) => (panic!("not yet implemented: {}", $crate::format_args!($($arg)+)));
Expand Down
1 change: 0 additions & 1 deletion src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@
#![feature(str_internals)]
#![feature(test)]
#![feature(thread_local)]
#![feature(todo_macro)]
#![feature(toowned_clone_into)]
#![feature(trace_macros)]
#![feature(try_reserve)]
Expand Down

0 comments on commit f7ee31e

Please sign in to comment.