diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2018-01-26 11:34:12 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2018-01-26 11:35:27 -0800 |
| commit | 106e5c554d6b6b97aecac254a2694247e84e718e (patch) | |
| tree | c0708b63de58b5db9759d28a676e30cac5e3fbbd | |
| parent | f90c445637385c2526990119b3f177d809ac5459 (diff) | |
| download | rust-106e5c554d6b6b97aecac254a2694247e84e718e.tar.gz rust-106e5c554d6b6b97aecac254a2694247e84e718e.zip | |
Don't add "in this macro invocation" label to desugared spans
| -rw-r--r-- | src/librustc_errors/emitter.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/const-fn-error.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/suggestions/try-on-option.stderr | 5 | ||||
| -rw-r--r-- | src/test/ui/suggestions/try-operator-on-main.stderr | 15 |
4 files changed, 5 insertions, 20 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index 58f851aea38..8a4fd24a29b 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -767,6 +767,7 @@ impl EmitterWriter { } // Check to make sure we're not in any <*macros> if !cm.span_to_filename(def_site).is_macros() && + !trace.macro_decl_name.starts_with("desugaring of ") && !trace.macro_decl_name.starts_with("#[") || always_backtrace { new_labels.push((trace.call_site, diff --git a/src/test/ui/const-fn-error.stderr b/src/test/ui/const-fn-error.stderr index de2a9299473..4f4f8b5ad00 100644 --- a/src/test/ui/const-fn-error.stderr +++ b/src/test/ui/const-fn-error.stderr @@ -17,16 +17,12 @@ error[E0015]: calls in constant functions are limited to constant functions, str | 17 | for i in 0..x { //~ ERROR calls in constant functions | ^^^^ - | | - | in this macro invocation error[E0019]: constant function contains unimplemented expression type --> $DIR/const-fn-error.rs:17:14 | 17 | for i in 0..x { //~ ERROR calls in constant functions | ^^^^ - | | - | in this macro invocation error[E0080]: constant evaluation error --> $DIR/const-fn-error.rs:21:5 diff --git a/src/test/ui/suggestions/try-on-option.stderr b/src/test/ui/suggestions/try-on-option.stderr index b1be9ad3cf6..dfe950818e7 100644 --- a/src/test/ui/suggestions/try-on-option.stderr +++ b/src/test/ui/suggestions/try-on-option.stderr @@ -10,10 +10,7 @@ error[E0277]: the `?` operator can only be used in a function that returns `Resu --> $DIR/try-on-option.rs:23:5 | 23 | x?; //~ the `?` operator - | -- - | | - | cannot use the `?` operator in a function that returns `u32` - | in this macro invocation + | ^^ cannot use the `?` operator in a function that returns `u32` | = help: the trait `std::ops::Try` is not implemented for `u32` = note: required by `std::ops::Try::from_error` diff --git a/src/test/ui/suggestions/try-operator-on-main.stderr b/src/test/ui/suggestions/try-operator-on-main.stderr index 3b32b4a9eb7..e97823a3d5d 100644 --- a/src/test/ui/suggestions/try-operator-on-main.stderr +++ b/src/test/ui/suggestions/try-operator-on-main.stderr @@ -2,10 +2,7 @@ error[E0277]: the `?` operator can only be used in a function that returns `Resu --> $DIR/try-operator-on-main.rs:19:5 | 19 | std::fs::File::open("foo")?; //~ ERROR the `?` operator can only - | --------------------------- - | | - | cannot use the `?` operator in a function that returns `()` - | in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()` | = help: the trait `std::ops::Try` is not implemented for `()` = note: required by `std::ops::Try::from_error` @@ -14,10 +11,7 @@ error[E0277]: the `?` operator can only be applied to values that implement `std --> $DIR/try-operator-on-main.rs:22:5 | 22 | ()?; //~ ERROR the `?` operator can only - | --- - | | - | the `?` operator cannot be applied to type `()` - | in this macro invocation + | ^^^ the `?` operator cannot be applied to type `()` | = help: the trait `std::ops::Try` is not implemented for `()` = note: required by `std::ops::Try::into_result` @@ -38,10 +32,7 @@ error[E0277]: the `?` operator can only be applied to values that implement `std --> $DIR/try-operator-on-main.rs:32:5 | 32 | ()?; //~ ERROR the `?` operator can only - | --- - | | - | the `?` operator cannot be applied to type `()` - | in this macro invocation + | ^^^ the `?` operator cannot be applied to type `()` | = help: the trait `std::ops::Try` is not implemented for `()` = note: required by `std::ops::Try::into_result` |
