Skip to content
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

Bump proc-macro-crate to 1 #48

Merged
merged 3 commits into from Jul 10, 2021
Merged

Conversation

eclipseo
Copy link
Contributor

No description provided.

@illicitonion
Copy link
Owner

Thanks for the PR! It's great to see all our direct deps now being stable >=1.0 releases 🎉

Unfortunately it looks like Travis has stopped running our tests on PRs, so I'm going to quickly dig into that and hopefully get CI working again in the next few hours.

I manually ran some of the tests CI should be running, and found that this PR doesn't currently compile because of an API change in proc-macro-crate - you may want to apply a change along the lines of:

diff --git a/num_enum_derive/src/lib.rs b/num_enum_derive/src/lib.rs
index bc237f5..eb1281d 100644
--- a/num_enum_derive/src/lib.rs
+++ b/num_enum_derive/src/lib.rs
@@ -574,10 +574,17 @@ pub fn derive_try_from_primitive(input: TokenStream) -> TokenStream {
 
 #[cfg(feature = "proc-macro-crate")]
 fn get_crate_name() -> String {
-    ::proc_macro_crate::crate_name("num_enum").unwrap_or_else(|err| {
-        eprintln!("Warning: {}\n    => defaulting to `num_enum`", err,);
-        String::from("num_enum")
-    })
+    match ::proc_macro_crate::crate_name("num_enum") {
+        Ok(::proc_macro_crate::FoundCrate::Name(name)) => name,
+        Ok(::proc_macro_crate::FoundCrate::Itself) => {
+            // This should only happen in our own tests.
+            String::from("num_enum")
+        },
+        Err(err) => {
+            eprintln!("Warning: {}\n    => defaulting to `num_enum`", err);
+            String::from("num_enum")
+        }
+    }
 }
 
 // Don't depend on proc-macro-crate in no_std environments because it causes an awkward dependency

Thanks!

@illicitonion illicitonion merged commit 8385dc9 into illicitonion:main Jul 10, 2021
@illicitonion
Copy link
Owner

Fabulous - thanks!

I have a couple of other changes to make today (which should get CI green again) and then I'll kick off a release - it'll probably be a 0.6.0 release which bumps our minimum supported rust version.

@eclipseo
Copy link
Contributor Author

Thanks!

@eclipseo eclipseo deleted the patch-1 branch July 11, 2021 10:39
@illicitonion
Copy link
Owner

I released 0.5.2 with this but without the MSRV bump yesterday, by the way! Thanks again for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants