plex
plex copied to clipboard
Warnings caused by plex macros
I started seeing these on the newest rust nightly
kai@kai-thinkpad ~/d/plex (master)> cargo test
Compiling proc-macro2 v1.0.10
Compiling unicode-xid v0.2.0
Compiling bit-vec v0.4.4
Compiling syn v1.0.17
Compiling vec_map v0.6.0
Compiling lalr v0.0.2
Compiling bit-set v0.4.0
Compiling redfa v0.0.2
Compiling quote v1.0.3
Compiling plex v0.2.5 (/home/kai/dev/plex)
warning: unnecessary braces around block return value
--> examples/demo.rs:167:13
|
167 | Ident(var) Equals assign[rhs] => Expr {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these braces
|
= note: `#[warn(unused_braces)]` on by default
warning: unnecessary braces around block return value
--> examples/demo.rs:200:13
|
200 | Ident(i) => Expr {
| ^^^^^^^^ help: remove these braces
warning: unnecessary braces around block return value
--> examples/demo.rs:204:13
|
204 | Integer(i) => Expr {
| ^^^^^^^^^^ help: remove these braces
Finished test [unoptimized + debuginfo] target(s) in 22.71s
Running target/debug/deps/plex-1283d3a11f2149ad
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Doc-tests plex
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Adding #![allow(unused_braces)]
to src/lib.rs
fixes it when compiling plex itself but not when using the macro in other projects (or the tests above).
Additionally there's a bunch of clippy warnings that get triggered by plex: clippy::redundant_closure_call clippy::unused_unit clippy::match_single_binding clippy::let_unit_value clippy::unit_arg
It seems like most recent Rust nightly introduced a linter for unused braces as well. So plex now generates a bunch of errors during normal compilation also.
I will try to look into this sometime this week.