File tree 10 files changed +36
-36
lines changed
rfcs/rfc-2457-non-ascii-idents
10 files changed +36
-36
lines changed Original file line number Diff line number Diff line change @@ -2212,7 +2212,6 @@ ui/issues/issue-41479.rs
2212
2212
ui/issues/issue-41498.rs
2213
2213
ui/issues/issue-41549.rs
2214
2214
ui/issues/issue-41604.rs
2215
- ui/issues/issue-41628.rs
2216
2215
ui/issues/issue-41652/auxiliary/issue-41652-b.rs
2217
2216
ui/issues/issue-41652/issue-41652.rs
2218
2217
ui/issues/issue-41677.rs
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ use ignore::Walk;
17
17
const ENTRY_LIMIT : u32 = 901 ;
18
18
// FIXME: The following limits should be reduced eventually.
19
19
20
- const ISSUES_ENTRY_LIMIT : u32 = 1624 ;
20
+ const ISSUES_ENTRY_LIMIT : u32 = 1623 ;
21
21
22
22
const EXPECTED_TEST_FILE_EXTENSIONS : & [ & str ] = & [
23
23
"rs" , // test source files
Original file line number Diff line number Diff line change
1
+ //! Checks that `#[used]` cannot be used on invalid positions.
2
+ #![ crate_type = "lib" ]
3
+
1
4
#[ used]
2
5
static FOO : u32 = 0 ; // OK
3
6
@@ -13,4 +16,8 @@ trait Bar {}
13
16
#[ used] //~ ERROR attribute must be applied to a `static` variable
14
17
impl Bar for Foo { }
15
18
16
- fn main ( ) { }
19
+ // Regression test for <https://github.com/rust-lang/rust/issues/126789>.
20
+ extern "C" {
21
+ #[ used] //~ ERROR attribute must be applied to a `static` variable
22
+ static BAR : i32 ;
23
+ }
Original file line number Diff line number Diff line change 1
1
error: attribute must be applied to a `static` variable
2
- --> $DIR/used.rs:4 :1
2
+ --> $DIR/used.rs:7 :1
3
3
|
4
4
LL | #[used]
5
5
| ^^^^^^^
6
6
LL | fn foo() {}
7
7
| ----------- but this is a function
8
8
9
9
error: attribute must be applied to a `static` variable
10
- --> $DIR/used.rs:7 :1
10
+ --> $DIR/used.rs:10 :1
11
11
|
12
12
LL | #[used]
13
13
| ^^^^^^^
14
14
LL | struct Foo {}
15
15
| ------------- but this is a struct
16
16
17
17
error: attribute must be applied to a `static` variable
18
- --> $DIR/used.rs:10 :1
18
+ --> $DIR/used.rs:13 :1
19
19
|
20
20
LL | #[used]
21
21
| ^^^^^^^
22
22
LL | trait Bar {}
23
23
| ------------ but this is a trait
24
24
25
25
error: attribute must be applied to a `static` variable
26
- --> $DIR/used.rs:13 :1
26
+ --> $DIR/used.rs:16 :1
27
27
|
28
28
LL | #[used]
29
29
| ^^^^^^^
30
30
LL | impl Bar for Foo {}
31
31
| ------------------- but this is a implementation block
32
32
33
- error: aborting due to 4 previous errors
33
+ error: attribute must be applied to a `static` variable
34
+ --> $DIR/used.rs:21:5
35
+ |
36
+ LL | #[used]
37
+ | ^^^^^^^
38
+ LL | static BAR: i32;
39
+ | ---------------- but this is a foreign static item
40
+
41
+ error: aborting due to 5 previous errors
34
42
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ //! Checks that the `dead_code` lint does not consider `#[used]` items unused.
2
+ //! Regression test for <https://github.com/rust-lang/rust/issues/41628>.
3
+
4
+ //@ check-pass
5
+ #![ deny( dead_code) ]
6
+
7
+ #[ used]
8
+ static FOO : u32 = 0 ;
9
+
10
+ fn main ( ) { }
File renamed without changes.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ //! Check that non-ascii-idents are allowed.
2
+
1
3
//@ check-pass
2
4
//
3
5
#![ allow( mixed_script_confusables, non_camel_case_types) ]
4
6
5
- fn foo <
6
- ' β ,
7
- γ
8
- > ( ) { }
7
+ fn foo < ' β , γ > ( ) { }
9
8
10
9
struct X {
11
- δ : usize
10
+ δ : usize ,
12
11
}
13
12
14
13
pub fn main ( ) {
You can’t perform that action at this time.
0 commit comments