Bump version of dyn-any to address missues which could lead to ub (#1145)

* Make StaticType trait unsafe

* Mark StaticTypeSized and StaticTypeClone as unsafe as well

* Update dyn-any dependency

* Update manifest links
This commit is contained in:
Dennis Kobert
2023-04-17 23:35:04 +02:00
committed by GitHub
parent 50105c9a74
commit e3c38d5eba
14 changed files with 47 additions and 64 deletions
+9 -3
View File
@@ -1,12 +1,12 @@
[package]
name = "dyn-any-derive"
version = "0.2.1"
version = "0.3.0"
edition = "2021"
authors = ["Graphite Authors <contact@graphite.rs>"]
description = "#[derive(DynAny)]"
documentation = "https://docs.rs/dyn-any-derive"
repository = "https://github.com/GraphiteEditor/Graphite"
repository = "https://github.com/GraphiteEditor/Graphite/tree/master/libraries/dyn-any/derive"
license = "MIT OR Apache-2.0"
readme = "../README.md"
@@ -16,7 +16,13 @@ proc-macro = true
[dependencies]
proc-macro2 = "1"
quote = "1"
syn = { version = "1", default-features = false, features = ["derive", "parsing", "proc-macro", "printing"] }
syn = { version = "1", default-features = false, features = [
"derive",
"parsing",
"proc-macro",
"printing",
"clone-impls",
] }
[dev-dependencies]
dyn-any = { path = "..", features = ["derive"] }
+1 -1
View File
@@ -46,7 +46,7 @@ pub fn system_desc_derive(input: TokenStream) -> TokenStream {
let old_params = &generics.params.iter().collect::<Vec<_>>();
quote! {
impl<'dyn_any, #(#old_params,)*> StaticType for #struct_name <#(#dyn_params,)*> {
unsafe impl<'dyn_any, #(#old_params,)*> StaticType for #struct_name <#(#dyn_params,)*> {
type Static = #struct_name <#(#static_params,)*>;
}
}