Closed
Description
The following code
rust/src/librustc_passes/loops.rs
Lines 175 to 184 in 1e02bc6
Should either assign a new error code to the AsyncClosure
case, or move the common code to a closure and call it from those two branches to avoid using the same error code twice:
warning: diagnostic code E0267 already used
--> <::syntax::diagnostics::macros::struct_span_err macros>:3:6
|
1 | / ($ session : expr , $ span : expr , $ code : ident , $ ($ message : tt) *) =>
2 | | ({
3 | | __diagnostic_used ! ($ code) ; $ session . struct_span_err_with_code
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 | | ($ span , & format ! ($ ($ message) *) , $ crate :: errors ::
5 | | DiagnosticId :: Error (stringify ! ($ code) . to_owned ()) ,)
6 | | })
| |___- in this expansion of `struct_span_err!`
|
::: src/librustc_passes/loops.rs:181:17
|
181 | struct_span_err!(self.sess, span, E0267, "`{}` inside of an async block", name)
| ------------------------------------------------------------------------------- in this macro invocation
|
note: previous invocation
--> <::syntax::diagnostics::macros::struct_span_err macros>:3:6
|
1 | / ($ session : expr , $ span : expr , $ code : ident , $ ($ message : tt) *) =>
2 | | ({
3 | | __diagnostic_used ! ($ code) ; $ session . struct_span_err_with_code
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 | | ($ span , & format ! ($ ($ message) *) , $ crate :: errors ::
5 | | DiagnosticId :: Error (stringify ! ($ code) . to_owned ()) ,)
6 | | })
| |___- in this expansion of `struct_span_err!`
|
::: src/librustc_passes/loops.rs:176:17
|
176 | struct_span_err!(self.sess, span, E0267, "`{}` inside of a closure", name)
| -------------------------------------------------------------------------- in this macro invocation
This issue has been assigned to @u32i64 via this comment.