assert_exists 0.1.0

Useful macro to assert that a certain symbol exists in the source code. This is useful to strictly couple otherwise loosely coupled functions and symbols that depend on each other.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13


/// Statically checks if the argument is a valid symbol.
/// 
/// Symbols may be deleted in the code. This macro assures that no function is invalidated because of that.
#[macro_export]
macro_rules! assert_exists {
    ($x:expr) => {
        #[allow(path_statements)]
        const _: () = { $x ; };
    };
}