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
Expected behavior
The aforementioned code compiles.
Screenshots
Here is the compiler output of cargo check --tests:
error: custom attribute panicked
--> src/main.rs:8:5
|
8 | #[ntest::timeout(100)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: Unrecognized literal: `c""`
error[E0425]: cannot find function `foo` in this scope
--> src/main.rs:9:5
|
9 | / fn foo() {
10 | | let _cstr = c"";
11 | | }
| |_____^ not found in this scope
For more information about this error, try `rustc --explain E0425`.
Desktop (please complete the following information):
OS: Fedora Linux
Version: 39
Additional context
What's interesting, is if the literal is hidden behind a macro_rules!, the error does not appear. Thus, the following compiles as expected:
muzarski
changed the title
#[ntest::timeout()] does not work with properly with C-string literals#[ntest::timeout()] does not work properly with C-string literals
Nov 28, 2024
Describe the bug
The macro panics when C-String literals are used in the test marked with
#[ntest::timeout()]
.To Reproduce
Create a new crate with the following in
main/lib.rs
:Expected behavior
The aforementioned code compiles.
Screenshots
Here is the compiler output of
cargo check --tests
:Desktop (please complete the following information):
Additional context
What's interesting, is if the literal is hidden behind a
macro_rules!
, the error does not appear. Thus, the following compiles as expected:The text was updated successfully, but these errors were encountered: