diff --git a/codegen/src/function.rs b/codegen/src/function.rs index e216c0d04..b3bfde58b 100644 --- a/codegen/src/function.rs +++ b/codegen/src/function.rs @@ -5,12 +5,8 @@ use syn::{ spanned::Spanned, }; -#[cfg(no_std)] -use alloc::format; -#[cfg(not(no_std))] -use std::format; - use std::borrow::Cow; +use std::format; use crate::attrs::{ExportInfo, ExportScope, ExportedParams}; diff --git a/codegen/src/module.rs b/codegen/src/module.rs index 92dda1e0f..cd7e2b795 100644 --- a/codegen/src/module.rs +++ b/codegen/src/module.rs @@ -1,11 +1,7 @@ use quote::{quote, ToTokens}; use syn::{parse::Parse, parse::ParseStream}; -#[cfg(no_std)] -use core::mem; -#[cfg(not(no_std))] use std::mem; - use std::borrow::Cow; use crate::attrs::{AttrItem, ExportInfo, ExportScope, ExportedParams}; diff --git a/codegen/ui_tests/export_fn_cfg.stderr b/codegen/ui_tests/export_fn_cfg.stderr index 498c95d4f..2dc96ff23 100644 --- a/codegen/ui_tests/export_fn_cfg.stderr +++ b/codegen/ui_tests/export_fn_cfg.stderr @@ -4,6 +4,17 @@ error: `cfg` attributes are not allowed for `export_fn` 10 | #[cfg(not(feature = "foo"))] | ^ +warning: unexpected `cfg` condition value: `foo` + --> ui_tests/export_fn_cfg.rs:10:11 + | +10 | #[cfg(not(feature = "foo"))] + | ^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `default` and `metadata` + = help: consider adding `foo` as a feature in `Cargo.toml` + = note: see for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + error[E0425]: cannot find function `test_fn` in this scope --> ui_tests/export_fn_cfg.rs:18:8 | diff --git a/codegen/ui_tests/rhai_mod_inner_cfg_false.stderr b/codegen/ui_tests/rhai_mod_inner_cfg_false.stderr index 2c6d5659e..8fb2f445f 100644 --- a/codegen/ui_tests/rhai_mod_inner_cfg_false.stderr +++ b/codegen/ui_tests/rhai_mod_inner_cfg_false.stderr @@ -10,3 +10,14 @@ note: found an item that was configured out 12 | pub mod test_mod { | ^^^^^^^^ = note: the item is gated behind the `unset_feature` feature + +warning: unexpected `cfg` condition value: `unset_feature` + --> ui_tests/rhai_mod_inner_cfg_false.rs:11:11 + | +11 | #[cfg(feature = "unset_feature")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `default` and `metadata` + = help: consider adding `unset_feature` as a feature in `Cargo.toml` + = note: see for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default