Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 17 pull requests #73947

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
912963b
Remove legacy InnoSetup GUI installer
ChrisDenton May 25, 2020
144206e
Don't implement Fn* traits for #[target_feature] functions
calebzulawski Jun 13, 2020
c98b4c8
Add error note when trying fn as Fn trait
calebzulawski Jun 13, 2020
765bd47
Recover extra trailing angle brackets in struct definition
Aaron1011 Jun 27, 2020
8e899b1
Don't implement Fn* for unsafe #[target_feature] functions
calebzulawski 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
e8f5785
Split and expand nonstandard-style lints unicode unit test.
crlf0710 Jun 28, 2020
49c1018
Fix markdown rendering in librustc_lexer docs
pierwill Jun 28, 2020
dd34698
Fix Zulip topic format
LeSeulArtichaut Jun 29, 2020
844dc31
ci: fix wasm32 broken due to a NodeJS version bump
pietroalbini Jun 30, 2020
f74a7d3
Clean up E0712 explanation
GuillaumeGomez Jun 30, 2020
c225e5c
Provide more information on duplicate lang item error.
ehuss Jun 17, 2020
1b3ef66
Switch crate_extern_paths to a query, and tweak wording.
ehuss Jun 27, 2020
0889d79
remove duplicate tests
lcnr Jun 30, 2020
e3cbb62
Rename TypeckTables to TypeckResults.
Lezzz Jun 4, 2020
51858da
Make #[target_feature] Fn trait error message less confusing
calebzulawski Jun 30, 2020
47425e4
Rewrite a few manual index loops with while-let
cuviper Jul 1, 2020
7616cd9
`#[deny(unsafe_op_in_unsafe_fn)]` in libstd/fs.rs
eltonlaw Jul 1, 2020
b438811
enable unsafe_op_in_unsafe_fn lint
eltonlaw Jul 1, 2020
a5764de
expand: Stop using nonterminals for passing tokens to attribute and d…
petrochenkov Jun 14, 2020
b37434e
Remove `token::FlattenGroup`
petrochenkov Jul 1, 2020
9ce1d19
Fix comment typo
kraai Jul 1, 2020
eb4ba55
Add an issue number for the pretty_printing_compatibility_hack FIXME
petrochenkov Jul 1, 2020
8f540c2
Rollup merge of #72569 - ChrisDenton:remove-innosetup, r=nikomatsakis
Manishearth Jul 2, 2020
13faeea
Rollup merge of #72983 - Lezzz:rename-typeck, r=nikomatsakis
Manishearth Jul 2, 2020
aacf886
Rollup merge of #73306 - calebzulawski:target-feature-11-fn-trait-sou…
Manishearth Jul 2, 2020
f228679
Rollup merge of #73345 - petrochenkov:nointerp, r=Aaron1011
Manishearth Jul 2, 2020
5c3f879
Rollup merge of #73449 - ehuss:duplicate-lang-item, r=matthewjasper
Manishearth Jul 2, 2020
fa2a99a
Rollup merge of #73803 - Aaron1011:feature/angle-field-recovery, r=ma…
Manishearth Jul 2, 2020
42005ab
Rollup merge of #73812 - petrochenkov:prettyref, r=varkor
Manishearth Jul 2, 2020
15c01a4
Rollup merge of #73839 - crlf0710:snapshot_the_reality, r=Manishearth
Manishearth Jul 2, 2020
bdda063
Rollup merge of #73841 - tmiasko:print-region-graph, r=Mark-Simulacrum
Manishearth Jul 2, 2020
80e6489
Rollup merge of #73848 - pierwill:pierwill-lexer-block-doc, r=jonas-s…
Manishearth Jul 2, 2020
187a6f4
Rollup merge of #73865 - LeSeulArtichaut:patch-1, r=Dylan-DPC
Manishearth Jul 2, 2020
7927a05
Rollup merge of #73885 - pietroalbini:ci-fix-wasm32, r=kennytm
Manishearth Jul 2, 2020
e4475fd
Rollup merge of #73892 - GuillaumeGomez:cleanup-e0712, r=Dylan-DPC
Manishearth Jul 2, 2020
e2f84f3
Rollup merge of #73898 - lcnr:issue61383, r=jonas-schievink
Manishearth Jul 2, 2020
c0cd0b9
Rollup merge of #73909 - eltonlaw:unsafe-libstd-fs-rs, r=sfackler
Manishearth Jul 2, 2020
385fa6b
Rollup merge of #73910 - cuviper:while-indexing, r=oli-obk
Manishearth Jul 2, 2020
b5c5382
Rollup merge of #73929 - kraai:fix-comment-typo, r=jonas-schievink
Manishearth Jul 2, 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.