Skip to content
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

Diesel proc-macro use-after-free on nightly #8929

Closed
Proximyst opened this issue May 22, 2021 · 6 comments
Closed

Diesel proc-macro use-after-free on nightly #8929

Proximyst opened this issue May 22, 2021 · 6 comments

Comments

@Proximyst
Copy link

Proximyst commented May 22, 2021

What I expected to happen

A completely valid and fine Diesel 1.4 table definition, as it compiles just fine on any version:

use super::schema::messages;
use chrono::{DateTime, Utc};

#[derive(Queryable, Insertable)]
#[table_name = "messages"]
pub struct Message {
}

where schema can be anything. There can be any fields in the struct as well.

What actually happened

A proc-macro panicked for use-after-free: macro-error: proc macro returned error: proc-macro panicked: use-after-free in `proc_macro` handle.

Note that this only affects the derive macros; every other warning and whatnot still shows up, such as an unused lifetime on the struct if you define it to have <'a>.

Regression

This is only broken on cargo 1.54.0-nightly (2021-05-11). When tested on cargo 1.52.0 (69767412a 2021-04-21) and cargo 1.53.0-beta (4369396ce 2021-04-27), all is well. cargo build and cargo check both work as expected on all environments.

Environment

rust-analyzer: [coc.nvim] rust-analyzer b82458818 2021-05-17 stable
cargo: cargo 1.54.0-nightly (070e459c2 2021-05-11) / cargo 1.53.0-beta (4369396ce 2021-04-27) / cargo 1.52.0 (69767412a 2021-04-21)
neovim: v0.4.4
node: v14.16.0
coc.nvim: 0.0.80-d129f0f97e
uname -sr: Linux 5.10.38_1

Side-note: This is some awesome software. Thank you for your time in developing this 😃.

@lnicola
Copy link
Member

lnicola commented May 22, 2021

Duplicate of the previous two issues, probably.

@lnicola
Copy link
Member

lnicola commented May 22, 2021

Although in #8925 the 2021-05-11 nightly worked for me.

@GrayJack
Copy link
Contributor

GrayJack commented Jun 5, 2021

I'm having the same error message on nightly in my project attribute macro. The nightly version is 2021-06-04.

@Dessix
Copy link

Dessix commented Jun 6, 2021

Hopefully this helps someone out- I just confirmed presence of the issue on rust-toolchain nightly-2021-05-29 and absence on nightly-2021-05-17. @GrayJack maybe that version will be sufficient?

@parasyte
Copy link

Also occurs with thiserror::Error.

@lnicola
Copy link
Member

lnicola commented Jul 13, 2021

Presumably fixed in #9550

@lnicola lnicola closed this as completed Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants