Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions support/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rust_proc_macro(
deps = [
"@crate_index//:proc-macro2",
"@crate_index//:quote", # v1
"@crate_index//:syn", # v1
"@crate_index//:syn", # v2
],
)

Expand Down Expand Up @@ -82,7 +82,7 @@ rust_proc_macro(
deps = [
"@crate_index//:proc-macro2",
"@crate_index//:quote", # v1
"@crate_index//:syn", # v1
"@crate_index//:syn", # v2
],
)

Expand Down Expand Up @@ -175,7 +175,7 @@ rust_proc_macro(
deps = [
"@crate_index//:proc-macro2",
"@crate_index//:quote", # v1
"@crate_index//:syn", # v1
"@crate_index//:syn", # v2
],
)

Expand Down
5 changes: 3 additions & 2 deletions support/ctor_proc_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl Parse for CrateRename {
fn derive_crate_name(input: &syn::DeriveInput) -> syn::Result<Ident> {
let mut result = Ident::new("ctor", Span::call_site());
for attr in &input.attrs {
if !attr.path.is_ident("ctor") {
if !attr.path().is_ident("ctor") {
continue;
}
CrateRename(result) = attr.parse_args()?;
Expand Down Expand Up @@ -374,7 +374,7 @@ fn add_lifetime(generics: &mut syn::Generics, prefix: &str) -> proc_macro2::Toke
name = Cow::Owned(format!("{prefix}_{i}"));
};
let quoted_lifetime = quote! {#lifetime};
generics.params.push(syn::GenericParam::Lifetime(syn::LifetimeDef::new(lifetime)));
generics.params.push(syn::GenericParam::Lifetime(syn::LifetimeParam::new(lifetime)));
quoted_lifetime
}

Expand Down Expand Up @@ -470,6 +470,7 @@ fn forbid_initialization(s: &mut syn::DeriveInput) {
fields.named.push(syn::Field {
attrs: vec![],
vis: syn::Visibility::Inherited,
mutability: syn::FieldMutability::None,
// TODO(jeanpierreda): better hygiene: work even if a field has the same name.
ident: Some(Ident::new(FIELD_FOR_MUST_USE_CTOR, Span::call_site())),
colon_token: Some(<syn::Token![:]>::default()),
Expand Down
Loading