-
-
Notifications
You must be signed in to change notification settings - Fork 392
Open
Description
I'm rust newbie T_T, Don't know why more warning, It's nothing? I use rust 1.91.0
cargo run --example custom_material --release
warning: unexpected `cfg` condition name: `one_screenshot`
--> src/lib.rs:218:11
|
218 | #[cfg(one_screenshot)]
| ^^^^^^^^^^^^^^
|
= help: expected names are: `docsrs`, `feature`, and `test` and 31 more
= help: consider using a Cargo feature instead
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(one_screenshot)'] }
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(one_screenshot)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition name: `one_screenshot`
--> src/lib.rs:366:19
|
366 | #[cfg(one_screenshot)]
| ^^^^^^^^^^^^^^
|
= help: consider using a Cargo feature instead
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(one_screenshot)'] }
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(one_screenshot)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `one_screenshot`
--> src/lib.rs:423:15
|
423 | #[cfg(one_screenshot)]
| ^^^^^^^^^^^^^^
|
= help: consider using a Cargo feature instead
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(one_screenshot)'] }
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(one_screenshot)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
warning: creating a mutable reference to mutable static
--> src/lib.rs:500:14
|
500 | unsafe { CONTEXT.as_mut().unwrap_or_else(|| panic!()) }
| ^^^^^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
= note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
warning: creating a shared reference to mutable static
--> src/lib.rs:507:17
|
507 | assert!(CONTEXT.is_some());
| ^^^^^^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: creating a mutable reference to mutable static
--> src/lib.rs:510:20
|
510 | unsafe { &mut *CONTEXT.as_mut().unwrap().quad_context }
| ^^^^^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: creating a mutable reference to mutable static
--> src/lib.rs:935:44
|
935 | if let Some(ctx) = CONTEXT.as_mut() {
| ^^^^^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: hiding a lifetime that's elided elsewhere is confusing
--> src/ui.rs:730:9
|
730 | &mut self,
| ^^^^^^^^^ the lifetime is elided here
...
737 | ) -> WindowContext {
| ^^^^^^^^^^^^^ the same lifetime is hidden here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
= note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
|
737 | ) -> WindowContext<'_> {
| ++++
warning: hiding a lifetime that's elided elsewhere is confusing
--> src/ui.rs:827:31
|
827 | ...in_modal(&mut self, id: Id, position: Vec2, size: Vec2) -> WindowContext {
| ^^^^^^^^^ the lifetime is elided here ^^^^^^^^^^^^^ the same lifetime is hidden here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
|
827 | pub(crate) fn begin_modal(&mut self, id: Id, position: Vec2, size: Vec2) -> WindowContext<'_> {
| ++++
warning: hiding a lifetime that's elided elsewhere is confusing
--> src/ui.rs:884:45
|
884 | pub(crate) fn get_active_window_context(&mut self) -> WindowContext {
| ^^^^^^^^^ ^^^^^^^^^^^^^ the same lifetime is hidden here
| |
| the lifetime is elided here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
|
884 | pub(crate) fn get_active_window_context(&mut self) -> WindowContext<'_> {
| ++++
warning: hiding a lifetime that's elided elsewhere is confusing
--> src/ui.rs:1160:19
|
1160 | pub fn canvas(&mut self) -> DrawCanvas {
| ^^^^^^^^^ ^^^^^^^^^^ the same lifetime is hidden here
| |
| the lifetime is elided here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
|
1160 | pub fn canvas(&mut self) -> DrawCanvas<'_> {
| ++++
warning: creating a shared reference to mutable static
--> src/experimental/collections/storage.rs:32:12
|
32 | if STORAGE.is_none() {
| ^^^^^^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: creating a mutable reference to mutable static
--> src/experimental/collections/storage.rs:36:9
|
36 | / STORAGE
37 | | .as_mut()
| |_____________________^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: creating a shared reference to mutable static
--> src/experimental/collections/storage.rs:53:12
|
53 | if STORAGE.is_none() {
| ^^^^^^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: creating a mutable reference to mutable static
--> src/experimental/collections/storage.rs:57:9
|
57 | STORAGE.as_mut().unwrap().get(&TypeId::of::<T>()).as_ref()
| ^^^^^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: creating a shared reference to mutable static
--> src/experimental/collections/storage.rs:69:12
|
69 | if STORAGE.is_none() {
| ^^^^^^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: creating a mutable reference to mutable static
--> src/experimental/collections/storage.rs:73:9
|
73 | STORAGE.as_mut().unwrap().get(&TypeId::of::<T>()).as_ref()
| ^^^^^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: hiding a lifetime that's elided elsewhere is confusing
--> src/experimental/scene.rs:380:20
|
380 | pub fn get_any(&mut self, handle: HandleUntyped) -> Option<RefMutAny> {
| ^^^^^^^^^ the lifetime is elided here ^^^^^^^^^ the same lifetime is hidden here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
|
380 | pub fn get_any(&mut self, handle: HandleUntyped) -> Option<RefMutAny<'_>> {
| ++++
warning: creating a mutable reference to mutable static
--> src/experimental/scene.rs:599:5
|
599 | SCENE.get_or_insert_with(|| Scene::new())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: creating a mutable reference to mutable static
--> src/telemetry.rs:9:9
|
9 | / PROFILER.get_or_insert_with(|| Profiler {
10 | | frame: Frame::new(),
11 | | queries: HashMap::new(),
12 | | active_query: None,
... |
19 | | strings: vec![],
20 | | })
| |__________^ mutable reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: creating a shared reference to mutable static
--> src/lib.rs:172:21
|
172 | assert!(THREAD_ID.is_some());
| ^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/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
warning: `macroquad` (lib) generated 21 warnings (run `cargo fix --lib -p macroquad` to apply 5 suggestions)
warning: hiding a lifetime that's elided elsewhere is confusing
--> tiled/src/lib.rs:264:18
|
264 | pub fn tiles(&self, layer: &str, rect: impl Into<Option<Rect>>) -> TilesIterator {
| ^^^^^ the lifetime is elided here ^^^^^^^^^^^^^ the same lifetime is hidden here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
= note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
|
264 | pub fn tiles(&self, layer: &str, rect: impl Into<Option<Rect>>) -> TilesIterator<'_> {
| ++++
warning: `macroquad-tiled` (lib) generated 1 warning (run `cargo fix --lib -p macroquad-tiled` to apply 1 suggestion)
Compiling macroquad v0.4.14 (~/_GameEnginers/macroquad)
Finished `release` profile [optimized] target(s) in 2.13s
Running `~/_GameEnginers/macroquad/target/release/examples/custom_material`Metadata
Metadata
Assignees
Labels
No labels