Skip to content

Commit 4e79067

Browse files
committed
Mark some items as allow(non_camel-case_types)
1 parent 93141a7 commit 4e79067

File tree

8 files changed

+22
-4
lines changed

8 files changed

+22
-4
lines changed

compiler/rustc_lint/src/nonstandard_style.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ fn is_camel_case(name: &str) -> bool {
9393
// contains a capitalisable character followed by, or preceded by, an underscore
9494
char_has_case(fst) && snd == '_' || char_has_case(snd) && fst == '_'
9595
})
96-
&& !name.chars().collect::<Vec<_>>().array_windows().any(|&[fst, snd, thr]| {
97-
fst.is_uppercase() && snd.is_uppercase() && thr.is_uppercase()
98-
})
96+
&& !name
97+
.chars()
98+
.collect::<Vec<_>>()
99+
.array_windows()
100+
.any(|&[fst, snd, thr]| fst.is_uppercase() && snd.is_uppercase() && thr.is_uppercase())
99101
}
100102

101103
fn to_camel_case(s: &str) -> String {

library/alloc/src/collections/btree/set_val.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/// Used instead of `()` to differentiate between:
33
/// * `BTreeMap<T, ()>` (possible user-defined map)
44
/// * `BTreeMap<T, SetValZST>` (internal set representation)
5+
#[allow(non_camel_case_types)]
56
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Default)]
67
pub struct SetValZST;
78

library/core/src/intrinsics.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2478,6 +2478,7 @@ extern "rust-intrinsic" {
24782478
/// `unreachable_unchecked` is actually being reached. The bug is in *crate A*,
24792479
/// which violates the principle that a `const fn` must behave the same at
24802480
/// compile-time and at run-time. The unsafe code in crate B is fine.
2481+
#[allow(non_camel_case_types)]
24812482
#[rustc_const_unstable(feature = "const_eval_select", issue = "none")]
24822483
pub fn const_eval_select<ARG: Tuple, F, G, RET>(
24832484
arg: ARG,

library/core/src/iter/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ macro_rules! impl_fold_via_try_fold {
368368
impl_fold_via_try_fold! { @internal spec_rfold -> spec_try_rfold }
369369
};
370370
(@internal $fold:ident -> $try_fold:ident) => {
371+
#[allow(non_camel_case_types)]
371372
#[inline]
372373
fn $fold<AAA, FFF>(mut self, init: AAA, fold: FFF) -> AAA
373374
where

library/std/src/path.rs

+2
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ pub enum Prefix<'a> {
153153
///
154154
/// Verbatim UNC prefixes consist of `\\?\UNC\` immediately followed by the
155155
/// server's hostname and a share name.
156+
#[allow(non_camel_case_types)]
156157
#[stable(feature = "rust1", since = "1.0.0")]
157158
VerbatimUNC(
158159
#[stable(feature = "rust1", since = "1.0.0")] &'a OsStr,
@@ -177,6 +178,7 @@ pub enum Prefix<'a> {
177178
/// `\\server\share`.
178179
///
179180
/// UNC prefixes consist of the server's hostname and a share name.
181+
#[allow(non_camel_case_types)]
180182
#[stable(feature = "rust1", since = "1.0.0")]
181183
UNC(
182184
#[stable(feature = "rust1", since = "1.0.0")] &'a OsStr,

library/std/src/sys/personality/dwarf/eh.rs

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pub const DW_EH_PE_aligned: u8 = 0x50;
3535

3636
pub const DW_EH_PE_indirect: u8 = 0x80;
3737

38+
#[allow(non_camel_case_types)]
3839
#[derive(Copy, Clone)]
3940
pub struct EHContext<'a> {
4041
pub ip: usize, // Current instruction pointer
@@ -43,6 +44,7 @@ pub struct EHContext<'a> {
4344
pub get_data_start: &'a dyn Fn() -> usize, // Get address of the data section
4445
}
4546

47+
#[allow(non_camel_case_types)]
4648
pub enum EHAction {
4749
None,
4850
Cleanup(usize),

library/test/src/term/win.rs

+5
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ pub(crate) struct WinConsole<T> {
1717
background: color::Color,
1818
}
1919

20+
#[allow(non_camel_case_types)]
2021
type SHORT = i16;
22+
#[allow(non_camel_case_types)]
2123
type WORD = u16;
24+
#[allow(non_camel_case_types)]
2225
type DWORD = u32;
26+
#[allow(non_camel_case_types)]
2327
type BOOL = i32;
28+
#[allow(non_camel_case_types)]
2429
type HANDLE = *mut u8;
2530

2631
#[allow(non_snake_case)]

src/tools/rustfmt/config_proc_macro/src/attrs.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ fn get_name_value_str_lit(attr: &syn::Attribute, name: &str) -> Option<String> {
6868
match &attr.meta {
6969
syn::Meta::NameValue(syn::MetaNameValue {
7070
path,
71-
value: syn::Expr::Lit(syn::ExprLit { lit: syn::Lit::Str(lit_str), .. }),
71+
value:
72+
syn::Expr::Lit(syn::ExprLit {
73+
lit: syn::Lit::Str(lit_str),
74+
..
75+
}),
7276
..
7377
}) if path.is_ident(name) => Some(lit_str.value()),
7478
_ => None,

0 commit comments

Comments
 (0)