diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-08-05 11:02:25 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-08-05 11:05:12 -0400 |
| commit | f9f89233938579f1b0dfd218c8db0878bda8c3e7 (patch) | |
| tree | 6b1fe02e41c3f8e1eef4f87bf369a18ede484aac /src/librustc_errors | |
| parent | 8b84156c6ee2b4e707dc32f5a516e3143ab924d3 (diff) | |
| download | rust-f9f89233938579f1b0dfd218c8db0878bda8c3e7.tar.gz rust-f9f89233938579f1b0dfd218c8db0878bda8c3e7.zip | |
Show backtrace numbers in backtrace whenever more than one is involved
Previously, we only displayed 'frame' numbers in a macro backtrace when more than two frames were involved. This commit should help make backtrace more readable, since these kinds of messages can quickly get confusing.
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/emitter.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index 1362a1155bc..cca8b47c781 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -362,7 +362,7 @@ pub trait Emitter { format!( "in this expansion of `{}`{}", trace.kind.descr(), - if macro_backtrace.len() > 2 { + if macro_backtrace.len() > 1 { // if macro_backtrace.len() == 1 it'll be // pointed at by "in this macro invocation" format!(" (#{})", i + 1) @@ -393,7 +393,7 @@ pub trait Emitter { trace.call_site, format!( "in this macro invocation{}", - if macro_backtrace.len() > 2 && always_backtrace { + if macro_backtrace.len() > 1 && always_backtrace { // only specify order when the macro // backtrace is multiple levels deep format!(" (#{})", i + 1) |
