Skip to content

Commit

Permalink
Move extern crate proc_macro into each possible lib.rs
Browse files Browse the repository at this point in the history
This makes it slightly more convenient to use the following as a
Reindeer fixup for those that prefer to build from source:

    extra_mapped_srcs = { "src/lib_from_source.rs" = "src/lib.rs" }

    [platform_fixups.'cfg(all(target_arch = "x86_64", target_os = "linux", target_env = "gnu"))']
    extra_deps = [":proc-macro2", ":quote", ":syn"]

as opposed to checking in a whole new file containing the `extern crate
proc_macro` + `include!("lib_from_source.rs")`.
  • Loading branch information
dtolnay committed Jul 26, 2023
1 parent 6140b6f commit 6882285
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions precompiled/serde_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.175")]
#![allow(unknown_lints, bare_trait_objects)]

extern crate proc_macro;

#[cfg(not(all(target_arch = "x86_64", target_os = "linux", target_env = "gnu")))]
include!("lib_from_source.rs");

Expand Down
1 change: 1 addition & 0 deletions precompiled/serde_derive/src/lib_from_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extern crate quote;
#[macro_use]
extern crate syn;

extern crate proc_macro;
extern crate proc_macro2;

mod internals;
Expand Down
2 changes: 2 additions & 0 deletions precompiled/serde_derive/src/lib_precompiled.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate proc_macro;

mod buffer;
mod bytecode;

Expand Down

0 comments on commit 6882285

Please sign in to comment.