From eb53ca3aad616069cb8f6f8fff71c27e9ba9640c Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Sun, 23 Oct 2016 17:22:06 -0700 Subject: Show multiline spans in full if short enough When dealing with multiline spans that span few lines, show the complete span instead of restricting to the first character of the first line. For example, instead of: ``` % ./rustc foo.rs error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied --> foo.rs:13:9 | 13 | foo(1 + bar(x, | ^ trait `{integer}: std::ops::Add<()>` not satisfied | ``` show ``` % ./rustc foo.rs error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied --> foo.rs:13:9 | 13 | foo(1 + bar(x, | ________^ starting here... 14 | | y), | |_____________^ ...ending here: trait `{integer}: std::ops::Add<()>` not satisfied | ``` --- src/libsyntax/lib.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libsyntax/lib.rs') diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 34280812421..0545cccabf7 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -144,4 +144,7 @@ pub mod ext { } } +#[cfg(test)] +mod test_snippet; + // __build_diagnostic_array! { libsyntax, DIAGNOSTICS } -- cgit 1.4.1-3-g733a5