Skip to content

Commit 28090bc

Browse files
committed
Remove 'this error originates in format_args_nl' from test output.
This message is no longer generated. This is probably a good thing. The relevant span is entirely in user code, and "format_args_nl" is an implementation detail with a name that isn't even public.
1 parent 295a1af commit 28090bc

36 files changed

+3
-67
lines changed

tests/ui/borrowck/borrowck-and-init.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ LL | println!("{}", false && { i = 5; true });
88
| ----- binding initialized here in some conditions
99
LL | println!("{}", i);
1010
| ^ `i` used here but it is possibly-uninitialized
11-
|
12-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1311

1412
error: aborting due to 1 previous error
1513

tests/ui/borrowck/borrowck-break-uninit-2.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | let x: isize;
77
LL | println!("{}", x);
88
| ^ `x` used here but it isn't initialized
99
|
10-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1110
help: consider assigning a value
1211
|
1312
LL | let x: isize = 42;

tests/ui/borrowck/borrowck-break-uninit.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | let x: isize;
77
LL | println!("{}", x);
88
| ^ `x` used here but it isn't initialized
99
|
10-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1110
help: consider assigning a value
1211
|
1312
LL | let x: isize = 42;

tests/ui/borrowck/borrowck-or-init.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ LL | println!("{}", false || { i = 5; true });
88
| ----- binding initialized here in some conditions
99
LL | println!("{}", i);
1010
| ^ `i` used here but it is possibly-uninitialized
11-
|
12-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1311

1412
error: aborting due to 1 previous error
1513

tests/ui/borrowck/borrowck-while-break.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ LL | while cond {
88
...
99
LL | println!("{}", v);
1010
| ^ `v` used here but it is possibly-uninitialized
11-
|
12-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1311

1412
error: aborting due to 1 previous error
1513

tests/ui/borrowck/issue-24267-flow-exit.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | loop { x = break; }
77
LL | println!("{}", x);
88
| ^ `x` used here but it isn't initialized
99
|
10-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1110
help: consider assigning a value
1211
|
1312
LL | let x: i32 = 42;
@@ -22,7 +21,6 @@ LL | for _ in 0..10 { x = continue; }
2221
LL | println!("{}", x);
2322
| ^ `x` used here but it isn't initialized
2423
|
25-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
2624
help: consider assigning a value
2725
|
2826
LL | let x: i32 = 42;

tests/ui/borrowck/issue-47646.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ LL | println!("{:?}", heap);
1212
...
1313
LL | };
1414
| - ... and the mutable borrow might be used here, when that temporary is dropped and runs the destructor for type `(Option<PeekMut<'_, i32>>, ())`
15-
|
16-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1715

1816
error: aborting due to 1 previous error
1917

tests/ui/borrowck/suggest-assign-rvalue.stderr

-10
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ LL | let my_float: f32;
1919
LL | println!("my_float: {}", my_float);
2020
| ^^^^^^^^ `my_float` used here but it isn't initialized
2121
|
22-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
2322
help: consider assigning a value
2423
|
2524
LL | let my_float: f32 = 3.14159;
@@ -33,7 +32,6 @@ LL | let demo: Demo;
3332
LL | println!("demo: {:?}", demo);
3433
| ^^^^ `demo` used here but it isn't initialized
3534
|
36-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
3735
help: consider assigning a value
3836
|
3937
LL | let demo: Demo = Default::default();
@@ -47,7 +45,6 @@ LL | let demo_no: DemoNoDef;
4745
LL | println!("demo_no: {:?}", demo_no);
4846
| ^^^^^^^ `demo_no` used here but it isn't initialized
4947
|
50-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
5148
help: consider assigning a value
5249
|
5350
LL | let demo_no: DemoNoDef = /* value */;
@@ -61,7 +58,6 @@ LL | let arr: [i32; 5];
6158
LL | println!("arr: {:?}", arr);
6259
| ^^^ `arr` used here but it isn't initialized
6360
|
64-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
6561
help: consider assigning a value
6662
|
6763
LL | let arr: [i32; 5] = [42; 5];
@@ -75,7 +71,6 @@ LL | let foo: Vec<&str>;
7571
LL | println!("foo: {:?}", foo);
7672
| ^^^ `foo` used here but it isn't initialized
7773
|
78-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
7974
help: consider assigning a value
8075
|
8176
LL | let foo: Vec<&str> = vec![];
@@ -89,7 +84,6 @@ LL | let my_string: String;
8984
LL | println!("my_string: {}", my_string);
9085
| ^^^^^^^^^ `my_string` used here but it isn't initialized
9186
|
92-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
9387
help: consider assigning a value
9488
|
9589
LL | let my_string: String = Default::default();
@@ -103,7 +97,6 @@ LL | let my_int: &i32;
10397
LL | println!("my_int: {}", *my_int);
10498
| ^^^^^^^ `*my_int` used here but it isn't initialized
10599
|
106-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
107100
help: consider assigning a value
108101
|
109102
LL | let my_int: &i32 = &42;
@@ -117,7 +110,6 @@ LL | let hello: &str;
117110
LL | println!("hello: {}", hello);
118111
| ^^^^^ `hello` used here but it isn't initialized
119112
|
120-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
121113
help: consider assigning a value
122114
|
123115
LL | let hello: &str = "";
@@ -130,8 +122,6 @@ LL | let never: !;
130122
| ----- binding declared here but left uninitialized
131123
LL | println!("never: {}", never);
132124
| ^^^^^ `never` used here but it isn't initialized
133-
|
134-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
135125

