Make DRW
an option instead of raw pointer
#38
clippy
40 errors
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 40 |
Warning | 0 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.85.0-nightly (acabb5248 2024-12-04)
- cargo 1.85.0-nightly (05f54fdc3 2024-12-03)
- clippy 0.1.85 (acabb52482 2024-12-04)
Annotations
Check failure on line 363 in src/handlers.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/handlers.rs:363:29
|
363 | drw::resize(DRW.as_mut(), SW as c_uint, BH as c_uint);
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 2059 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:2059:27
|
2059 | drw::cur_free(DRW.as_mut().unwrap(), cur);
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1551 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1551:13
|
1551 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1547 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1547:27
|
1547 | drw::rect(DRW.as_mut(), x, 0, w as u32, BH as u32, 1, 1);
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1544 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1544:21
|
1544 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1533 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1533:25
|
1533 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1522 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1522:21
|
1522 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1514 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1514:21
|
1514 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1500 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1500:13
|
1500 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1498 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1498:24
|
1498 | drw::setscheme(DRW.as_mut(), *SCHEME.add(Scheme::Norm as usize));
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1482 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1482:21
|
1482 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1470 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1470:17
|
1470 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1460 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1460:17
|
1460 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1433 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1433:17
|
1433 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1430 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1430:28
|
1430 | drw::setscheme(DRW.as_mut(), *SCHEME.add(Scheme::Norm as usize));
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1416 in src/main.rs
github-actions / clippy
creating a shared reference to mutable static is discouraged
error: creating a shared reference to mutable static is discouraged
--> src/main.rs:1416:22
|
1416 | let boxw = (*DRW.as_ref().unwrap().fonts).h / 6 + 2;
| ^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
Check failure on line 1415 in src/main.rs
github-actions / clippy
creating a shared reference to mutable static is discouraged
error: creating a shared reference to mutable static is discouraged
--> src/main.rs:1415:22
|
1415 | let boxs = (*DRW.as_ref().unwrap().fonts).h / 9;
| ^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
Check failure on line 1407 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1407:36
|
1407 | unsafe { drw::fontset_getwidth(DRW.as_mut(), x) as c_int + LRPAD }
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1353 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1353:13
|
1353 | DRW.as_mut().unwrap().gc,
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1346 in src/main.rs
github-actions / clippy
creating a shared reference to mutable static is discouraged
error: creating a shared reference to mutable static is discouraged
--> src/main.rs:1346:13
|
1346 | DRW.as_ref().unwrap().gc,
| ^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
= note: `-D static-mut-refs` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(static_mut_refs)]`
Check failure on line 363 in src/handlers.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/handlers.rs:363:29
|
363 | drw::resize(DRW.as_mut(), SW as c_uint, BH as c_uint);
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 2059 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:2059:27
|
2059 | drw::cur_free(DRW.as_mut().unwrap(), cur);
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1551 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1551:13
|
1551 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1547 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1547:27
|
1547 | drw::rect(DRW.as_mut(), x, 0, w as u32, BH as u32, 1, 1);
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives
Check failure on line 1544 in src/main.rs
github-actions / clippy
creating a mutable reference to mutable static is discouraged
error: creating a mutable reference to mutable static is discouraged
--> src/main.rs:1544:21
|
1544 | DRW.as_mut(),
| ^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives