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

macro expansion broken on latest nightly (2024-06-13) #3078

Closed
Usioumeo opened this issue Jun 14, 2024 · 2 comments
Closed

macro expansion broken on latest nightly (2024-06-13) #3078

Usioumeo opened this issue Jun 14, 2024 · 2 comments

Comments

@Usioumeo
Copy link

Usioumeo commented Jun 14, 2024

I am developing a RISCV project based on embassy and ch32-hal, I have update my machine and installed the latest nightly version. Unfortunately the embassy macro expansion seems to have broken, and the error is not that helpful.
Now i get this error:

error: item does not constrain `__embassy_main::Fut::{opaque#0}`, but has it in its signature
  --> src/bin/main.rs:59:1
   |
59 | #[embassy_executor::main(entry = "qingke_rt::entry")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this procedural macro expansion
   |
  ::: <.cargo path>/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-macros-0.4.1/src/lib.rs:58:1
   |
58 | pub fn task(args: TokenStream, item: TokenStream) -> TokenStream {
   | ---------------------------------------------------------------- in this expansion of `#[::embassy_executor::task]`
   |
   = note: consider moving the opaque type's declaration and defining uses into a separate module

I have tried to use the latest git version (not the latest published on crates.io), but the result doesn't change
Having glazed at the changelog here it seems they have worked on impl traits and opaque types... In the weekend I could have some time to check on the issue... Let me know

I have tried to use the latest git version (not the latest published on crates.io), the error changes, and adding

#![feature(impl_trait_in_assoc_type)]

to my project, and now it compiles just fine

@joelpmichael
Copy link

+1, on same embedded platform (if that helps), on a brand new project created from the ch32-hal-template at https://github.com/ch32-rs/ch32-hal-template

my rust-toolchain.toml contains:

[toolchain]
targets = ["riscv32imac-unknown-none-elf"]
channel = "nightly-2024-06-12" # works
#channel = "nightly-2024-06-13" # broken

I haven't yet looked into what language change may have caused this.

@Dirbaio
Copy link
Member

Dirbaio commented Jun 18, 2024

this broke due to rust-lang/rust#117861 rust-lang/rust#113169

it's fixed in git main since #2574 so i'm going to close this. Next crates.io release will include the fix.

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

3 participants