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

Compile error with recent nightly toolchain #3060

Closed
Berrysoft opened this issue Feb 1, 2023 · 8 comments · Fixed by #3069
Closed

Compile error with recent nightly toolchain #3060

Berrysoft opened this issue Feb 1, 2023 · 8 comments · Fixed by #3069

Comments

@Berrysoft
Copy link

rustc version: rustc 1.69.0-nightly (dc1d9d50f 2023-01-31)

Reproduce: run cargo test at the root directory. (Maybe rust-toolchain should be deleted first.)

error[E0161]: cannot move a value of type `str`
  --> utils/zerovec/derive/examples/make_var.rs:10:1
   |
10 | #[make_varule(VarStructULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the size of `str` cannot be statically determined
   |
   = note: this error originates in the attribute macro `make_varule` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `self.c` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:10:1
   |
10 | #[make_varule(VarStructULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `self.c` has type `str`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `other.c` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:10:1
   |
10 | #[make_varule(VarStructULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `other.c` has type `str`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0161]: cannot move a value of type `str`
  --> utils/zerovec/derive/examples/make_var.rs:20:1
   |
20 | #[make_varule(VarStructOutOfOrderULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the size of `str` cannot be statically determined
   |
   = note: this error originates in the attribute macro `make_varule` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `self.b` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:20:1
   |
20 | #[make_varule(VarStructOutOfOrderULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `self.b` has type `str`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `other.b` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:20:1
   |
20 | #[make_varule(VarStructOutOfOrderULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `other.b` has type `str`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0161]: cannot move a value of type `VarZeroSlice<str>`
  --> utils/zerovec/derive/examples/make_var.rs:31:1
   |
31 | #[make_varule(VarTupleStructULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the size of `VarZeroSlice<str>` cannot be statically determined
   |
   = note: this error originates in the attribute macro `make_varule` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `self` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:31:1
   |
31 | #[make_varule(VarTupleStructULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `self.2` has type `VarZeroSlice<str>`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `other` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:31:1
   |
31 | #[make_varule(VarTupleStructULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `other.2` has type `VarZeroSlice<str>`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0161]: cannot move a value of type `VarZeroSlice<str>`
  --> utils/zerovec/derive/examples/make_var.rs:36:1
   |
36 | #[make_varule(NoKVULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^ the size of `VarZeroSlice<str>` cannot be statically determined
   |
   = note: this error originates in the attribute macro `make_varule` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `self` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:36:1
   |
36 | #[make_varule(NoKVULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `self.2` has type `VarZeroSlice<str>`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `other` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:36:1
   |
36 | #[make_varule(NoKVULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `other.2` has type `VarZeroSlice<str>`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0161]: cannot move a value of type `VarZeroSlice<str>`
  --> utils/zerovec/derive/examples/make_var.rs:42:1
   |
42 | #[make_varule(NoOrdULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^ the size of `VarZeroSlice<str>` cannot be statically determined
   |
   = note: this error originates in the attribute macro `make_varule` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `self` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:42:1
   |
42 | #[make_varule(NoOrdULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `self.2` has type `VarZeroSlice<str>`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `other` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:42:1
   |
42 | #[make_varule(NoOrdULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `other.2` has type `VarZeroSlice<str>`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0161]: cannot move a value of type `MultiFieldsULE`
  --> utils/zerovec/derive/examples/make_var.rs:48:1
   |
48 | #[make_varule(MultiFieldStructULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the size of `MultiFieldsULE` cannot be statically determined
   |
   = note: this error originates in the attribute macro `make_varule` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `self.unsized_fields` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:48:1
   |
48 | #[make_varule(MultiFieldStructULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `self.unsized_fields` has type `MultiFieldsULE`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `other.unsized_fields` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:48:1
   |
48 | #[make_varule(MultiFieldStructULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `other.unsized_fields` has type `MultiFieldsULE`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0161]: cannot move a value of type `MultiFieldsULE`
  --> utils/zerovec/derive/examples/make_var.rs:62:1
   |
62 | #[make_varule(MultiFieldTupleULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the size of `MultiFieldsULE` cannot be statically determined
   |
   = note: this error originates in the attribute macro `make_varule` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `self` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:62:1
   |
62 | #[make_varule(MultiFieldTupleULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `self.2` has type `MultiFieldsULE`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of `other` which is behind a shared reference
  --> utils/zerovec/derive/examples/make_var.rs:62:1
   |
62 | #[make_varule(MultiFieldTupleULE)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because `other.2` has type `MultiFieldsULE`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0161, E0507.
For more information about an error, try `rustc --explain E0161`.
error: could not compile `zerovec-derive` due to 21 previous errors
@robertbastian
Copy link
Member

@Manishearth
Copy link
Member

This is due to rust-lang/rust#104429 , which I had believed we had mitigated but I guess not.

The fix is to not autoderive PartialEq

@sffc
Copy link
Member

sffc commented Feb 2, 2023

Reproduces in our nightly CI: https://github.com/unicode-org/icu4x/actions/runs/4065155193/jobs/6999477972

@Manishearth

How come it is failing the check-msrv job which is supposed to be 1.61?

@robertbastian
Copy link
Member

Because nightly also overrides MSRV:
image

@Manishearth
Copy link
Member

Yeah our nightly CI task takes a big hammer and whacks every place we set a toolchain, regardless of purpose

@robertbastian
Copy link
Member

Well I inverted these on purpose. We probably don't really need check to run for nightly anyway, it's good as a quick signal for PRs, but it doesn't discover anything that test wouldn't.

@Manishearth
Copy link
Member

#3069

@Manishearth
Copy link
Member

I really need to get around to building that nightly CI slackbot

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

Successfully merging a pull request may close this issue.

4 participants