You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const_assert!(BUFFER_LEN < 1024,"BUFFER_LEN > 1024 will overrun PROGMEM");
And get a message like this:
error[E0080]: evaluation of constant value failed
--> src/const_assert.rs:55:1
|
5 | const_assert!(BUFFER_LEN < 1024, "BUFFER_LEN > 1024 will overrun PROGMEM");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| the evaluated program panicked at 'BUFFER_LEN > 1024 will overrun PROGMEM', src/const_assert.rs:5:1
| inside `assert_internal` at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/core/src/panic.rs:28:9
| inside `_::_` at /home/nora/src/noracodes/static-assertions-rs/src/const_assert.rs:71:27
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
Obviously this won't work for any other macros here, because of their variadics, but it would be lovely if we could get custom messages at least for const_assert. Perhaps it could be opt-in through a Cargo feature?
The text was updated successfully, but these errors were encountered:
I'm not sure if this is possible on the MSRV of 1.37, but on 1.57 we can do something like this:
And you can call that like so:
And get a message like this:
Obviously this won't work for any other macros here, because of their variadics, but it would be lovely if we could get custom messages at least for
const_assert
. Perhaps it could be opt-in through a Cargo feature?The text was updated successfully, but these errors were encountered: