From fee109326e092879b981232fac5eba0b6fdb7287 Mon Sep 17 00:00:00 2001 From: Alexander Popiak Date: Wed, 25 Nov 2020 23:48:47 +0100 Subject: [PATCH] remove std feature flags for assert macros (#7600) * remove std feature flags for assert macros * re-add note about availability in no_std envs --- frame/support/src/lib.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/frame/support/src/lib.rs b/frame/support/src/lib.rs index 5dd452dbbe7b9..3c191ed6ae454 100644 --- a/frame/support/src/lib.rs +++ b/frame/support/src/lib.rs @@ -102,9 +102,8 @@ pub enum Never {} /// /// - Using `static` to create a static parameter type. Its value is /// being provided by a static variable with the equivalent name in `UPPER_SNAKE_CASE`. An -/// additional `set` function is provided in this case to alter the static variable. -/// -/// **This is intended for testing ONLY and is ONLY available when `std` is enabled** +/// additional `set` function is provided in this case to alter the static variable. +/// **This is intended for testing ONLY and is ONLY available when `std` is enabled.** /// /// # Examples /// @@ -488,7 +487,6 @@ macro_rules! ensure { /// /// Used as `assert_noop(expression_to_assert, expected_error_expression)`. #[macro_export] -#[cfg(feature = "std")] macro_rules! assert_noop { ( $x:expr, @@ -504,7 +502,6 @@ macro_rules! assert_noop { /// /// Used as `assert_err!(expression_to_assert, expected_error_expression)` #[macro_export] -#[cfg(feature = "std")] macro_rules! assert_err { ( $x:expr , $y:expr $(,)? ) => { assert_eq!($x, Err($y.into())); @@ -516,7 +513,6 @@ macro_rules! assert_err { /// This can be used on`DispatchResultWithPostInfo` when the post info should /// be ignored. #[macro_export] -#[cfg(feature = "std")] macro_rules! assert_err_ignore_postinfo { ( $x:expr , $y:expr $(,)? ) => { $crate::assert_err!($x.map(|_| ()).map_err(|e| e.error), $y); @@ -525,7 +521,6 @@ macro_rules! assert_err_ignore_postinfo { /// Assert an expression returns error with the given weight. #[macro_export] -#[cfg(feature = "std")] macro_rules! assert_err_with_weight { ($call:expr, $err:expr, $weight:expr $(,)? ) => { if let Err(dispatch_err_with_post) = $call { @@ -542,7 +537,6 @@ macro_rules! assert_err_with_weight { /// Used as `assert_ok!(expression_to_assert, expected_ok_expression)`, /// or `assert_ok!(expression_to_assert)` which would assert against `Ok(())`. #[macro_export] -#[cfg(feature = "std")] macro_rules! assert_ok { ( $x:expr $(,)? ) => { let is = $x;