Skip to content

Commit

Permalink
Stabilize format_args_ln!
Browse files Browse the repository at this point in the history
`format_args_ln!` is generally useful for implementations of formatting
macros, and it has clear semantics and a clear interface.
  • Loading branch information
joshtriplett committed Jun 5, 2022
1 parent 054346b commit ef7c7a1
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 25 deletions.
8 changes: 1 addition & 7 deletions library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ macro_rules! write {
#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "writeln_macro")]
#[allow_internal_unstable(format_args_ln)]
macro_rules! writeln {
($dst:expr $(,)?) => {
$crate::write!($dst, "\n")
Expand Down Expand Up @@ -896,12 +895,7 @@ pub(crate) mod builtin {
}

/// Same as [`format_args`], but adds a newline in the end.
#[unstable(
feature = "format_args_ln",
issue = "none",
reason = "`format_args_ln` is only for internal \
language use and is subject to change"
)]
#[stable(feature = "format_args_ln", since = "1.63.0")]
#[allow_internal_unstable(fmt_internals)]
#[cfg_attr(bootstrap, rustc_builtin_macro(format_args_nl))]
#[cfg_attr(not(bootstrap), rustc_builtin_macro)]
Expand Down
1 change: 0 additions & 1 deletion library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@
#![feature(core_panic)]
#![feature(custom_test_frameworks)]
#![feature(edition_panic)]
#![feature(format_args_ln)]
#![feature(log_syntax)]
#![feature(once_cell)]
#![feature(saturating_int_impl)]
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ macro_rules! print {
#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "println_macro")]
#[allow_internal_unstable(print_internals, format_args_ln)]
#[allow_internal_unstable(print_internals)]
macro_rules! println {
() => {
$crate::print!("\n")
Expand Down Expand Up @@ -163,7 +163,7 @@ macro_rules! eprint {
#[macro_export]
#[stable(feature = "eprint", since = "1.19.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "eprintln_macro")]
#[allow_internal_unstable(print_internals, format_args_ln)]
#[allow_internal_unstable(print_internals)]
macro_rules! eprintln {
() => {
$crate::eprint!("\n")
Expand Down
3 changes: 0 additions & 3 deletions src/test/ui/feature-gates/feature-gate-format_args_nl.rs

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/ui/feature-gates/feature-gate-format_args_nl.stderr

This file was deleted.

1 change: 0 additions & 1 deletion src/test/ui/hygiene/format-args.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// check-pass

#![allow(non_upper_case_globals)]
#![feature(format_args_ln)]

static arg0: () = ();

Expand Down

0 comments on commit ef7c7a1

Please sign in to comment.