Skip to content

Make DRW an option instead of raw pointer #130

Make DRW an option instead of raw pointer

Make DRW an option instead of raw pointer #130

GitHub Actions / clippy failed Dec 5, 2024 in 1s

clippy

54 errors

Details

Results

Message level Amount
Internal compiler error 0
Error 54
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

See this annotation in the file changed.

@github-actions 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 2065 in src/main.rs

See this annotation in the file changed.

@github-actions 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:2065:27
     |
2065 |             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 1557 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1557:13
     |
1557 |             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 1553 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1553:27
     |
1553 |                 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 1550 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1550:21
     |
1550 |                     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 1539 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1539:25
     |
1539 |                         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 1528 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1528:21
     |
1528 |                     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 1520 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1520:21
     |
1520 |                     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 1506 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1506:13
     |
1506 |             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 1504 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1504:24
     |
1504 |         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 1488 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1488:21
     |
1488 |                     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 1476 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1476:17
     |
1476 |                 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 1466 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1466:17
     |
1466 |                 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 1439 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1439:17
     |
1439 |                 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 1436 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1436:28
     |
1436 |             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 1422 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1422:22
     |
1422 |         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 1421 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1421:22
     |
1421 |         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 1413 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1413:36
     |
1413 |     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 1359 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1359:13
     |
1359 |             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 1352 in src/main.rs

See this annotation in the file changed.

@github-actions 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:1352:13
     |
1352 |             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 355 in src/main.rs

See this annotation in the file changed.

@github-actions 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:355:33
    |
355 |                 drw::scm_create(DRW.as_mut(), &CONFIG.colors[i], 3);
    |                                 ^^^^^^^^^^^^ 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 348 in src/main.rs

See this annotation in the file changed.

@github-actions 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:348:29
    |
348 |             drw::cur_create(DRW.as_mut(), XC_FLEUR as i32);
    |                             ^^^^^^^^^^^^ 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 346 in src/main.rs

See this annotation in the file changed.

@github-actions 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:346:29
    |
346 |             drw::cur_create(DRW.as_mut(), XC_SIZING as i32);
    |                             ^^^^^^^^^^^^ 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 344 in src/main.rs

See this annotation in the file changed.

@github-actions 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:344:29
    |
344 |             drw::cur_create(DRW.as_mut(), XC_LEFT_PTR as i32);
    |                             ^^^^^^^^^^^^ 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 289 in src/main.rs

See this annotation in the file changed.

@github-actions 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:289:16
    |
289 |         BH = (*DRW.as_mut().unwrap().fonts).h as i32 + 2;
    |                ^^^^^^^^^^^^ 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