-
-
Notifications
You must be signed in to change notification settings - Fork 774
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
Externalize derive macro implementation #2765
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
serde_derive/src/de.rs → serde_derive/src/implementation/de.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#[macro_use] | ||
mod bound; | ||
#[macro_use] | ||
mod fragment; | ||
|
||
pub mod de; | ||
mod dummy; | ||
mod pretend; | ||
pub mod ser; | ||
mod this; |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
serde_derive/src/ser.rs → serde_derive/src/implementation/ser.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "serde_derive_implementation" | ||
version = "0.29.1" | ||
authors = ["Erick Tryzelaar <[email protected]>", "David Tolnay <[email protected]>"] | ||
description = "Serde derive macros implementations." | ||
documentation = "https://docs.rs/serde_derive_implementation" | ||
edition = "2015" | ||
exclude = ["build.rs"] | ||
homepage = "https://serde.rs" | ||
keywords = ["serde", "serialization"] | ||
license = "MIT OR Apache-2.0" | ||
repository = "https://github.com/serde-rs/serde" | ||
rust-version = "1.56" | ||
|
||
[lib] | ||
path = "lib.rs" | ||
|
||
[dependencies] | ||
proc-macro2 = { workspace = true } | ||
quote = { workspace = true } | ||
syn = { workspace = true, features = ["clone-impls", "derive", "parsing", "printing"] } | ||
serde_derive_internals = { path = "../serde_derive_internals" } | ||
|
||
[package.metadata.docs.rs] | ||
targets = ["x86_64-unknown-linux-gnu"] | ||
rustdoc-args = ["--generate-link-to-definition"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../LICENSE-APACHE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../LICENSE-MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use std::path::Path; | ||
|
||
fn main() { | ||
// Warning: build.rs is not published to crates.io. | ||
|
||
println!("cargo:rerun-if-changed=build.rs"); | ||
println!("cargo:rerun-if-changed=src/mod.rs"); | ||
|
||
println!("cargo:rustc-cfg=check_cfg"); | ||
println!("cargo:rustc-check-cfg=cfg(check_cfg)"); | ||
println!("cargo:rustc-check-cfg=cfg(exhaustive)"); | ||
println!("cargo:rustc-check-cfg=cfg(serde_build_from_git)"); | ||
println!("cargo:rustc-check-cfg=cfg(feature, values(\"deserialize_in_place\"))"); | ||
|
||
// Sometimes on Windows the git checkout does not correctly wire up the | ||
// symlink from serde_derive_implementation/src to serde_derive/src/internals. | ||
// When this happens we'll just build based on relative paths within the git | ||
// repo. | ||
let mod_behind_symlink = Path::new("src/mod.rs"); | ||
if !mod_behind_symlink.exists() { | ||
println!("cargo:rustc-cfg=serde_build_from_git"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#![doc(html_root_url = "https://docs.rs/serde_derive_impl/0.29.1")] | ||
#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))] | ||
// Ignored clippy lints | ||
#![allow( | ||
clippy::cognitive_complexity, | ||
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7575 | ||
clippy::collapsible_match, | ||
clippy::derive_partial_eq_without_eq, | ||
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6797 | ||
clippy::manual_map, | ||
clippy::missing_panics_doc, | ||
clippy::redundant_field_names, | ||
clippy::result_unit_err, | ||
clippy::should_implement_trait, | ||
clippy::trivially_copy_pass_by_ref, | ||
clippy::wildcard_in_or_patterns, | ||
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704 | ||
clippy::unnested_or_patterns, | ||
)] | ||
// Ignored clippy_pedantic lints | ||
#![allow( | ||
clippy::doc_markdown, | ||
clippy::enum_glob_use, | ||
clippy::items_after_statements, | ||
clippy::let_underscore_untyped, | ||
clippy::manual_assert, | ||
clippy::match_same_arms, | ||
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6984 | ||
clippy::match_wildcard_for_single_variants, | ||
clippy::missing_errors_doc, | ||
clippy::module_name_repetitions, | ||
clippy::must_use_candidate, | ||
clippy::return_self_not_must_use, | ||
clippy::similar_names, | ||
clippy::single_match_else, | ||
clippy::struct_excessive_bools, | ||
clippy::too_many_lines, | ||
clippy::unused_self, | ||
clippy::wildcard_imports | ||
)] | ||
|
||
extern crate proc_macro2; | ||
extern crate quote; | ||
extern crate syn; | ||
extern crate serde_derive_internals; | ||
|
||
use serde_derive_internals as internals; | ||
|
||
#[cfg_attr(serde_build_from_git, path = "../serde_derive/src/implementation/mod.rs")] | ||
#[cfg_attr(not(serde_build_from_git), path = "src/mod.rs")] | ||
mod implementation; | ||
|
||
pub use implementation::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../serde_derive/src/implementation/ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this a symbolic link?
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.
yup it was, just like for
serde_derive_internals
See: https://github.com/serde-rs/serde/blob/master/serde_derive_internals/src