remove std feature flags for assert macros (#7600)

* remove std feature flags for assert macros

* re-add note about availability in no_std envs
This commit is contained in:
Alexander Popiak
2020-11-25 23:48:47 +01:00
committed by GitHub
parent 5774fea2f7
commit f590b06fab
+2 -8
View File
@@ -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;