Skip to content

Commit

Permalink
Bump crates to 2018 edition
Browse files Browse the repository at this point in the history
The problem with bad diagnostics appears to have been due to not being able to find the macro to emit compile errors.
  • Loading branch information
TedDriggs committed Jan 30, 2024
1 parent a962baf commit 8254863
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 30 deletions.
13 changes: 8 additions & 5 deletions derive_builder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
[package]
name = "derive_builder"
version = "0.13.0"
authors = ["Colin Kiegel <[email protected]>",
"Pascal Hertleif <[email protected]>",
"Jan-Erik Rediger <[email protected]>",
"Ted Driggs <[email protected]>"]
authors = [
"Colin Kiegel <[email protected]>",
"Pascal Hertleif <[email protected]>",
"Jan-Erik Rediger <[email protected]>",
"Ted Driggs <[email protected]>",
]
edition = "2018"

description = "Rust macro to automatically implement the builder pattern for arbitrary structs."
repository = "https://github.com/colin-kiegel/rust-derive-builder"
Expand All @@ -31,4 +34,4 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"

[target.'cfg(compiletests)'.dev-dependencies]
trybuild = "1.0.38"
trybuild = "1.0.38"
2 changes: 1 addition & 1 deletion derive_builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ pub use error::UninitializedFieldError;
pub mod export {
pub mod core {
#[cfg(feature = "alloc")]
pub use alloc::string;
pub use ::alloc::string;
#[cfg(not(feature = "std"))]
pub use core::*;
#[cfg(feature = "std")]
Expand Down
2 changes: 1 addition & 1 deletion derive_builder_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = [
"Jan-Erik Rediger <[email protected]>",
"Ted Driggs <[email protected]>",
]

edition = "2018"
description = "Internal helper library for the derive_builder crate."
repository = "https://github.com/colin-kiegel/rust-derive-builder"
documentation = "https://docs.rs/derive_builder_core"
Expand Down
9 changes: 3 additions & 6 deletions derive_builder_core/src/build_method.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
use std::borrow::Cow;

use doc_comment_from;
use proc_macro2::{Span, TokenStream};
use quote::{ToTokens, TokenStreamExt};
use syn;
use syn::spanned::Spanned;
use BuilderPattern;
use Initializer;
use DEFAULT_STRUCT_NAME;

use crate::DefaultExpression;
use crate::{
doc_comment_from, BuilderPattern, DefaultExpression, Initializer, DEFAULT_STRUCT_NAME,
};

/// Initializer for the struct fields in the build method, implementing
/// `quote::ToTokens`.
Expand Down
9 changes: 3 additions & 6 deletions derive_builder_core/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ use quote::{format_ident, ToTokens, TokenStreamExt};
use syn::punctuated::Punctuated;
use syn::{self, Path, TraitBound, TraitBoundModifier, TypeParamBound};

use doc_comment_from;
use BuildMethod;
use BuilderField;
use BuilderPattern;
use DeprecationNotes;
use Setter;
use crate::{
doc_comment_from, BuildMethod, BuilderField, BuilderPattern, DeprecationNotes, Setter,
};

const ALLOC_NOT_ENABLED_ERROR: &str = r#"`alloc` is disabled within 'derive_builder', consider one of the following:
* enable feature `alloc` on 'dervie_builder' if a `global_allocator` is present
Expand Down
1 change: 0 additions & 1 deletion derive_builder_core/src/builder_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::borrow::Cow;

use proc_macro2::TokenStream;
use quote::{ToTokens, TokenStreamExt};
use syn;

/// Field for the builder struct, implementing `quote::ToTokens`.
///
Expand Down
1 change: 0 additions & 1 deletion derive_builder_core/src/deprecation_notes.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use proc_macro2::{Span, TokenStream};
use quote::{ToTokens, TokenStreamExt};
use syn;

/// Deprecation notes we want to emit to the user, implementing
/// `quote::ToTokens`.
Expand Down
5 changes: 1 addition & 4 deletions derive_builder_core/src/initializer.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use proc_macro2::{Span, TokenStream};
use quote::{ToTokens, TokenStreamExt};
use syn;
use BuilderPattern;
use DEFAULT_STRUCT_NAME;

use crate::{change_span, BlockContents, DefaultExpression};
use crate::{change_span, BlockContents, BuilderPattern, DefaultExpression, DEFAULT_STRUCT_NAME};

/// Initializer for the target struct fields, implementing `quote::ToTokens`.
///
Expand Down
6 changes: 1 addition & 5 deletions derive_builder_core/src/setter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ use std::borrow::Cow;

use proc_macro2::{Span, TokenStream};
use quote::{ToTokens, TokenStreamExt};
use syn;

use BuilderFieldType;
use BuilderPattern;
use DeprecationNotes;
use Each;
use crate::{BuilderFieldType, BuilderPattern, DeprecationNotes, Each};

/// Setter for the struct fields in the build method, implementing
/// `quote::ToTokens`.
Expand Down
1 change: 1 addition & 0 deletions derive_builder_macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ authors = [
"Jan-Erik Rediger <[email protected]>",
"Ted Driggs <[email protected]>",
]
edition = "2018"

description = "Rust macro to automatically implement the builder pattern for arbitrary structs."
repository = "https://github.com/colin-kiegel/rust-derive-builder"
Expand Down

0 comments on commit 8254863

Please sign in to comment.