1- error: declaration of an `unsafe ` function
2- --> $DIR/lint-unsafe-code.rs:23:1
1+ error: declaration of a `no_mangle ` function
2+ --> $DIR/lint-unsafe-code.rs:26:14
33 |
4- LL | unsafe fn baz () {}
5- | ^^^^^^^ ^^^^^^^^^^^
4+ LL | #[no_mangle] fn foo () {}
5+ | ^^^^^^^^^^^
66 |
77note: the lint level is defined here
88 --> $DIR/lint-unsafe-code.rs:3:9
99 |
1010LL | #![deny(unsafe_code)]
1111 | ^^^^^^^^^^^
1212
13+ error: declaration of a `no_mangle` static
14+ --> $DIR/lint-unsafe-code.rs:27:14
15+ |
16+ LL | #[no_mangle] static FOO: u32 = 5;
17+ | ^^^^^^^^^^^^^^^^^^^^
18+
19+ error: declaration of an `unsafe` function
20+ --> $DIR/lint-unsafe-code.rs:29:1
21+ |
22+ LL | unsafe fn baz() {}
23+ | ^^^^^^^^^^^^^^^^^^
24+
1325error: declaration of an `unsafe` trait
14- --> $DIR/lint-unsafe-code.rs:24 :1
26+ --> $DIR/lint-unsafe-code.rs:30 :1
1527 |
1628LL | unsafe trait Foo {}
1729 | ^^^^^^^^^^^^^^^^^^^
1830
1931error: implementation of an `unsafe` trait
20- --> $DIR/lint-unsafe-code.rs:25 :1
32+ --> $DIR/lint-unsafe-code.rs:31 :1
2133 |
2234LL | unsafe impl Foo for Bar {}
2335 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
2436
2537error: declaration of an `unsafe` method
26- --> $DIR/lint-unsafe-code.rs:28 :5
38+ --> $DIR/lint-unsafe-code.rs:34 :5
2739 |
2840LL | unsafe fn baz(&self);
2941 | ^^^^^^^^^^^^^^^^^^^^^
3042
3143error: implementation of an `unsafe` method
32- --> $DIR/lint-unsafe-code.rs:29 :5
44+ --> $DIR/lint-unsafe-code.rs:35 :5
3345 |
3446LL | unsafe fn provided(&self) {}
3547 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3648
3749error: implementation of an `unsafe` method
38- --> $DIR/lint-unsafe-code.rs:30 :5
50+ --> $DIR/lint-unsafe-code.rs:36 :5
3951 |
4052LL | unsafe fn provided_override(&self) {}
4153 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4254
4355error: implementation of an `unsafe` method
44- --> $DIR/lint-unsafe-code.rs:34 :5
56+ --> $DIR/lint-unsafe-code.rs:40 :5
4557 |
4658LL | unsafe fn baz(&self) {}
4759 | ^^^^^^^^^^^^^^^^^^^^^^^
4860
4961error: implementation of an `unsafe` method
50- --> $DIR/lint-unsafe-code.rs:35 :5
62+ --> $DIR/lint-unsafe-code.rs:41 :5
5163 |
5264LL | unsafe fn provided_override(&self) {}
5365 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5466
5567error: implementation of an `unsafe` method
56- --> $DIR/lint-unsafe-code.rs:54 :5
68+ --> $DIR/lint-unsafe-code.rs:60 :5
5769 |
5870LL | unsafe fn provided_override(&self) {}
5971 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6072
6173error: implementation of an `unsafe` method
62- --> $DIR/lint-unsafe-code.rs:65 :5
74+ --> $DIR/lint-unsafe-code.rs:71 :5
6375 |
6476LL | unsafe fn provided(&self) {}
6577 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6678
6779error: implementation of an `unsafe` method
68- --> $DIR/lint-unsafe-code.rs:71 :5
80+ --> $DIR/lint-unsafe-code.rs:77 :5
6981 |
7082LL | unsafe fn provided(&self) {}
7183 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7284
7385error: implementation of an `unsafe` method
74- --> $DIR/lint-unsafe-code.rs:75 :5
86+ --> $DIR/lint-unsafe-code.rs:81 :5
7587 |
7688LL | unsafe fn baz(&self) {}
7789 | ^^^^^^^^^^^^^^^^^^^^^^^
7890
7991error: usage of an `unsafe` block
80- --> $DIR/lint-unsafe-code.rs:86 :5
92+ --> $DIR/lint-unsafe-code.rs:92 :5
8193 |
8294LL | unsafe {}
8395 | ^^^^^^^^^
8496
97+ error: declaration of a `no_mangle` function
98+ --> $DIR/lint-unsafe-code.rs:20:22
99+ |
100+ LL | #[no_mangle] fn foo() {}
101+ | ^^^^^^^^^^^
102+ ...
103+ LL | unsafe_in_macro!()
104+ | ------------------ in this macro invocation
105+ |
106+ = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
107+
108+ error: declaration of a `no_mangle` static
109+ --> $DIR/lint-unsafe-code.rs:21:22
110+ |
111+ LL | #[no_mangle] static FOO: u32 = 5;
112+ | ^^^^^^^^^^^^^^^^^^^^
113+ ...
114+ LL | unsafe_in_macro!()
115+ | ------------------ in this macro invocation
116+ |
117+ = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
118+
85119error: usage of an `unsafe` block
86- --> $DIR/lint-unsafe-code.rs:19 :9
120+ --> $DIR/lint-unsafe-code.rs:22 :9
87121 |
88122LL | unsafe {}
89123 | ^^^^^^^^^
@@ -93,5 +127,5 @@ LL | unsafe_in_macro!()
93127 |
94128 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
95129
96- error: aborting due to 14 previous errors
130+ error: aborting due to 18 previous errors
97131
0 commit comments