Skip to content

Commit

Permalink
Fix test output for new compiler version.
Browse files Browse the repository at this point in the history
  • Loading branch information
schungx committed Jul 26, 2024
1 parent 4b8b3e3 commit 19b8c53
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
6 changes: 1 addition & 5 deletions codegen/src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
4 changes: 0 additions & 4 deletions codegen/src/module.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
11 changes: 11 additions & 0 deletions codegen/ui_tests/export_fn_cfg.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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

error[E0425]: cannot find function `test_fn` in this scope
--> ui_tests/export_fn_cfg.rs:18:8
|
Expand Down
11 changes: 11 additions & 0 deletions codegen/ui_tests/rhai_mod_inner_cfg_false.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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

0 comments on commit 19b8c53

Please sign in to comment.