about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-01-05 05:20:23 +0000
committerbors <bors@rust-lang.org>2018-01-05 05:20:23 +0000
commit8a11b8cdd7cc7214c2bb9e77a6c961dd4dad9b7c (patch)
treef1c416eefbb3b14c40152ae70d33bb088bed9ad4 /src/test
parent5e66887fedefcae51ebf3beacefb0ded007700b1 (diff)
parent3dff918c6c3748104bf83db1b27fd13d51d587be (diff)
Auto merge of #46907 - varkor:contrib-8, r=nagisa
Allow non-alphabetic underscores in camel case

Certain identifiers, such as `X86_64`, cannot currently be unambiguously represented in camel case (`X8664`, `X86_64`, `X8_664`, etc. are all transformed to the same identifier). This change relaxes the rules so that underscores are permitted between two non-alphabetic characters under `#[forbid(non_camel_case_types)]`. Fixes #34633 and fixes #41621.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/lint-non-camel-case-types.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/compile-fail/lint-non-camel-case-types.rs b/src/test/compile-fail/lint-non-camel-case-types.rs
index f6d3d62d0bf..5dcdf3a863f 100644
--- a/src/test/compile-fail/lint-non-camel-case-types.rs
+++ b/src/test/compile-fail/lint-non-camel-case-types.rs
@@ -45,4 +45,12 @@ struct foo7 {
 
 type __ = isize; //~ ERROR type `__` should have a camel case name such as `CamelCase`
 
+struct X86_64;
+
+struct X86__64; //~ ERROR type `X86__64` should have a camel case name such as `X86_64`
+
+struct Abc_123; //~ ERROR type `Abc_123` should have a camel case name such as `Abc123`
+
+struct A1_b2_c3; //~ ERROR type `A1_b2_c3` should have a camel case name such as `A1B2C3`
+
 fn main() { }