Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
886f81e
Fix sentence structure
Anirban166 Jun 23, 2020
0c88dd6
Update Box::from_raw example to generalize better
Keno Jun 24, 2020
3b5d7f8
Minor correction to sentence structure
Anirban166 Jun 24, 2020
d6cf8fc
Update README.md
Anirban166 Jun 24, 2020
2bbc2b3
Document the static keyword
poliorcetics Jun 25, 2020
22fc18f
Commit suggestion
Anirban166 Jun 25, 2020
8edcc6d
Add alternate text for rust logo image
Anirban166 Jun 25, 2020
3a1ac28
Added clickable-link
Anirban166 Jun 25, 2020
4c33b7c
Add responsiveness to logo
Anirban166 Jun 25, 2020
00ef461
Merge pull request #2 from rust-lang/master
TyPR124 Jun 26, 2020
b71a3e1
Map ERROR_INVALID_PARAMETER to InvalidInput
TyPR124 Jun 26, 2020
df88972
Update psm version
nagisa Jun 26, 2020
79a42e3
linker: Create GNU_EH_FRAME header by default when producing ELFs
petrochenkov Jun 20, 2020
765bd47
Recover extra trailing angle brackets in struct definition
Aaron1011 Jun 27, 2020
3fc5593
Document the type keyword
poliorcetics Jun 27, 2020
7055c23
ast_pretty: Pass some token streams and trees by reference
petrochenkov Jun 24, 2020
14d0370
Remove defunct `-Z print-region-graph`
tmiasko Jun 28, 2020
7231e57
Fix wording for anonymous parameter name help
nop Jun 28, 2020
e611a3f
Apply suggestions from code review
poliorcetics Jun 28, 2020
e8f5785
Split and expand nonstandard-style lints unicode unit test.
crlf0710 Jun 28, 2020
dfd454b
Apply suggestions, reformulating some paragraphs and improving some e…
poliorcetics Jun 28, 2020
4224313
Fix small nits
poliorcetics Jun 28, 2020
5239a68
add spans to injected coverage counters
richkadel Jun 22, 2020
f3645ca
remove rustdoc warnings
tshepang Jun 30, 2020
8afebc0
Stabilize `#[track_caller]`.
anp May 21, 2020
de36943
Rollup merge of #72445 - anp:stabilize-track-caller, r=oli-obk
Manishearth Jun 30, 2020
d8f38e9
Rollup merge of #73548 - tshepang:fix-rustdoc-warnings, r=ecstatic-morse
Manishearth Jun 30, 2020
9f330e4
Rollup merge of #73564 - petrochenkov:ehdr, r=Amanieu
Manishearth Jun 30, 2020
3de07e0
Rollup merge of #73649 - Anirban166:patch-1, r=steveklabnik
Manishearth Jun 30, 2020
c0809ed
Rollup merge of #73678 - Keno:patch-1, r=LukasKalbertodt
Manishearth Jun 30, 2020
dfefa37
Rollup merge of #73684 - richkadel:llvm-coverage-map-gen-2, r=wesleyw…
Manishearth Jun 30, 2020
78edd26
Rollup merge of #73716 - poliorcetics:static-keyword, r=LukasKalbertodt
Manishearth Jun 30, 2020
8c3acfc
Rollup merge of #73752 - TyPR124:invalid-parameter-error, r=LukasKalb…
Manishearth Jun 30, 2020
b849298
Rollup merge of #73781 - nagisa:psm-up, r=Mark-Simulacrum
Manishearth Jun 30, 2020
fc12919
Rollup merge of #73803 - Aaron1011:feature/angle-field-recovery, r=ma…
Manishearth Jun 30, 2020
f180d3d
Rollup merge of #73805 - poliorcetics:type-keyword, r=kennytm
Manishearth Jun 30, 2020
cfe8a08
Rollup merge of #73812 - petrochenkov:prettyref, r=varkor
Manishearth Jun 30, 2020
901ce7c
Rollup merge of #73828 - nop:fix/parameter-name-help, r=estebank
Manishearth Jun 30, 2020
9796035
Rollup merge of #73839 - crlf0710:snapshot_the_reality, r=Manishearth
Manishearth Jun 30, 2020
62793dc
Rollup merge of #73841 - tmiasko:print-region-graph, r=Mark-Simulacrum
Manishearth Jun 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Split and expand nonstandard-style lints unicode unit test.
  • Loading branch information
crlf0710 committed Jun 28, 2020
commit e8f5785bfc3123b67e79e509c76259062e214b97
50 changes: 50 additions & 0 deletions src/test/ui/lint/lint-nonstandard-style-unicode-1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#![allow(dead_code)]

#![forbid(non_camel_case_types)]
#![feature(non_ascii_idents)]

// Some scripts (e.g., hiragana) don't have a concept of
// upper/lowercase

// 1. non_camel_case_types

// Can start with non-lowercase letter
struct Θχ;
struct ヒa;

struct χa;
//~^ ERROR type `χa` should have an upper camel case name

// If there's already leading or trailing underscores, they get trimmed before checking.
// This is fine:
struct _ヒb;

// This is not:
struct __χa;
//~^ ERROR type `__χa` should have an upper camel case name

// Besides this, we cannot have two continous underscores in the middle.

struct 对__否;
//~^ ERROR type `对__否` should have an upper camel case name

struct ヒ__χ;
//~^ ERROR type `ヒ__χ` should have an upper camel case name

