Movatterモバイル変換


[0]ホーム

URL:


debug_assert_ne

std

Macrodebug_assert_ne 

1.0.0 ·Source
macro_rules! debug_assert_ne {    ($($arg:tt)*) => { ... };}
Expand description

Asserts that two expressions are not equal to each other.

On panic, this macro will print the values of the expressions with theirdebug representations.

Unlikeassert_ne!,debug_assert_ne! statements are only enabled in nonoptimized builds by default. An optimized build will not executedebug_assert_ne! statements unless-C debug-assertions is passed to thecompiler. This makesdebug_assert_ne! useful for checks that are tooexpensive to be present in a release build but may be helpful duringdevelopment. The result of expandingdebug_assert_ne! is always type checked.

§Examples

leta =3;letb =2;debug_assert_ne!(a, b);

[8]ページ先頭

©2009-2026 Movatter.jp