提交 106e5c55 编写于 作者: E Esteban Küber

Don't add "in this macro invocation" label to desugared spans

上级 f90c4456
......@@ -767,6 +767,7 @@ fn fix_multispan_in_std_macros(&mut self,
}
// 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,
......
......@@ -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
......
......@@ -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`
......
......@@ -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`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册