Skip to content

Commit f7ee31e

Browse files
authored
Rollup merge of rust-lang#61879 - stjepang:stabilize-todo, r=withoutboats
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
2 parents 032a53a + 711f673 commit f7ee31e

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Diff for: src/libcore/macros.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ macro_rules! writeln {
465465
/// The unsafe counterpart of this macro is the [`unreachable_unchecked`] function, which
466466
/// will cause undefined behavior if the code is reached.
467467
///
468-
/// [`panic!`]: ../std/macro.panic.html
468+
/// [`panic!`]: ../std/macro.panic.html
469469
/// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html
470470
/// [`std::hint`]: ../std/hint/index.html
471471
///
@@ -474,6 +474,7 @@ macro_rules! writeln {
474474
/// This will always [`panic!`]
475475
///
476476
/// [`panic!`]: ../std/macro.panic.html
477+
///
477478
/// # Examples
478479
///
479480
/// Match arms:
@@ -525,6 +526,9 @@ macro_rules! unreachable {
525526
/// code type-check, or if you're implementing a trait that requires multiple
526527
/// methods, and you're only planning on using one of them.
527528
///
529+
/// There is no difference between `unimplemented!` and `todo!` apart from the
530+
/// name.
531+
///
528532
/// # Panics
529533
///
530534
/// This will always [panic!](macro.panic.html)
@@ -579,8 +583,10 @@ macro_rules! unimplemented {
579583
/// Indicates unfinished code.
580584
///
581585
/// This can be useful if you are prototyping and are just looking to have your
582-
/// code typecheck. `todo!` works exactly like `unimplemented!`. The only
583-
/// difference between the two macros is the name.
586+
/// code typecheck.
587+
///
588+
/// There is no difference between `unimplemented!` and `todo!` apart from the
589+
/// name.
584590
///
585591
/// # Panics
586592
///
@@ -602,8 +608,6 @@ macro_rules! unimplemented {
602608
/// `baz()`, so we can use `todo!`:
603609
///
604610
/// ```
605-
/// #![feature(todo_macro)]
606-
///
607611
/// # trait Foo {
608612
/// # fn bar(&self);
609613
/// # fn baz(&self);
@@ -629,7 +633,7 @@ macro_rules! unimplemented {
629633
/// }
630634
/// ```
631635
#[macro_export]
632-
#[unstable(feature = "todo_macro", issue = "59277")]
636+
#[stable(feature = "todo_macro", since = "1.39.0")]
633637
macro_rules! todo {
634638
() => (panic!("not yet implemented"));
635639
($($arg:tt)+) => (panic!("not yet implemented: {}", $crate::format_args!($($arg)+)));

Diff for: src/libstd/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@
305305
#![feature(str_internals)]
306306
#![feature(test)]
307307
#![feature(thread_local)]
308-
#![feature(todo_macro)]
309308
#![feature(toowned_clone_into)]
310309
#![feature(trace_macros)]
311310
#![feature(try_reserve)]

0 commit comments

Comments
 (0)