Rollup merge of #61879 - stjepang:stabilize-todo, r=withoutboats

Stabilize todo macro

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

Tracking issue: https://github.com/rust-lang/rust/issues/59277

This PR needs a FCP to merge.

r? @withoutboats
This commit is contained in:
Tyler Mandry 2019-10-03 16:25:35 -07:00 committed by GitHub
commit f7ee31e3d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -465,7 +465,7 @@ macro_rules! writeln {
/// The unsafe counterpart of this macro is the [`unreachable_unchecked`] function, which /// The unsafe counterpart of this macro is the [`unreachable_unchecked`] function, which
/// will cause undefined behavior if the code is reached. /// 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 /// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html
/// [`std::hint`]: ../std/hint/index.html /// [`std::hint`]: ../std/hint/index.html
/// ///
@ -474,6 +474,7 @@ macro_rules! writeln {
/// This will always [`panic!`] /// This will always [`panic!`]
/// ///
/// [`panic!`]: ../std/macro.panic.html /// [`panic!`]: ../std/macro.panic.html
///
/// # Examples /// # Examples
/// ///
/// Match arms: /// Match arms:
@ -525,6 +526,9 @@ macro_rules! unreachable {
/// code type-check, or if you're implementing a trait that requires multiple /// code type-check, or if you're implementing a trait that requires multiple
/// methods, and you're only planning on using one of them. /// methods, and you're only planning on using one of them.
/// ///
/// There is no difference between `unimplemented!` and `todo!` apart from the
/// name.
///
/// # Panics /// # Panics
/// ///
/// This will always [panic!](macro.panic.html) /// This will always [panic!](macro.panic.html)
@ -579,8 +583,10 @@ macro_rules! unimplemented {
/// Indicates unfinished code. /// Indicates unfinished code.
/// ///
/// This can be useful if you are prototyping and are just looking to have your /// This can be useful if you are prototyping and are just looking to have your
/// code typecheck. `todo!` works exactly like `unimplemented!`. The only /// code typecheck.
/// difference between the two macros is the name. ///
/// There is no difference between `unimplemented!` and `todo!` apart from the
/// name.
/// ///
/// # Panics /// # Panics
/// ///
@ -602,8 +608,6 @@ macro_rules! unimplemented {
/// `baz()`, so we can use `todo!`: /// `baz()`, so we can use `todo!`:
/// ///
/// ``` /// ```
/// #![feature(todo_macro)]
///
/// # trait Foo { /// # trait Foo {
/// # fn bar(&self); /// # fn bar(&self);
/// # fn baz(&self); /// # fn baz(&self);
@ -629,7 +633,7 @@ macro_rules! unimplemented {
/// } /// }
/// ``` /// ```
#[macro_export] #[macro_export]
#[unstable(feature = "todo_macro", issue = "59277")] #[stable(feature = "todo_macro", since = "1.39.0")]
macro_rules! todo { macro_rules! todo {
() => (panic!("not yet implemented")); () => (panic!("not yet implemented"));
($($arg:tt)+) => (panic!("not yet implemented: {}", $crate::format_args!($($arg)+))); ($($arg:tt)+) => (panic!("not yet implemented: {}", $crate::format_args!($($arg)+)));

View File

@ -305,7 +305,6 @@
#![feature(str_internals)] #![feature(str_internals)]
#![feature(test)] #![feature(test)]
#![feature(thread_local)] #![feature(thread_local)]
#![feature(todo_macro)]
#![feature(toowned_clone_into)] #![feature(toowned_clone_into)]
#![feature(trace_macros)] #![feature(trace_macros)]
#![feature(try_reserve)] #![feature(try_reserve)]