-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fails to build with rust 1.78 #37
Comments
Very strange. Can you run |
I need to correct myself, the warning originates from clippy, not any build, and it happens any clippy warning becomes an error in my CI, sorry for that. I've tried with a simple example: #[derive(tsify_next::Tsify)]
pub struct Identified<Id, Value> {
pub id: Id,
pub value: Value,
} expands to #![feature(prelude_import)]
#[prelude_import]
use std::prelude::rust_2021::*;
#[macro_use]
extern crate std;
pub struct Identified<Id, Value> {
pub id: Id,
pub value: Value,
}
#[automatically_derived]
const _: () = {
use tsify_next::Tsify;
use wasm_bindgen::{
convert::{
FromWasmAbi, IntoWasmAbi, OptionFromWasmAbi, OptionIntoWasmAbi,
RefFromWasmAbi,
},
describe::WasmDescribe, prelude::*,
};
#[automatically_derived]
///
#[repr(transparent)]
pub struct JsType {
obj: wasm_bindgen::JsValue,
}
#[automatically_derived]
const _: () = {
use wasm_bindgen::convert::TryFromJsValue;
use wasm_bindgen::convert::{IntoWasmAbi, FromWasmAbi};
use wasm_bindgen::convert::{OptionIntoWasmAbi, OptionFromWasmAbi};
use wasm_bindgen::convert::{RefFromWasmAbi, LongRefFromWasmAbi};
use wasm_bindgen::describe::WasmDescribe;
use wasm_bindgen::{JsValue, JsCast, JsObject};
use wasm_bindgen::__rt::core;
impl WasmDescribe for JsType {
fn describe() {
use wasm_bindgen::describe::*;
inform(NAMED_EXTERNREF);
inform(10u32);
inform(73u32);
inform(100u32);
inform(101u32);
inform(110u32);
inform(116u32);
inform(105u32);
inform(102u32);
inform(105u32);
inform(101u32);
inform(100u32);
}
}
impl IntoWasmAbi for JsType {
type Abi = <JsValue as IntoWasmAbi>::Abi;
#[inline]
fn into_abi(self) -> Self::Abi {
self.obj.into_abi()
}
}
impl OptionIntoWasmAbi for JsType {
#[inline]
fn none() -> Self::Abi {
0
}
}
impl<'a> OptionIntoWasmAbi for &'a JsType {
#[inline]
fn none() -> Self::Abi {
0
}
}
impl FromWasmAbi for JsType {
type Abi = <JsValue as FromWasmAbi>::Abi;
#[inline]
unsafe fn from_abi(js: Self::Abi) -> Self {
JsType {
obj: JsValue::from_abi(js).into(),
}
}
}
impl OptionFromWasmAbi for JsType {
#[inline]
fn is_none(abi: &Self::Abi) -> bool {
*abi == 0
}
}
impl<'a> IntoWasmAbi for &'a JsType {
type Abi = <&'a JsValue as IntoWasmAbi>::Abi;
#[inline]
fn into_abi(self) -> Self::Abi {
(&self.obj).into_abi()
}
}
impl RefFromWasmAbi for JsType {
type Abi = <JsValue as RefFromWasmAbi>::Abi;
type Anchor = core::mem::ManuallyDrop<JsType>;
#[inline]
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor {
let tmp = <JsValue as RefFromWasmAbi>::ref_from_abi(js);
core::mem::ManuallyDrop::new(JsType {
obj: core::mem::ManuallyDrop::into_inner(tmp).into(),
})
}
}
impl LongRefFromWasmAbi for JsType {
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;
type Anchor = JsType;
#[inline]
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor {
let tmp = <JsValue as LongRefFromWasmAbi>::long_ref_from_abi(js);
JsType { obj: tmp.into() }
}
}
impl From<JsValue> for JsType {
#[inline]
fn from(obj: JsValue) -> JsType {
JsType { obj: obj.into() }
}
}
impl AsRef<JsValue> for JsType {
#[inline]
fn as_ref(&self) -> &JsValue {
self.obj.as_ref()
}
}
impl AsRef<JsType> for JsType {
#[inline]
fn as_ref(&self) -> &JsType {
self
}
}
impl From<JsType> for JsValue {
#[inline]
fn from(obj: JsType) -> JsValue {
obj.obj.into()
}
}
impl JsCast for JsType {
fn instanceof(val: &JsValue) -> bool {
#[cfg(
not(
all(
target_arch = "wasm32",
not(any(target_os = "emscripten", target_os = "wasi"))
)
)
)]
unsafe fn __wbg_instanceof_JsType_d5b10ea09f1d9e1c(_: u32) -> u32 {
{
::std::rt::begin_panic(
"cannot check instanceof on non-wasm targets",
);
};
}
unsafe {
let idx = val.into_abi();
__wbg_instanceof_JsType_d5b10ea09f1d9e1c(idx) != 0
}
}
#[inline]
fn unchecked_from_js(val: JsValue) -> Self {
JsType { obj: val.into() }
}
#[inline]
fn unchecked_from_js_ref(val: &JsValue) -> &Self {
unsafe { &*(val as *const JsValue as *const JsType) }
}
}
impl JsObject for JsType {}
};
#[automatically_derived]
impl core::ops::Deref for JsType {
type Target = wasm_bindgen::JsValue;
#[inline]
fn deref(&self) -> &wasm_bindgen::JsValue {
&self.obj
}
}
impl<Id, Value> Tsify for Identified<Id, Value> {
type JsType = JsType;
const DECL: &'static str = "export interface Identified<Id, Value> {\n id: Id;\n value: Value;\n}";
const SERIALIZATION_CONFIG: tsify_next::SerializationConfig = tsify_next::SerializationConfig {
missing_as_null: false,
hashmap_as_object: false,
large_number_types_as_bigints: false,
};
}
}; As you can see, there is an empty doc comment before #[automatically_derived]
///
#[repr(transparent)]
pub struct JsType {
obj: wasm_bindgen::JsValue,
} |
I don't see that anywhere in the source of tsify. Maybe its a
Perhaps |
This just started happening in my CI as well. It must be a |
Ok, I think we can close here |
Since upgrading to rust 1.78, every build fails with a lot of similar errors:
The text was updated successfully, but these errors were encountered: