Skip to content

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

Closed
@Proximyst

Description

@Proximyst

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 😃.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions