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

update version 2.0.0-dev.19 to 2.0.0-dev.28, this error has occurred when I run my rust unit test:flutter_rust_bridge::frb_generated_boilerplate!(); missing tokens in macro arguments #1823

Closed
sdegongzuo opened this issue Mar 17, 2024 · 14 comments

Comments

@sdegongzuo
Copy link

Describe the bug
update version 2.0.0-dev.19 to 2.0.0-dev.28, run command flutter_rust_bridge_codegen generate
this error has occurred when I run my rust unit test:

error: unexpected end of macro invocation
  --> src/frb_generated.rs:27:1
   |
27 | flutter_rust_bridge::frb_generated_boilerplate!();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing tokens in macro arguments
   |
note: while trying to match `default_stream_sink_codec`
  --> /Users/y/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/flutter_rust_bridge-2.0.0-dev.28/src/for_generated/boilerplate.rs:7:9
   |
7  |         default_stream_sink_codec = $default_stream_sink_codec:ident,
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0425]: cannot find value `FLUTTER_RUST_BRIDGE_CODEGEN_VERSION` in this scope
  --> src/frb_generated.rs:31:1
   |
31 | flutter_rust_bridge::frb_generated_default_handler!();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
   |
   = note: this error originates in the macro `flutter_rust_bridge::frb_generated_default_handler` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.rs:37:16
   |
37 |     path: impl CstDecode<String> + core::panic::UnwindSafe,
   |                ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.rs:57:18
   |
57 |     number: impl CstDecode<i32> + core::panic::UnwindSafe,
   |                  ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.rs:77:16
   |
77 |     name: impl CstDecode<String> + core::panic::UnwindSafe,
   |                ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.rs:98:6
   |
98 | impl CstDecode<bool> for bool {
   |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
   --> src/frb_generated.rs:103:6
    |
103 | impl CstDecode<i32> for i32 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
   --> src/frb_generated.rs:108:6
    |
108 | impl CstDecode<u8> for u8 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:113:6
    |
113 | impl SseDecode for String {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:120:6
    |
120 | impl SseDecode for bool {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:126:6
    |
126 | impl SseDecode for i32 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:132:6
    |
132 | impl SseDecode for Vec<u8> {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:143:6
    |
143 | impl SseDecode for u8 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:149:6
    |
149 | impl SseDecode for () {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:155:6
    |
155 | impl SseEncode for String {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:161:6
    |
161 | impl SseEncode for bool {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:167:6
    |
167 | impl SseEncode for i32 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:173:6
    |
173 | impl SseEncode for Vec<u8> {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:182:6
    |
182 | impl SseEncode for u8 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:188:6
    |
188 | impl SseEncode for () {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.io.rs:13:6
   |
13 | impl CstDecode<String> for *mut wire_cst_list_prim_u_8 {
   |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.io.rs:19:6
   |
19 | impl CstDecode<Vec<u8>> for *mut wire_cst_list_prim_u_8 {
   |      ^^^^^^^^^ not found in this scope

To Reproduce
Steps to reproduce the behavior:
update version 2.0.0-dev.19 to 2.0.0-dev.28, this error has occurred when I run my rust unit test

Expected behavior
A clear and concise description of what you expected to happen.
Run normally after upgrading the version

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • rust version: 1.76.0
  • OS: MacOS 14.3.1
  • Version 2.0.0-dev.28
Copy link

welcome bot commented Mar 17, 2024

Hi! Thanks for opening your first issue here! 😄

@fzyzcjy
Copy link
Owner

fzyzcjy commented Mar 17, 2024

Hi, do you mean fzyzcjy/flutter_rust_bridge instead of fzyzcjy/flutter_smooth?

@sdegongzuo
Copy link
Author

sorry, i mean flutter_rust_bridge

Hi, do you mean fzyzcjy/flutter_rust_bridge instead of fzyzcjy/flutter_smooth?

@fzyzcjy fzyzcjy transferred this issue from fzyzcjy/flutter_smooth Mar 17, 2024
Copy link

welcome bot commented Mar 17, 2024

Hi! Thanks for opening your first issue here! 😄

@fzyzcjy fzyzcjy added the awaiting Waiting for responses, PR, further discussions, upstream release, etc label Mar 17, 2024
@fzyzcjy
Copy link
Owner

fzyzcjy commented Mar 17, 2024

Hi, could you please check whether your Cargo.toml shows correct flutter_rust_bridge version (or paste it here)?

@sdegongzuo
Copy link
Author

[package]
name = "rust_lib"
version = "0.1.0"
edition = "2018"

[lib]
crate-type = ["cdylib", "staticlib"]

[dependencies]
flutter_rust_bridge = "=2.0.0-dev.28"

flutter_rust_bridge

@sdegongzuo
Copy link
Author

sdegongzuo commented Mar 17, 2024

this version is normal
[package]
name = "rust_lib"
version = "0.1.0"
edition = "2018"

[lib]
crate-type = ["cdylib", "staticlib"]

[dependencies]
flutter_rust_bridge = "=2.0.0-dev.19"

@fzyzcjy
Copy link
Owner

fzyzcjy commented Mar 17, 2024

[dependencies]
flutter_rust_bridge = "=2.0.0-dev.19"

Looks like this is old. Could you please modify it to be .28 and see whether it works?

@lazykern
Copy link

lazykern commented Mar 22, 2024

I faced the same issue after running my project in Windows, but after I updated flutter_rust_bridge_codegen to the latest version or the same version as in Cargo.toml, my project seems to be running perfectly.

cargo install 'flutter_rust_bridge_codegen@^2.0.0-dev.28'

@sdegongzuo
Copy link
Author

I faced the same issue after running my project in Windows, but after I updated flutter_rust_bridge_codegen to the latest version or the same version as in Cargo.toml, my project seems to be running perfectly.

cargo install 'flutter_rust_bridge_codegen@^2.0.0-dev.28'

your flutter version?

@lazykern
Copy link

lazykern commented Apr 2, 2024

your flutter version?

3.19.3

@sdegongzuo
Copy link
Author

I have upgraded the versions of Flutter and flutter_rust_bridge_codegen to the latest version and they are running normally

@fzyzcjy
Copy link
Owner

fzyzcjy commented May 15, 2024

Close since this seems to work. Feel free to reopen if having any issues!

@fzyzcjy fzyzcjy closed this as completed May 15, 2024
@fzyzcjy fzyzcjy removed the awaiting Waiting for responses, PR, further discussions, upstream release, etc label May 15, 2024
Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants