]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsafe/unsafe-not-inherited.stderr
Rollup merge of #106043 - c410-f3r:moar-errors, r=petrochenkov
[rust.git] / src / test / ui / unsafe / unsafe-not-inherited.stderr
1 error[E0133]: use of mutable static is unsafe and requires unsafe function or block
2   --> $DIR/unsafe-not-inherited.rs:6:31
3    |
4 LL |     unsafe {static BAR: u64 = FOO;}
5    |     ------                    ^^^ use of mutable static
6    |     |
7    |     items do not inherit unsafety from separate enclosing items
8    |
9    = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
10
11 error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
12   --> $DIR/unsafe-not-inherited.rs:18:13
13    |
14 LL |     unsafe {
15    |     ------ items do not inherit unsafety from separate enclosing items
16 ...
17 LL |             unsafe_call();
18    |             ^^^^^^^^^^^^^ call to unsafe function
19    |
20    = note: consult the function's documentation for information on how to avoid undefined behavior
21
22 error: aborting due to 2 previous errors
23
24 For more information about this error, try `rustc --explain E0133`.