diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2018-07-14 20:50:30 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@commure.com> | 2018-07-19 23:18:07 -0700 |
| commit | f53c145ef18db6543e8e5420e172e04b6054db2e (patch) | |
| tree | 9de9b0c1f029e7dfac14b0ab50181868f46bd9df /src/test/ui/const-eval | |
| parent | bc14d71622378cf942a834e7c2b5358b9901f775 (diff) | |
Improve suggestion for missing fmt str in println
Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal.
Diffstat (limited to 'src/test/ui/const-eval')
| -rw-r--r-- | src/test/ui/const-eval/conditional_array_execution.nll.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/const-eval/issue-43197.nll.stderr | 14 | ||||
| -rw-r--r-- | src/test/ui/const-eval/issue-44578.nll.stderr | 14 |
3 files changed, 12 insertions, 30 deletions
diff --git a/src/test/ui/const-eval/conditional_array_execution.nll.stderr b/src/test/ui/const-eval/conditional_array_execution.nll.stderr index 8bc302a2bef..3f82311d469 100644 --- a/src/test/ui/const-eval/conditional_array_execution.nll.stderr +++ b/src/test/ui/const-eval/conditional_array_execution.nll.stderr @@ -28,25 +28,19 @@ LL | println!("{}", FOO); | ^^^ referenced constant has errors error[E0080]: referenced constant has errors - --> $DIR/conditional_array_execution.rs:19:5 + --> $DIR/conditional_array_execution.rs:19:14 | LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; | ----- attempt to subtract with overflow ... LL | println!("{}", FOO); - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + | ^^^^ error[E0080]: erroneous constant used - --> $DIR/conditional_array_execution.rs:19:5 + --> $DIR/conditional_array_execution.rs:19:14 | LL | println!("{}", FOO); - | ^^^^^^^^^^^^^^^---^^ - | | - | referenced constant has errors - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + | ^^^^ --- referenced constant has errors error[E0080]: referenced constant has errors --> $DIR/conditional_array_execution.rs:19:20 diff --git a/src/test/ui/const-eval/issue-43197.nll.stderr b/src/test/ui/const-eval/issue-43197.nll.stderr index 5819e6a9254..e25cb29c114 100644 --- a/src/test/ui/const-eval/issue-43197.nll.stderr +++ b/src/test/ui/const-eval/issue-43197.nll.stderr @@ -51,25 +51,19 @@ LL | println!("{} {}", X, Y); | ^ referenced constant has errors error[E0080]: referenced constant has errors - --> $DIR/issue-43197.rs:24:5 + --> $DIR/issue-43197.rs:24:14 | LL | const X: u32 = 0-1; | --- attempt to subtract with overflow ... LL | println!("{} {}", X, Y); - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + | ^^^^^^^ error[E0080]: erroneous constant used - --> $DIR/issue-43197.rs:24:5 + --> $DIR/issue-43197.rs:24:14 | LL | println!("{} {}", X, Y); - | ^^^^^^^^^^^^^^^^^^-^^^^^ - | | - | referenced constant has errors - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + | ^^^^^^^ - referenced constant has errors error[E0080]: referenced constant has errors --> $DIR/issue-43197.rs:24:26 diff --git a/src/test/ui/const-eval/issue-44578.nll.stderr b/src/test/ui/const-eval/issue-44578.nll.stderr index eeb152e00ea..da040747991 100644 --- a/src/test/ui/const-eval/issue-44578.nll.stderr +++ b/src/test/ui/const-eval/issue-44578.nll.stderr @@ -1,23 +1,17 @@ error[E0080]: referenced constant has errors - --> $DIR/issue-44578.rs:35:5 + --> $DIR/issue-44578.rs:35:14 | LL | const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize]; | ------------------------------------ index out of bounds: the len is 1 but the index is 1 ... LL | println!("{}", <Bar<u16, u8> as Foo>::AMT); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + | ^^^^ error[E0080]: erroneous constant used - --> $DIR/issue-44578.rs:35:5 + --> $DIR/issue-44578.rs:35:14 | LL | println!("{}", <Bar<u16, u8> as Foo>::AMT); - | ^^^^^^^^^^^^^^^--------------------------^^ - | | - | referenced constant has errors - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + | ^^^^ -------------------------- referenced constant has errors error[E0080]: referenced constant has errors --> $DIR/issue-44578.rs:35:20 |
