You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
semicolon-if-nothing-returned: macro: type cannot be inferred #11277
warning: consider adding a `;` to the last statement for consistent formatting
--> ./tests/mir-opt/building/custom/enums.rs:17:5
|
17 | / mir!({
18 | | SetDiscriminant(*b, 0);
19 | | Return()
20 | | })
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
= note: requested on the command line with `-W clippy::semicolon-if-nothing-returned`
help: add a `;` here
|
17 ~ mir!({
18 + SetDiscriminant(*b, 0);
19 + Return()
20 + });
but if I add a semicolon, rustc find it cannot infer the type which it needs to make sure the macro does in fact return ()
error[E0282]: type annotations needed
--> ./tests/mir-opt/building/custom/enums.rs:17:5
|
17 | / mir!({
18 | | SetDiscriminant(*b, 0);
19 | | Return()
20 | | });
| |______^ cannot infer type
|
= note: this error originates in the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info)
Activity