136126
error: aborting due to 10 previous errors
137127

tests/ui/closures/2229_closure_analysis/diagnostics/arrays.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ LL | println!("{}", arr[3]);
5353
...
5454
LL | c();
5555
| - mutable borrow later used here
56-
|
57-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
5856

5957
error[E0502]: cannot borrow `arr` as immutable because it is also borrowed as mutable
6058
--> $DIR/arrays.rs:71:24

tests/ui/closures/2229_closure_analysis/diagnostics/box.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ LL | println!("{}", e.0.0.m.x);
2525
LL |
2626
LL | c();
2727
| - mutable borrow later used here
28-
|
29-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
3028

3129
error[E0506]: cannot assign to `e.0.0.m.x` because it is borrowed
3230
--> $DIR/box.rs:55:5

tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | println!("{}", foo.x);
77
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
88
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
99
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
10-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1110

1211
error: aborting due to 1 previous error
1312

tests/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ LL | println!("{:?}", p);
1313
LL |
1414
LL | c();
1515
| - mutable borrow later used here
16-
|
17-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1816

1917
error: aborting due to 1 previous error
2018

tests/ui/closures/issue-111932.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ LL | println!("{:?}", foo);
1919
= help: the trait `Sized` is not implemented for `dyn Foo`
2020
note: required by an implicit `Sized` bound in `core::fmt::rt::Argument::<'_>::new_debug`
2121
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
22-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
2322

2423
error: aborting due to 2 previous errors
2524

tests/ui/codemap_tests/tab_3.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ LL | println!("{:?}", some_vec);
1111
|
1212
note: `into_iter` takes ownership of the receiver `self`, which moves `some_vec`
1313
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
14-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1514
help: you can `clone` the value and consume it, but this might not be your desired behavior
1615
|
1716
LL | some_vec.clone().into_iter();

tests/ui/consts/const-eval/issue-44578.stderr

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ note: erroneous constant encountered
2424
LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
2626
|
27-
= note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
27+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2828

2929
note: erroneous constant encountered
3030
--> $DIR/issue-44578.rs:26:20
@@ -33,7 +33,6 @@ LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
3333
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
3434
|
3535
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
36-
= note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
3736

3837
error: aborting due to 1 previous error
3938

tests/ui/coroutine/yield-while-ref-reborrowed.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ LL | println!("{}", x);
1010
| ^ second borrow occurs here
1111
LL | Pin::new(&mut b).resume(());
1212
| ------ first borrow later used here
13-
|
14-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1513

1614
error: aborting due to 1 previous error
1715

