Move extern crate proc_macro into each possible lib.rs

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")`.
This commit is contained in:
David Tolnay 2023-07-25 18:52:40 -07:00
parent 6140b6f527
commit 6882285be0
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
3 changed files with 3 additions and 2 deletions

View File

@ -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");

View File

@ -3,6 +3,7 @@ extern crate quote;
#[macro_use]
extern crate syn;
extern crate proc_macro;
extern crate proc_macro2;
mod internals;

View File

@ -1,3 +1,5 @@
extern crate proc_macro;
mod buffer;
mod bytecode;