Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
remove std feature flags for assert macros (#7600)
Browse files Browse the repository at this point in the history
* remove std feature flags for assert macros

* re-add note about availability in no_std envs
  • Loading branch information
apopiak authored Nov 25, 2020
1 parent 1ec8a7f commit fee1093
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions frame/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -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,
Expand All @@ -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()));
Expand All @@ -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);
Expand All @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit fee1093

Please sign in to comment.