// also cannot have lowercase letter next to a underscore.
// so this triggers the lint:

struct Hello_你好;
//~^ ERROR type `Hello_你好` should have an upper camel case name

struct Hello_World;
//~^ ERROR type `Hello_World` should have an upper camel case name

struct 你_ӟ;
//~^ ERROR type `你_ӟ` should have an upper camel case name

// and this is ok:

struct 你_好;

fn main() {}
50 changes: 50 additions & 0 deletions src/test/ui/lint/lint-nonstandard-style-unicode-1.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
error: type `χa` should have an upper camel case name
--> $DIR/lint-nonstandard-style-unicode-1.rs:15:8
|
LL | struct χa;
| ^^ help: convert the identifier to upper camel case: `Χa`
|
note: the lint level is defined here
--> $DIR/lint-nonstandard-style-unicode-1.rs:3:11
|
LL | #![forbid(non_camel_case_types)]
| ^^^^^^^^^^^^^^^^^^^^

error: type `__χa` should have an upper camel case name
--> $DIR/lint-nonstandard-style-unicode-1.rs:23:8
|
LL | struct __χa;
| ^^^^ help: convert the identifier to upper camel case: `Χa`

error: type `对__否` should have an upper camel case name
--> $DIR/lint-nonstandard-style-unicode-1.rs:28:8
|
LL | struct 对__否;
| ^^^^^^ help: convert the identifier to upper camel case: `对_否`

error: type `ヒ__χ` should have an upper camel case name
--> $DIR/lint-nonstandard-style-unicode-1.rs:31:8
|
LL | struct ヒ__χ;
| ^^^^^ help: convert the identifier to upper camel case: `ヒΧ`

error: type `Hello_你好` should have an upper camel case name
--> $DIR/lint-nonstandard-style-unicode-1.rs:37:8
|
LL | struct Hello_你好;
| ^^^^^^^^^^ help: convert the identifier to upper camel case: `Hello你好`

error: type `Hello_World` should have an upper camel case name
--> $DIR/lint-nonstandard-style-unicode-1.rs:40:8
|
LL | struct Hello_World;
| ^^^^^^^^^^^ help: convert the identifier to upper camel case: `HelloWorld`

error: type `你_ӟ` should have an upper camel case name
--> $DIR/lint-nonstandard-style-unicode-1.rs:43:8
|
LL | struct 你_ӟ;
| ^^^^ help: convert the identifier to upper camel case: `你Ӟ`

error: aborting due to 7 previous errors

30 changes: 30 additions & 0 deletions src/test/ui/lint/lint-nonstandard-style-unicode-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#![allow(dead_code)]

#![forbid(non_snake_case)]
#![feature(non_ascii_idents)]

// Some scripts (e.g., hiragana) don't have a concept of
// upper/lowercase

// 2. non_snake_case

// Can only use non-uppercase letters.
// So this works:

fn 编程() {}

// but this doesn't:

fn Ц() {}
//~^ ERROR function `Ц` should have a snake case name

// besides this, you cannot use continous underscores in the middle

fn 分__隔() {}
//~^ ERROR function `分__隔` should have a snake case name

// but you can use them both at the beginning and at the end.

fn _______不_连_续_的_存_在_______() {}

fn main() {}
20 changes: 20 additions & 0 deletions src/test/ui/lint/lint-nonstandard-style-unicode-2.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
error: function `Ц` should have a snake case name
--> $DIR/lint-nonstandard-style-unicode-2.rs:18:4
|
LL | fn Ц() {}
| ^ help: convert the identifier to snake case: `ц`
|
note: the lint level is defined here
--> $DIR/lint-nonstandard-style-unicode-2.rs:3:11
|
LL | #![forbid(non_snake_case)]
| ^^^^^^^^^^^^^^

error: function `分__隔` should have a snake case name
--> $DIR/lint-nonstandard-style-unicode-2.rs:23:4
|
LL | fn 分__隔() {}
| ^^^^^^ help: convert the identifier to snake case: `分_隔`

error: aborting due to 2 previous errors

25 changes: 25 additions & 0 deletions src/test/ui/lint/lint-nonstandard-style-unicode-3.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#![allow(dead_code)]

#![forbid(non_upper_case_globals)]
#![feature(non_ascii_idents)]

// Some scripts (e.g., hiragana) don't have a concept of
// upper/lowercase

// 3. non_upper_case_globals

// Can only use non-lowercase letters.
// So this works:

static ラ: usize = 0;

// but this doesn't:

static τεχ: f32 = 3.14159265;
//~^ ERROR static variable `τεχ` should have an upper case name

// This has no limit at all on underscore usages.

static __密__封__线__内__禁__止__答__题__: bool = true;

fn main() {}
14 changes: 14 additions & 0 deletions src/test/ui/lint/lint-nonstandard-style-unicode-3.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: static variable `τεχ` should have an upper case name
--> $DIR/lint-nonstandard-style-unicode-3.rs:18:8
|
LL | static τεχ: f32 = 3.14159265;
| ^^^ help: convert the identifier to upper case: `ΤΕΧ`
|
note: the lint level is defined here
--> $DIR/lint-nonstandard-style-unicode-3.rs:3:11
|
LL | #![forbid(non_upper_case_globals)]
| ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

16 changes: 0 additions & 16 deletions src/test/ui/lint/lint-nonstandard-style-unicode.rs

This file was deleted.