diff options
| author | bors <bors@rust-lang.org> | 2021-12-28 12:01:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-12-28 12:01:21 +0000 |
| commit | 56ccd30a27e6125ee6b66a391a27ba506f7dd1ec (patch) | |
| tree | ee15bbb8fe9eac302434d539fa7688694aad6094 /compiler/rustc_llvm | |
| parent | 526fb6b7eaf374f9f1bc62afbe0250791f1a5253 (diff) | |
| parent | b82c9ce3af0bd338ef3e532eae8a9f87d6981bf0 (diff) | |
| download | rust-56ccd30a27e6125ee6b66a391a27ba506f7dd1ec.tar.gz rust-56ccd30a27e6125ee6b66a391a27ba506f7dd1ec.zip | |
Auto merge of #8127 - dswij:8090, r=xFrednet
Fix `enum_variants` FP on prefixes that are not camel-case
closes #8090
Fix FP on `enum_variants` when prefixes are only a substring of a camel-case word. Also adds some util helpers on `str_utils` to help parsing camel-case strings.
This changes how the lint behaves:
1. previously if the Prefix is only a length of 1, it's going to get ignored, i.e. these were previously ignored and now is warned
```rust
enum Foo {
cFoo,
cBar,
cBaz,
}
enum Something {
CCall,
CCreate,
CCryogenize,
}
```
2. non-ascii characters that doesn't have casing will not be split,
```rust
enum NonCaps {
PrefixXXX,
PrefixTea,
PrefixCake,
}
```
will be considered as `PrefixXXX`, `Prefix`, `Prefix`, so this won't lint as opposed to fired previously.
changelog: [`enum_variant_names`] Fix FP when first prefix are only a substring of a camel-case word.
---
(Edited by `@xFrednet` removed some non ascii characters)
Diffstat (limited to 'compiler/rustc_llvm')
0 files changed, 0 insertions, 0 deletions
