-
Notifications
You must be signed in to change notification settings - Fork 58
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
Drop proc-macro-hack
, upgrade syn
to 2
#214
Conversation
1233ecd
to
bbd9ab4
Compare
It isn't needed for Rust versions outside of [1.31, 1.45] and `frunk` is on `edition = "2021"` anyway.
bbd9ab4
to
cf2f700
Compare
Only affected by 1 breaking change, which was just a rename!
cf2f700
to
40236f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I actually expected to see the proc-macros and proc-macros-impl crates be consolidated here. |
Done, although I just did it as "stupidly" as possible which caused some tests to go away. But I think what got deleted is duplicated here anyway: Line 42 in ebcb730
Let me know if I need to add it back. |
Can you use git mv for a cleaner diff? I suspect that the two files that
were detected as deleted would be more accurately described as moved.
Please correct me if I'm wrong.
(If not familiar, you can do this in an interactive rebase (git rebase -i master). When it gets to that commit, `git reset` the deleted files to un-record the deletions, copy the files from impl back to proc-macros in your working tree, `git rm` the copies in proc-macros and `git mv` the copies in impl to proc-macros.)
…On Thu, Jun 15, 2023, 2:26 PM Charles Hall ***@***.***> wrote:
Done, although I just did it as "stupidly" as possible which caused some
tests to go away. But I think what got deleted is duplicated here anyway:
https://github.com/lloydmeta/frunk/blob/ebcb73024c870935112fffb0d41415c4568ef3f7/core/src/path.rs#L42
—
Reply to this email directly, view it on GitHub
<#214 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKYRUF2I7N2G7EUNRZOIO3XLNHU7ANCNFSM6AAAAAAZG7TXIQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
3b84071
to
f7314cb
Compare
Hmm, |
Okay, the way it is is fine then. I'll take a closer look in a sec.
You definitely don't need separate move and edit commits as long as a decent portion of the file is unchanged (if it changes little enough you don't even need |
Okay, here's a more accurate diff of the files. Diff for main..f7314cb accounting for file movediff --git a/Cargo.toml b/Cargo.toml
index 617209a..8deba14 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -58,7 +58,6 @@ codegen-units = 1 # https://users.rust-lang.org/t/odd-benchmark-results-compiler
members = [
"proc-macro-helpers",
"core",
- "proc-macros-impl",
"proc-macros",
"derives",
"laws"
diff --git a/derives/Cargo.toml b/derives/Cargo.toml
index 775b3ad..ccd1a38 100644
--- a/derives/Cargo.toml
+++ b/derives/Cargo.toml
@@ -16,7 +16,7 @@ travis-ci = { repository = "lloydmeta/frunk" }
proc-macro = true
[dependencies]
-syn = "1"
+syn = "2"
quote = "1"
[dependencies.frunk_proc_macro_helpers]
diff --git a/proc-macro-helpers/Cargo.toml b/proc-macro-helpers/Cargo.toml
index f9e4295..a2ea16c 100644
--- a/proc-macro-helpers/Cargo.toml
+++ b/proc-macro-helpers/Cargo.toml
@@ -13,7 +13,7 @@ keywords = ["Frunk", "macros", "internal"]
travis-ci = { repository = "lloydmeta/frunk" }
[dependencies]
-syn = "1"
+syn = "2"
quote = "1"
proc-macro2 = "1"
diff --git a/proc-macro-helpers/src/lib.rs b/proc-macro-helpers/src/lib.rs
index 0e8124b..94fbac3 100644
--- a/proc-macro-helpers/src/lib.rs
+++ b/proc-macro-helpers/src/lib.rs
@@ -20,8 +20,8 @@ use proc_macro2::{Span, TokenStream as TokenStream2};
use quote::ToTokens;
use syn::spanned::Spanned;
use syn::{
- DeriveInput, Expr, Field, Fields, GenericParam, Generics, Ident, Lifetime, LifetimeDef, Member,
- Variant,
+ DeriveInput, Expr, Field, Fields, GenericParam, Generics, Ident, Lifetime, LifetimeParam,
+ Member, Variant,
};
/// These are assumed to exist as enums in frunk_core::labelled
@@ -325,7 +325,7 @@ pub fn ref_generics(generics: &Generics) -> Generics {
// instantiate a lifetime and lifetime def to add
let ref_lifetime = Lifetime::new("'_frunk_ref_", Span::call_site());
- let ref_lifetime_def = LifetimeDef::new(ref_lifetime.clone());
+ let ref_lifetime_def = LifetimeParam::new(ref_lifetime.clone());
// Constrain the generic lifetimes present in the concrete type to the reference lifetime
// of our implementation of LabelledGeneric for the reference case (& and &mut)
diff --git a/proc-macros/Cargo.toml b/proc-macros/Cargo.toml
index 91b85bd..4f4770f 100644
--- a/proc-macros/Cargo.toml
+++ b/proc-macros/Cargo.toml
@@ -1,21 +1,20 @@
[package]
-name = "frunk_proc_macros_impl"
+name = "frunk_proc_macros"
edition = "2021"
version = "0.1.1"
authors = ["Lloyd <lloydmeta@gmail.com>"]
-description = "Proc macros inernal implementations for Frunk"
+description = "Proc macros for Frunk"
license = "MIT"
-documentation = "https://docs.rs/frunk_proc_macros_internal"
+documentation = "https://docs.rs/frunk_proc_macros"
repository = "https://github.com/lloydmeta/frunk"
-keywords = ["Frunk", "macros", "internal"]
+keywords = ["Frunk", "macros"]
[badges]
travis-ci = { repository = "lloydmeta/frunk" }
[dependencies]
-syn = "1"
+syn = "2"
quote = "1"
-proc-macro-hack = "0.5"
[lib]
proc-macro = true
@@ -30,3 +29,8 @@ version = "0.4.1"
path = "../proc-macro-helpers"
default-features = false
version = "0.1.1"
+
+[dev-dependencies.frunk]
+path = "../."
+default-features = false
+version = "0.4.1"
diff --git a/proc-macros/src/lib.rs b/proc-macros/src/lib.rs
index a724c7d..8a5d9ab 100644
--- a/proc-macros/src/lib.rs
+++ b/proc-macros/src/lib.rs
@@ -10,19 +10,17 @@
extern crate frunk_core;
extern crate frunk_proc_macro_helpers;
extern crate proc_macro;
-extern crate proc_macro_hack;
extern crate quote;
extern crate syn;
use frunk_proc_macro_helpers::*;
use proc_macro::TokenStream;
-use proc_macro_hack::proc_macro_hack;
use quote::quote;
use syn::{parse_macro_input, Expr};
/// Build a generic path that can be used for traversals
-#[proc_macro_hack]
+#[proc_macro]
pub fn path(input: TokenStream) -> TokenStream {
let expr = parse_macro_input!(input as Expr);
let path_type = build_path_type(expr); |
All looks good to me, only question is whether |
f7314cb
to
2aa08b8
Compare
I just tested and this is true, I've just removed it in a force-push. |
It's a bit late here, so I'll cut a release some time this weekend. Thanks! |
Fixes #213.
I also noticed
but unfortunately the effects of this seem to show up in the public API.