Skip to content

Commit 054346b

Browse files
committed
Rename format_args_nl! to format_args_ln! for consistency
This provides consistency with `writeln!` and `println!` and `eprintln!`.
1 parent 43874a2 commit 054346b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+72
-71
lines changed

compiler/rustc_builtin_macros/src/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ pub fn expand_format_args<'cx>(
959959
expand_format_args_impl(ecx, sp, tts, false)
960960
}
961961

962-
pub fn expand_format_args_nl<'cx>(
962+
pub fn expand_format_args_ln<'cx>(
963963
ecx: &'cx mut ExtCtxt<'_>,
964964
sp: Span,
965965
tts: TokenStream,

compiler/rustc_builtin_macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
7272
concat: concat::expand_concat,
7373
env: env::expand_env,
7474
file: source_util::expand_file,
75-
format_args_nl: format::expand_format_args_nl,
75+
format_args_ln: format::expand_format_args_ln,
7676
format_args: format::expand_format_args,
7777
const_format_args: format::expand_format_args,
7878
global_asm: asm::expand_global_asm,

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,8 @@ symbols! {
703703
format,
704704
format_args,
705705
format_args_capture,
706+
format_args_ln,
706707
format_args_macro,
707-
format_args_nl,
708708
format_macro,
709709
fp,
710710
freeze,

library/core/src/macros/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -549,13 +549,13 @@ macro_rules! write {
549549
#[macro_export]
550550
#[stable(feature = "rust1", since = "1.0.0")]
551551
#[cfg_attr(not(test), rustc_diagnostic_item = "writeln_macro")]
552-
#[allow_internal_unstable(format_args_nl)]
552+
#[allow_internal_unstable(format_args_ln)]
553553
macro_rules! writeln {
554554
($dst:expr $(,)?) => {
555555
$crate::write!($dst, "\n")
556556
};
557557
($dst:expr, $($arg:tt)*) => {{
558-
let result = $dst.write_fmt($crate::format_args_nl!($($arg)*));
558+
let result = $dst.write_fmt($crate::format_args_ln!($($arg)*));
559559
result
560560
}};
561561
}
@@ -897,15 +897,16 @@ pub(crate) mod builtin {
897897

898898
/// Same as [`format_args`], but adds a newline in the end.
899899
#[unstable(
900-
feature = "format_args_nl",
900+
feature = "format_args_ln",
901901
issue = "none",
902-
reason = "`format_args_nl` is only for internal \
902+
reason = "`format_args_ln` is only for internal \
903903
language use and is subject to change"
904904
)]
905905
#[allow_internal_unstable(fmt_internals)]
906-
#[rustc_builtin_macro]
906+
#[cfg_attr(bootstrap, rustc_builtin_macro(format_args_nl))]
907+
#[cfg_attr(not(bootstrap), rustc_builtin_macro)]
907908
#[macro_export]
908-
macro_rules! format_args_nl {
909+
macro_rules! format_args_ln {
909910
($fmt:expr) => {{ /* compiler built-in */ }};
910911
($fmt:expr, $($args:tt)*) => {{ /* compiler built-in */ }};
911912
}

library/core/src/prelude/v1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub use crate::hash::macros::Hash;
5656
#[doc(no_inline)]
5757
pub use crate::{
5858
assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
59-
format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
59+
format_args_ln, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
6060
stringify, trace_macros,
6161
};
6262

library/std/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318
#![feature(core_panic)]
319319
#![feature(custom_test_frameworks)]
320320
#![feature(edition_panic)]
321-
#![feature(format_args_nl)]
321+
#![feature(format_args_ln)]
322322
#![feature(log_syntax)]
323323
#![feature(once_cell)]
324324
#![feature(saturating_int_impl)]
@@ -593,7 +593,7 @@ pub use core::{
593593
#[allow(deprecated)]
594594
pub use core::{
595595
assert, assert_matches, cfg, column, compile_error, concat, concat_idents, const_format_args,
596-
env, file, format_args, format_args_nl, include, include_bytes, include_str, line, log_syntax,
596+
env, file, format_args, format_args_ln, include, include_bytes, include_str, line, log_syntax,
597597
module_path, option_env, stringify, trace_macros,
598598
};
599599

library/std/src/macros.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ macro_rules! print {
9797
#[macro_export]
9898
#[stable(feature = "rust1", since = "1.0.0")]
9999
#[cfg_attr(not(test), rustc_diagnostic_item = "println_macro")]
100-
#[allow_internal_unstable(print_internals, format_args_nl)]
100+
#[allow_internal_unstable(print_internals, format_args_ln)]
101101
macro_rules! println {
102102
() => {
103103
$crate::print!("\n")
104104
};
105105
($($arg:tt)*) => {{
106-
$crate::io::_print($crate::format_args_nl!($($arg)*));
106+
$crate::io::_print($crate::format_args_ln!($($arg)*));
107107
}};
108108
}
109109

@@ -163,13 +163,13 @@ macro_rules! eprint {
163163
#[macro_export]
164164
#[stable(feature = "eprint", since = "1.19.0")]
165165
#[cfg_attr(not(test), rustc_diagnostic_item = "eprintln_macro")]
166-
#[allow_internal_unstable(print_internals, format_args_nl)]
166+
#[allow_internal_unstable(print_internals, format_args_ln)]
167167
macro_rules! eprintln {
168168
() => {
169169
$crate::eprint!("\n")
170170
};
171171
($($arg:tt)*) => {{
172-
$crate::io::_eprint($crate::format_args_nl!($($arg)*));
172+
$crate::io::_eprint($crate::format_args_ln!($($arg)*));
173173
}};
174174
}
175175

library/std/src/prelude/v1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub use crate::result::Result::{self, Err, Ok};
4040
#[doc(no_inline)]
4141
pub use core::prelude::v1::{
4242
assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
43-
format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
43+
format_args_ln, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
4444
stringify, trace_macros, Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd,
4545
};
4646

src/test/ui/borrowck/borrowck-and-init.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0381]: borrow of possibly-uninitialized variable: `i`
44
LL | println!("{}", i);
55
| ^ use of possibly-uninitialized `i`
66
|
7-
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
7+
= note: this error originates in the macro `$crate::format_args_ln` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
error: aborting due to previous error
1010

src/test/ui/borrowck/borrowck-break-uninit-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0381]: borrow of possibly-uninitialized variable: `x`
44
LL | println!("{}", x);
55
| ^ use of possibly-uninitialized `x`
66
|
7-
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
7+
= note: this error originates in the macro `$crate::format_args_ln` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
error: aborting due to previous error
1010

0 commit comments

Comments
 (0)