tests/ui/fmt/ifmt-unimpl.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ LL | format!("{:X}", "3");
1919
= note: required for `&str` to implement `UpperHex`
2020
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_upper_hex`
2121
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
22-
= note: this error originates in the macro `$crate::__export::format_args` which comes from the expansion of the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
2322

2423
error: aborting due to 1 previous error
2524

tests/ui/inference/need_type_info/issue-107745-avoid-expr-from-macro-expansion.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ error[E0282]: type annotations needed
33
|
44
LL | println!("{:?}", []);
55
| ^^ cannot infer type
6-
|
7-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
86

97
error: aborting due to 1 previous error
108

tests/ui/issues/issue-42796.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ LL | let mut s_copy = s;
99
LL | println!("{}", s);
1010
| ^ value borrowed here after move
1111
|
12-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1312
help: consider cloning the value if the performance cost is acceptable
1413
|
1514
LL | let mut s_copy = s.clone();

tests/ui/liveness/liveness-move-in-while.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ LL | while true { while true { while true { x = y; x.clone(); } } }
3535
| | inside of this loop
3636
| inside of this loop
3737
|
38-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
3938
help: consider cloning the value if the performance cost is acceptable
4039
|
4140
LL | while true { while true { while true { x = y.clone(); x.clone(); } } }

tests/ui/liveness/liveness-use-after-move.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ LL |
99
LL | println!("{}", *x);
1010
| ^^ value borrowed here after move
1111
|
12-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1312
help: consider cloning the value if the performance cost is acceptable
1413
|
1514
LL | let y = x.clone();

tests/ui/liveness/liveness-use-after-send.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ note: consider changing this parameter type in function `send` to borrow instead
1313
|
1414
LL | fn send<T:Send + std::fmt::Debug>(ch: Chan<T>, data: T) {
1515
| ---- in this function ^ this parameter takes ownership of the value
16-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1716
help: consider cloning the value if the performance cost is acceptable
1817
|
1918
LL | send(ch, message.clone());

tests/ui/loops/loop-proper-liveness.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | let x: i32;
77
LL | println!("{:?}", x);
88
| ^ `x` used here but it isn't initialized
99
|
10-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1110
help: consider assigning a value
1211
|
1312
LL | let x: i32 = 42;

tests/ui/macros/format-args-temporaries-in-write.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ LL | };
1313
| -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `MutexGuard`
1414
| |
1515
| `mutex` dropped here while still borrowed
16-
|
1716

1817
error[E0597]: `mutex` does not live long enough
1918
--> $DIR/format-args-temporaries-in-write.rs:47:29
@@ -30,7 +29,6 @@ LL | };
3029
| -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `MutexGuard`
3130
| |
3231
| `mutex` dropped here while still borrowed
33-
|
3432

3533
error: aborting due to 2 previous errors
3634

tests/ui/modules/issue-107649.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ error[E0277]: `Dummy` doesn't implement `Debug`
66
|
77
= help: the trait `Debug` is not implemented for `Dummy`
88
= note: add `#[derive(Debug)]` to `Dummy` or manually `impl Debug for Dummy`
9-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `dbg` (in Nightly builds, run with -Z macro-backtrace for more info)
9+
= note: this error originates in the macro `dbg` (in Nightly builds, run with -Z macro-backtrace for more info)
1010
help: consider annotating `Dummy` with `#[derive(Debug)]`
1111
--> $DIR/auxiliary/dummy_lib.rs:2:1
1212
|

tests/ui/moves/moves-based-on-type-capture-clause-bad.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ LL | println!("{}", x);
1010
LL | });
1111
LL | println!("{}", x);
1212
| ^ value borrowed here after move
13-
|
14-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1513

1614
error: aborting due to 1 previous error
1715

tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let _: NotDebug = dbg!(NotDebug);
66
|
77
= help: the trait `Debug` is not implemented for `NotDebug`
88
= note: add `#[derive(Debug)]` to `NotDebug` or manually `impl Debug for NotDebug`
9-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `dbg` (in Nightly builds, run with -Z macro-backtrace for more info)
9+
= note: this error originates in the macro `dbg` (in Nightly builds, run with -Z macro-backtrace for more info)
1010
help: consider annotating `NotDebug` with `#[derive(Debug)]`
1111
|
1212
LL + #[derive(Debug)]

tests/ui/span/issue-39698.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ LL | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}
4747
| | binding initialized here in some conditions
4848
| binding initialized here in some conditions
4949
| binding declared here but left uninitialized
50-
|
51-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
5250

5351
error: aborting due to 5 previous errors
5452

0 commit comments

Comments
 (0)