uniffi-rs icon indicating copy to clipboard operation
uniffi-rs copied to clipboard

Updating from 0.25.3 to 0.26.x or 0.27.x fails for interface

Open pierre-wehbe opened this issue 1 year ago • 8 comments

Env:

nightly-aarch64-apple-darwin - Up to date : 1.80.0-nightly (867900499 2024-05-23) uniffi 0.27.2

The following works

/// Example
namespace example {
  /// Hello Rust
  string hello_world();
};

/// Example Enum
enum ExampleEnum {
  "v1",
  "v2",
};


/// Glucose
dictionary Glucose {
    f32 raw;
    timestamp timestamp;
    timestamp local_timestamp;
};

Adding the following fails:

// lib.rs
pub struct TodoList;

impl TodoList {
    fn new() -> Self {
        TodoList {
        }
    }
}

// udl file
/// TodoList
interface TodoList {
    constructor();
};

The error is:

error[E0433]: failed to resolve: could not find `marker` in `core`
  --> <hidden>/cross_platform/target/debug/build/example-904b99f23226f7e3/out/example.uniffi.rs:69:1
   |
69 | #[::uniffi::derive_object_for_udl]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `marker` in `core`

   |
   = note: this error originates in the attribute macro `::uniffi::derive_object_for_udl` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this module
  --> src/lib.rs:1:1
   |
1  + use std::marker;
   |

This is the content of example.uniffi.rs:69:1

#[::uniffi::derive_object_for_udl]
struct r#TodoList { }
#[::uniffi::export_for_udl]
impl r#TodoList {
    #[uniffi::constructor]
    pub fn r#new(
    ) -> std::sync::Arc<r#TodoList>
    {
        unreachable!()
    }
}

pierre-wehbe avatar May 24 '24 22:05 pierre-wehbe