11error: declaration of a `no_mangle` function
2- --> $DIR/lint-unsafe-code.rs:26 :14
2+ --> $DIR/lint-unsafe-code.rs:31 :14
33 |
44LL | #[no_mangle] fn foo() {}
55 | ^^^^^^^^^^^
@@ -11,91 +11,103 @@ LL | #![deny(unsafe_code)]
1111 | ^^^^^^^^^^^
1212
1313error: declaration of a `no_mangle` static
14- --> $DIR/lint-unsafe-code.rs:27 :14
14+ --> $DIR/lint-unsafe-code.rs:32 :14
1515 |
1616LL | #[no_mangle] static FOO: u32 = 5;
1717 | ^^^^^^^^^^^^^^^^^^^^
1818
19+ error: declaration of a function with `export_name`
20+ --> $DIR/lint-unsafe-code.rs:34:24
21+ |
22+ LL | #[export_name = "bar"] fn bar() {}
23+ | ^^^^^^^^^^^
24+
25+ error: declaration of a static with `export_name`
26+ --> $DIR/lint-unsafe-code.rs:35:24
27+ |
28+ LL | #[export_name = "BAR"] static BAR: u32 = 5;
29+ | ^^^^^^^^^^^^^^^^^^^^
30+
1931error: declaration of an `unsafe` function
20- --> $DIR/lint-unsafe-code.rs:29 :1
32+ --> $DIR/lint-unsafe-code.rs:37 :1
2133 |
2234LL | unsafe fn baz() {}
2335 | ^^^^^^^^^^^^^^^^^^
2436
2537error: declaration of an `unsafe` trait
26- --> $DIR/lint-unsafe-code.rs:30 :1
38+ --> $DIR/lint-unsafe-code.rs:38 :1
2739 |
2840LL | unsafe trait Foo {}
2941 | ^^^^^^^^^^^^^^^^^^^
3042
3143error: implementation of an `unsafe` trait
32- --> $DIR/lint-unsafe-code.rs:31 :1
44+ --> $DIR/lint-unsafe-code.rs:39 :1
3345 |
3446LL | unsafe impl Foo for Bar {}
3547 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
3648
3749error: declaration of an `unsafe` method
38- --> $DIR/lint-unsafe-code.rs:34 :5
50+ --> $DIR/lint-unsafe-code.rs:42 :5
3951 |
4052LL | unsafe fn baz(&self);
4153 | ^^^^^^^^^^^^^^^^^^^^^
4254
4355error: implementation of an `unsafe` method
44- --> $DIR/lint-unsafe-code.rs:35 :5
56+ --> $DIR/lint-unsafe-code.rs:43 :5
4557 |
4658LL | unsafe fn provided(&self) {}
4759 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4860
4961error: implementation of an `unsafe` method
50- --> $DIR/lint-unsafe-code.rs:36 :5
62+ --> $DIR/lint-unsafe-code.rs:44 :5
5163 |
5264LL | unsafe fn provided_override(&self) {}
5365 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5466
5567error: implementation of an `unsafe` method
56- --> $DIR/lint-unsafe-code.rs:40 :5
68+ --> $DIR/lint-unsafe-code.rs:48 :5
5769 |
5870LL | unsafe fn baz(&self) {}
5971 | ^^^^^^^^^^^^^^^^^^^^^^^
6072
6173error: implementation of an `unsafe` method
62- --> $DIR/lint-unsafe-code.rs:41 :5
74+ --> $DIR/lint-unsafe-code.rs:49 :5
6375 |
6476LL | unsafe fn provided_override(&self) {}
6577 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6678
6779error: implementation of an `unsafe` method
68- --> $DIR/lint-unsafe-code.rs:60 :5
80+ --> $DIR/lint-unsafe-code.rs:68 :5
6981 |
7082LL | unsafe fn provided_override(&self) {}
7183 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7284
7385error: implementation of an `unsafe` method
74- --> $DIR/lint-unsafe-code.rs:71 :5
86+ --> $DIR/lint-unsafe-code.rs:79 :5
7587 |
7688LL | unsafe fn provided(&self) {}
7789 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7890
7991error: implementation of an `unsafe` method
80- --> $DIR/lint-unsafe-code.rs:77 :5
92+ --> $DIR/lint-unsafe-code.rs:85 :5
8193 |
8294LL | unsafe fn provided(&self) {}
8395 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8496
8597error: implementation of an `unsafe` method
86- --> $DIR/lint-unsafe-code.rs:81 :5
98+ --> $DIR/lint-unsafe-code.rs:89 :5
8799 |
88100LL | unsafe fn baz(&self) {}
89101 | ^^^^^^^^^^^^^^^^^^^^^^^
90102
91103error: usage of an `unsafe` block
92- --> $DIR/lint-unsafe-code.rs:92 :5
104+ --> $DIR/lint-unsafe-code.rs:100 :5
93105 |
94106LL | unsafe {}
95107 | ^^^^^^^^^
96108
97109error: declaration of a `no_mangle` function
98- --> $DIR/lint-unsafe-code.rs:20 :22
110+ --> $DIR/lint-unsafe-code.rs:21 :22
99111 |
100112LL | #[no_mangle] fn foo() {}
101113 | ^^^^^^^^^^^
@@ -106,7 +118,7 @@ LL | unsafe_in_macro!()
106118 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
107119
108120error: declaration of a `no_mangle` static
109- --> $DIR/lint-unsafe-code.rs:21 :22
121+ --> $DIR/lint-unsafe-code.rs:22 :22
110122 |
111123LL | #[no_mangle] static FOO: u32 = 5;
112124 | ^^^^^^^^^^^^^^^^^^^^
@@ -116,8 +128,30 @@ LL | unsafe_in_macro!()
116128 |
117129 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
118130
131+ error: declaration of a function with `export_name`
132+ --> $DIR/lint-unsafe-code.rs:23:32
133+ |
134+ LL | #[export_name = "bar"] fn bar() {}
135+ | ^^^^^^^^^^^
136+ ...
137+ LL | unsafe_in_macro!()
138+ | ------------------ in this macro invocation
139+ |
140+ = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
141+
142+ error: declaration of a static with `export_name`
143+ --> $DIR/lint-unsafe-code.rs:25:32
144+ |
145+ LL | #[export_name = "BAR"] static BAR: u32 = 5;
146+ | ^^^^^^^^^^^^^^^^^^^^
147+ ...
148+ LL | unsafe_in_macro!()
149+ | ------------------ in this macro invocation
150+ |
151+ = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
152+
119153error: usage of an `unsafe` block
120- --> $DIR/lint-unsafe-code.rs:22 :9
154+ --> $DIR/lint-unsafe-code.rs:27 :9
121155 |
122156LL | unsafe {}
123157 | ^^^^^^^^^
@@ -127,5 +161,5 @@ LL | unsafe_in_macro!()
127161 |
128162 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
129163
130- error: aborting due to 18 previous errors
164+ error: aborting due to 22 previous errors
131165
0 commit comments