about summary refs log tree commit diff
path: root/src/libstd/sys/unix/net.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-06-08 13:49:29 +0000
committerbors <bors@rust-lang.org>2020-06-08 13:49:29 +0000
commit08b84b3f76db772f4aee5385bf79545417763acf (patch)
tree86214f7bd6e8b6019dd46de753a2ce2ac040dfe8 /src/libstd/sys/unix/net.rs
parent67ec96c8f97ae810f72ccc08c8bf0c371ff11305 (diff)
parenta9ca832b11f7671f5d88f299a44415cf964304e7 (diff)
downloadrust-08b84b3f76db772f4aee5385bf79545417763acf.tar.gz
rust-08b84b3f76db772f4aee5385bf79545417763acf.zip
Auto merge of #5378 - Centril:unnested-or-pats, r=flip1995,phansch
New lint: `unnested_or_patterns`

changelog: Adds a lint `unnested_or_patterns`, suggesting `Some(0 | 2)` as opposed to `Some(0) | Some(2)`. The lint only fires on compilers capable of using `#![feature(or_patterns)]`.

- The lint is primarily encoded as a pure algorithm which to unnest or-patterns in an `ast::Pat` (`fn unnest_or_patterns`) through a `MutVisitor`. After that is done, and assuming that any change was detected, then `pprust::pat_to_string` is used to simply convert the transformed pattern into a suggestion.

- The PR introduces a module `utils::ast_utils` with a bunch of functions for spanless & nodeless equality comparisons of ASTs.

cc https://github.com/rust-lang/rust/issues/54883
Diffstat (limited to 'src/libstd/sys/unix/net.rs')
0 files changed, 0 insertions, 0 deletions