]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-unsafe-code.stderr
Adjust `#[no_mangle]`-related checks and lints for `impl` items
[rust.git] / src / test / ui / lint / lint-unsafe-code.stderr
1 error: declaration of a `no_mangle` function
2   --> $DIR/lint-unsafe-code.rs:31:1
3    |
4 LL | #[no_mangle] fn foo() {}
5    | ^^^^^^^^^^^^
6    |
7 note: the lint level is defined here
8   --> $DIR/lint-unsafe-code.rs:3:9
9    |
10 LL | #![deny(unsafe_code)]
11    |         ^^^^^^^^^^^
12    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
13
14 error: declaration of a `no_mangle` static
15   --> $DIR/lint-unsafe-code.rs:32:1
16    |
17 LL | #[no_mangle] static FOO: u32 = 5;
18    | ^^^^^^^^^^^^
19    |
20    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
21
22 error: declaration of a `no_mangle` method
23   --> $DIR/lint-unsafe-code.rs:41:5
24    |
25 LL |     #[no_mangle] fn foo() {}
26    |     ^^^^^^^^^^^^
27    |
28    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
29
30 error: declaration of a `no_mangle` method
31   --> $DIR/lint-unsafe-code.rs:45:5
32    |
33 LL |     #[no_mangle] fn foo() {}
34    |     ^^^^^^^^^^^^
35    |
36    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
37
38 error: declaration of a function with `export_name`
39   --> $DIR/lint-unsafe-code.rs:48:1
40    |
41 LL | #[export_name = "bar"] fn bar() {}
42    | ^^^^^^^^^^^^^^^^^^^^^^
43    |
44    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
45
46 error: declaration of a static with `export_name`
47   --> $DIR/lint-unsafe-code.rs:49:1
48    |
49 LL | #[export_name = "BAR"] static BAR: u32 = 5;
50    | ^^^^^^^^^^^^^^^^^^^^^^
51    |
52    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
53
54 error: declaration of a method with `export_name`
55   --> $DIR/lint-unsafe-code.rs:54:5
56    |
57 LL |     #[export_name = "bar"] fn bar() {}
58    |     ^^^^^^^^^^^^^^^^^^^^^^
59    |
60    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
61
62 error: declaration of a method with `export_name`
63   --> $DIR/lint-unsafe-code.rs:58:5
64    |
65 LL |     #[export_name = "bar"] fn foo() {}
66    |     ^^^^^^^^^^^^^^^^^^^^^^
67    |
68    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
69
70 error: declaration of an `unsafe` function
71   --> $DIR/lint-unsafe-code.rs:61:1
72    |
73 LL | unsafe fn baz() {}
74    | ^^^^^^^^^^^^^^^^^^
75
76 error: declaration of an `unsafe` trait
77   --> $DIR/lint-unsafe-code.rs:62:1
78    |
79 LL | unsafe trait Foo {}
80    | ^^^^^^^^^^^^^^^^^^^
81
82 error: implementation of an `unsafe` trait
83   --> $DIR/lint-unsafe-code.rs:63:1
84    |
85 LL | unsafe impl Foo for Bar {}
86    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
87
88 error: declaration of an `unsafe` method
89   --> $DIR/lint-unsafe-code.rs:66:5
90    |
91 LL |     unsafe fn baz(&self);
92    |     ^^^^^^^^^^^^^^^^^^^^^
93
94 error: implementation of an `unsafe` method
95   --> $DIR/lint-unsafe-code.rs:67:5
96    |
97 LL |     unsafe fn provided(&self) {}
98    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99
100 error: implementation of an `unsafe` method
101   --> $DIR/lint-unsafe-code.rs:68:5
102    |
103 LL |     unsafe fn provided_override(&self) {}
104    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
105
106 error: implementation of an `unsafe` method
107   --> $DIR/lint-unsafe-code.rs:72:5
108    |
109 LL |     unsafe fn baz(&self) {}
110    |     ^^^^^^^^^^^^^^^^^^^^^^^
111
112 error: implementation of an `unsafe` method
113   --> $DIR/lint-unsafe-code.rs:73:5
114    |
115 LL |     unsafe fn provided_override(&self) {}
116    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
117
118 error: implementation of an `unsafe` method
119   --> $DIR/lint-unsafe-code.rs:92:5
120    |
121 LL |     unsafe fn provided_override(&self) {}
122    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123
124 error: implementation of an `unsafe` method
125   --> $DIR/lint-unsafe-code.rs:103:5
126    |
127 LL |     unsafe fn provided(&self) {}
128    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129
130 error: implementation of an `unsafe` method
131   --> $DIR/lint-unsafe-code.rs:109:5
132    |
133 LL |     unsafe fn provided(&self) {}
134    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
135
136 error: implementation of an `unsafe` method
137   --> $DIR/lint-unsafe-code.rs:113:5
138    |
139 LL |     unsafe fn baz(&self) {}
140    |     ^^^^^^^^^^^^^^^^^^^^^^^
141
142 error: usage of an `unsafe` block
143   --> $DIR/lint-unsafe-code.rs:124:5
144    |
145 LL |     unsafe {}
146    |     ^^^^^^^^^
147
148 error: declaration of a `no_mangle` function
149   --> $DIR/lint-unsafe-code.rs:21:9
150    |
151 LL |         #[no_mangle] fn foo() {}
152    |         ^^^^^^^^^^^^
153 ...
154 LL |     unsafe_in_macro!()
155    |     ------------------ in this macro invocation
156    |
157    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
158    = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
159
160 error: declaration of a `no_mangle` static
161   --> $DIR/lint-unsafe-code.rs:22:9
162    |
163 LL |         #[no_mangle] static FOO: u32 = 5;
164    |         ^^^^^^^^^^^^
165 ...
166 LL |     unsafe_in_macro!()
167    |     ------------------ in this macro invocation
168    |
169    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
170    = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
171
172 error: declaration of a function with `export_name`
173   --> $DIR/lint-unsafe-code.rs:23:9
174    |
175 LL |         #[export_name = "bar"] fn bar() {}
176    |         ^^^^^^^^^^^^^^^^^^^^^^
177 ...
178 LL |     unsafe_in_macro!()
179    |     ------------------ in this macro invocation
180    |
181    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
182    = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
183
184 error: declaration of a static with `export_name`
185   --> $DIR/lint-unsafe-code.rs:25:9
186    |
187 LL |         #[export_name = "BAR"] static BAR: u32 = 5;
188    |         ^^^^^^^^^^^^^^^^^^^^^^
189 ...
190 LL |     unsafe_in_macro!()
191    |     ------------------ in this macro invocation
192    |
193    = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
194    = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
195
196 error: usage of an `unsafe` block
197   --> $DIR/lint-unsafe-code.rs:27:9
198    |
199 LL |         unsafe {}
200    |         ^^^^^^^^^
201 ...
202 LL |     unsafe_in_macro!()
203    |     ------------------ in this macro invocation
204    |
205    = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
206
207 error: aborting due to 26 previous errors
208