Commit f2b04ad
committed
Merge branch 'alic/binding_lint' into 'master'
chore: Enable linting error for `bindings_with_variant_name`
Reference for the lint: https://doc.rust-lang.org/beta/nightly-rustc/rustc_lint/builtin/static.BINDINGS_WITH_VARIANT_NAME.html
This lint is currently only a warning on our current Rust version. I recommend turning it into an error. The failure can be quite nasty. Consider this example:
```Rust
pub enum PayloadType { Summary, Data }
// ... later somewhere
let x = PayloadType::Data;
match x {
Summary => println!("summary"),
Data => println!("data"),
}
```
Now, in the ic repo, the above code will print "summary", because without the fully-qualified path, Summary is just a bound variable (instead of a sum type variant)
**This lint is deny-by-default since Rust 1.68.2 ([this MR](rust-lang/rust#104154)), but we're still on an older version. That's why I suggest we enable it pro-actively.**
See merge request dfinity-lab/public/ic!126361 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
0 commit comments