rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.04k stars 12.68k forks source link

Incremental compilation. `deserialize::__Visitor<'_>` has no field named `marker` #119288

Open planetoryd opened 10 months ago

planetoryd commented 10 months ago

I tried this code:

https://github.com/planetoryd/nsproxy

It compiles fine, incrementally, in 98% of cases. I have not done anything special before it throws the error, which happened occasionally but regularly during the past few months.

cargo clean always solves the problem

Meta

rustc --version --verbose:

rustc 1.76.0-nightly (eeff92ad3 2023-12-13)
binary: rustc
commit-hash: eeff92ad32c2627876112ccfe812e19d38494087
commit-date: 2023-12-13
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5
Error

``` warning: unused variable: `serv` --> src/systemd/mod.rs:310:26 | 310 | async fn stop(&self, serv: &Self::Serv, ctx: &::Ctx<'_>) -> Result<()> { | ^^^^ help: if this is intentional, prefix it with an underscore: `_serv` error[E0560]: struct `data::_:: for NSUser>::deserialize::__Visitor<'_>` has no field named `marker` --> src/data.rs:574:41 | 546 | defNS!(NSUser, CLONE_NEWUSER, "user", user); | ------------------------------------------- in this macro invocation ... 574 | #[derive(Default, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ^^^^^^^^^^^ `data::_:: for NSUser>::deserialize::__Visitor<'_>` does not have this field | = note: all struct fields are already assigned = note: this error originates in the derive macro `Deserialize` which comes from the expansion of the macro `defNS` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0560]: struct `data::_:: for NSUser>::deserialize::__Visitor<'_>` has no field named `lifetime` --> src/data.rs:574:41 | 546 | defNS!(NSUser, CLONE_NEWUSER, "user", user); | ------------------------------------------- in this macro invocation ... 574 | #[derive(Default, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ^^^^^^^^^^^ `data::_:: for NSUser>::deserialize::__Visitor<'_>` does not have this field | = note: all struct fields are already assigned = note: this error originates in the derive macro `Deserialize` which comes from the expansion of the macro `defNS` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0560]: struct `data::_:: for NSMnt>::deserialize::__Visitor<'_>` has no field named `marker` --> src/data.rs:574:41 | 547 | defNS!(NSMnt, CLONE_NEWNS, "mnt", mnt); | -------------------------------------- in this macro invocation ... 574 | #[derive(Default, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ^^^^^^^^^^^ `data::_:: for NSMnt>::deserialize::__Visitor<'_>` does not have this field | = note: all struct fields are already assigned = note: this error originates in the derive macro `Deserialize` which comes from the expansion of the macro `defNS` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0560]: struct `data::_:: for NSMnt>::deserialize::__Visitor<'_>` has no field named `lifetime` --> src/data.rs:574:41 | 547 | defNS!(NSMnt, CLONE_NEWNS, "mnt", mnt); | -------------------------------------- in this macro invocation ... 574 | #[derive(Default, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ^^^^^^^^^^^ `data::_:: for NSMnt>::deserialize::__Visitor<'_>` does not have this field | = note: all struct fields are already assigned = note: this error originates in the derive macro `Deserialize` which comes from the expansion of the macro `defNS` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0560]: struct `data::_:: for NSNet>::deserialize::__Visitor<'_>` has no field named `marker` --> src/data.rs:574:41 | 548 | defNS!(NSNet, CLONE_NEWNET, "net", net); | --------------------------------------- in this macro invocation ... 574 | #[derive(Default, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ^^^^^^^^^^^ `data::_:: for NSNet>::deserialize::__Visitor<'_>` does not have this field | = note: all struct fields are already assigned = note: this error originates in the derive macro `Deserialize` which comes from the expansion of the macro `defNS` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0560]: struct `data::_:: for NSNet>::deserialize::__Visitor<'_>` has no field named `lifetime` --> src/data.rs:574:41 | 548 | defNS!(NSNet, CLONE_NEWNET, "net", net); | --------------------------------------- in this macro invocation ... 574 | #[derive(Default, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ^^^^^^^^^^^ `data::_:: for NSNet>::deserialize::__Visitor<'_>` does not have this field | = note: all struct fields are already assigned = note: this error originates in the derive macro `Deserialize` which comes from the expansion of the macro `defNS` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0560]: struct `data::_:: for NSUts>::deserialize::__Visitor<'_>` has no field named `marker` --> src/data.rs:574:41 | 549 | defNS!(NSUts, CLONE_NEWUTS, "uts", uts); | --------------------------------------- in this macro invocation ... 574 | #[derive(Default, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ^^^^^^^^^^^ `data::_:: for NSUts>::deserialize::__Visitor<'_>` does not have this field | = note: all struct fields are already assigned = note: this error originates in the derive macro `Deserialize` which comes from the expansion of the macro `defNS` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0560]: struct `data::_:: for NSUts>::deserialize::__Visitor<'_>` has no field named `lifetime` --> src/data.rs:574:41 | 549 | defNS!(NSUts, CLONE_NEWUTS, "uts", uts); | --------------------------------------- in this macro invocation ... 574 | #[derive(Default, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ^^^^^^^^^^^ `data::_:: for NSUts>::deserialize::__Visitor<'_>` does not have this field | = note: all struct fields are already assigned = note: this error originates in the derive macro `Deserialize` which comes from the expansion of the macro `defNS` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0560]: struct `data::_:: for NSPid>::deserialize::__Visitor<'_>` has no field named `marker` --> src/data.rs:574:41 | 550 | defNS!(NSPid, CLONE_NEWPID, "pid", pid); | --------------------------------------- in this macro invocation ... 574 | #[derive(Default, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ^^^^^^^^^^^ `data::_:: for NSPid>::deserialize::__Visitor<'_>` does not have this field | = note: all struct fields are already assigned = note: this error originates in the derive macro `Deserialize` which comes from the expansion of the macro `defNS` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0560]: struct `data::_:: for NSPid>::deserialize::__Visitor<'_>` has no field named `lifetime` --> src/data.rs:574:41 | 550 | defNS!(NSPid, CLONE_NEWPID, "pid", pid); | --------------------------------------- in this macro invocation ... 574 | #[derive(Default, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ^^^^^^^^^^^ `data::_:: for NSPid>::deserialize::__Visitor<'_>` does not have this field | = note: all struct fields are already assigned = note: this error originates in the derive macro `Deserialize` which comes from the expansion of the macro `defNS` (in Nightly builds, run with -Z macro-backtrace for more info) warning: unused import: `Write` --> src/data.rs:5:20 | 5 | fmt::{Display, Write}, | ^^^^^ warning: unused import: `IntoEdgesDirected` --> src/managed.rs:12:26 | 12 | visit::{EdgeRef, IntoEdgesDirected, IntoNodeReferences}, | ^^^^^^^^^^^^^^^^^ For more information about this error, try `rustc --explain E0560`. warning: `nsproxy` (lib) generated 46 warnings error: could not compile `nsproxy` (lib) due to 10 previous errors; 46 warnings emitted ```

Noratrieb commented 10 months ago

Thank you for the report. It would be extremely valuable if you could provide a before/after situation with a change you made that triggers the bug. Without that, it's basically impossible to debug but with a reproduction, it can be fixed.