- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deriving Deserialize inside macro expansion can lead to crash #1176
Comments
Just noticed that adding a lifetime to the line with |
Probably serde/serde_derive_internals/src/ctxt.rs Line 52 in ee75e6c
|
I am not sure if this is the same problem, but this does also crash the compiler: extern crate serde;
#[macro_use]
extern crate serde_derive;
macro_rules! deserialize {
() => {
#[derive(Deserialize)]
struct A {
field: &str,
}
}
}
deserialize! {}
deserialize! {} |
The last case can be simplified: extern crate serde;
#[macro_use]
extern crate serde_derive;
#[derive(Deserialize)]
struct A {
field: &str,
} But the output is slightly different from the one in OP:
Verbose output shows that there is a SIGILL:
|
@dtolnay those fixes only affect Can you release |
Oops! Hopefully I got it right with 1.0.32. Thanks. |
I have encountered a crash of the derive macro.
Using Rust 1.24.1 and the dependencies
the following
lib.rs
(in a fresh cargo project) does crash the compiler:Removing some lines from the macro reveals a proper error (the
#[serde(...)]
inside the first struct after macro expansion makes no sense).Checking with Rust nightly I get the following stack trace:
The text was updated successfully, but these errors were encountered: