summaryrefslogtreecommitdiffstats
path: root/vendor/derive_builder/tests/compile-fail
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/derive_builder/tests/compile-fail')
-rw-r--r--vendor/derive_builder/tests/compile-fail/builder_field_attr.rs12
-rw-r--r--vendor/derive_builder/tests/compile-fail/builder_field_attr.stderr5
-rw-r--r--vendor/derive_builder/tests/compile-fail/builder_field_custom.rs22
-rw-r--r--vendor/derive_builder/tests/compile-fail/builder_field_custom.stderr23
-rw-r--r--vendor/derive_builder/tests/compile-fail/builder_setter_attr.rs16
-rw-r--r--vendor/derive_builder/tests/compile-fail/builder_setter_attr.stderr11
-rw-r--r--vendor/derive_builder/tests/compile-fail/crate_root.rs16
-rw-r--r--vendor/derive_builder/tests/compile-fail/crate_root.stderr97
-rw-r--r--vendor/derive_builder/tests/compile-fail/custom_error_generic_missing_bound.rs44
-rw-r--r--vendor/derive_builder/tests/compile-fail/custom_error_generic_missing_bound.stderr15
-rw-r--r--vendor/derive_builder/tests/compile-fail/custom_error_no_from.rs37
-rw-r--r--vendor/derive_builder/tests/compile-fail/custom_error_no_from.stderr7
-rw-r--r--vendor/derive_builder/tests/compile-fail/deny_empty_default.rs12
-rw-r--r--vendor/derive_builder/tests/compile-fail/deny_empty_default.stderr5
-rw-r--r--vendor/derive_builder/tests/compile-fail/private_build_fn.rs30
-rw-r--r--vendor/derive_builder/tests/compile-fail/private_build_fn.stderr16
-rw-r--r--vendor/derive_builder/tests/compile-fail/private_builder.rs23
-rw-r--r--vendor/derive_builder/tests/compile-fail/private_builder.stderr21
-rw-r--r--vendor/derive_builder/tests/compile-fail/private_fields.rs26
-rw-r--r--vendor/derive_builder/tests/compile-fail/private_fields.stderr5
-rw-r--r--vendor/derive_builder/tests/compile-fail/rename_setter_struct_level.rs25
-rw-r--r--vendor/derive_builder/tests/compile-fail/rename_setter_struct_level.stderr11
-rw-r--r--vendor/derive_builder/tests/compile-fail/vis_conflict.rs21
-rw-r--r--vendor/derive_builder/tests/compile-fail/vis_conflict.stderr41
24 files changed, 541 insertions, 0 deletions
diff --git a/vendor/derive_builder/tests/compile-fail/builder_field_attr.rs b/vendor/derive_builder/tests/compile-fail/builder_field_attr.rs
new file mode 100644
index 000000000..bc1b63dea
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/builder_field_attr.rs
@@ -0,0 +1,12 @@
+#[macro_use]
+extern crate derive_builder;
+
+#[derive(Debug, PartialEq, Default, Builder, Clone)]
+pub struct Lorem {
+ ok: String,
+
+ #[builder_field_attr(no_such_attribute)]
+ broken: String,
+}
+
+fn main() {}
diff --git a/vendor/derive_builder/tests/compile-fail/builder_field_attr.stderr b/vendor/derive_builder/tests/compile-fail/builder_field_attr.stderr
new file mode 100644
index 000000000..83a5f3e8b
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/builder_field_attr.stderr
@@ -0,0 +1,5 @@
+error: cannot find attribute `no_such_attribute` in this scope
+ --> tests/compile-fail/builder_field_attr.rs:8:26
+ |
+8 | #[builder_field_attr(no_such_attribute)]
+ | ^^^^^^^^^^^^^^^^^
diff --git a/vendor/derive_builder/tests/compile-fail/builder_field_custom.rs b/vendor/derive_builder/tests/compile-fail/builder_field_custom.rs
new file mode 100644
index 000000000..74c37efb5
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/builder_field_custom.rs
@@ -0,0 +1,22 @@
+#[macro_use]
+extern crate derive_builder;
+
+#[derive(Debug, PartialEq, Default, Builder, Clone)]
+pub struct Lorem {
+ // `default` is incompatible with `field.build`
+ #[builder(
+ default = "1",
+ field(build = "self.ipsum.map(|v| v + 42).unwrap_or(100)")
+ )]
+ ipsum: usize,
+
+ // `default` is incompatible with `field.type`, even without `field.build`
+ #[builder(default = "2", field(type = "usize"))]
+ sit: usize,
+
+ // Both errors can occur on the same field
+ #[builder(default = "3", field(type = "usize", build = "self.ipsum + 42"))]
+ amet: usize,
+}
+
+fn main() {}
diff --git a/vendor/derive_builder/tests/compile-fail/builder_field_custom.stderr b/vendor/derive_builder/tests/compile-fail/builder_field_custom.stderr
new file mode 100644
index 000000000..6cfc7335f
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/builder_field_custom.stderr
@@ -0,0 +1,23 @@
+error: #[builder(default)] and #[builder(field(build="..."))] cannot be used together
+ --> tests/compile-fail/builder_field_custom.rs:8:19
+ |
+8 | default = "1",
+ | ^^^
+
+error: #[builder(default)] and #[builder(field(type="..."))] cannot be used together
+ --> tests/compile-fail/builder_field_custom.rs:14:25
+ |
+14 | #[builder(default = "2", field(type = "usize"))]
+ | ^^^
+
+error: #[builder(default)] and #[builder(field(build="..."))] cannot be used together
+ --> tests/compile-fail/builder_field_custom.rs:18:25
+ |
+18 | #[builder(default = "3", field(type = "usize", build = "self.ipsum + 42"))]
+ | ^^^
+
+error: #[builder(default)] and #[builder(field(type="..."))] cannot be used together
+ --> tests/compile-fail/builder_field_custom.rs:18:25
+ |
+18 | #[builder(default = "3", field(type = "usize", build = "self.ipsum + 42"))]
+ | ^^^
diff --git a/vendor/derive_builder/tests/compile-fail/builder_setter_attr.rs b/vendor/derive_builder/tests/compile-fail/builder_setter_attr.rs
new file mode 100644
index 000000000..baf690c21
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/builder_setter_attr.rs
@@ -0,0 +1,16 @@
+#![deny(unused_must_use)]
+
+#[macro_use]
+extern crate derive_builder;
+
+#[derive(Debug, PartialEq, Default, Builder, Clone)]
+pub struct Lorem {
+ ok: String,
+
+ #[builder_setter_attr(must_use)]
+ broken: usize,
+}
+
+fn main() {
+ LoremBuilder::default().broken(42);
+}
diff --git a/vendor/derive_builder/tests/compile-fail/builder_setter_attr.stderr b/vendor/derive_builder/tests/compile-fail/builder_setter_attr.stderr
new file mode 100644
index 000000000..4b093d7d5
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/builder_setter_attr.stderr
@@ -0,0 +1,11 @@
+error: unused return value of `LoremBuilder::broken` that must be used
+ --> tests/compile-fail/builder_setter_attr.rs:15:5
+ |
+15 | LoremBuilder::default().broken(42);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> tests/compile-fail/builder_setter_attr.rs:1:9
+ |
+1 | #![deny(unused_must_use)]
+ | ^^^^^^^^^^^^^^^
diff --git a/vendor/derive_builder/tests/compile-fail/crate_root.rs b/vendor/derive_builder/tests/compile-fail/crate_root.rs
new file mode 100644
index 000000000..6f6cd3017
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/crate_root.rs
@@ -0,0 +1,16 @@
+#[macro_use]
+extern crate derive_builder;
+
+// This is a stand-in for any bad crate directive
+mod empty {}
+
+#[derive(Builder)]
+// It would be nice if the "failed to resolve" errors would identify `"empty"` as the error span,
+// but doing so would require rewriting a lot of the code generation to use the crate_root span
+// for the full path of the thing being imported, and that doesn't seem worth the code churn.
+#[builder(crate = "empty")]
+struct BadCrate {
+ lorem: String,
+}
+
+fn main() {}
diff --git a/vendor/derive_builder/tests/compile-fail/crate_root.stderr b/vendor/derive_builder/tests/compile-fail/crate_root.stderr
new file mode 100644
index 000000000..326b80aa9
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/crate_root.stderr
@@ -0,0 +1,97 @@
+error[E0433]: failed to resolve: could not find `export` in `empty`
+ --> tests/compile-fail/crate_root.rs:7:10
+ |
+7 | #[derive(Builder)]
+ | ^^^^^^^ could not find `export` in `empty`
+ |
+ = note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0433]: failed to resolve: could not find `export` in `empty`
+ --> tests/compile-fail/crate_root.rs:7:10
+ |
+7 | #[derive(Builder)]
+ | ^^^^^^^ not found in `empty::export::core::option`
+ |
+ = note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this enum
+ |
+5 | use derive_builder::export::core::option::Option;
+ |
+
+error[E0433]: failed to resolve: could not find `export` in `empty`
+ --> tests/compile-fail/crate_root.rs:7:10
+ |
+7 | #[derive(Builder)]
+ | ^^^^^^^ not found in `empty::export::core::clone`
+ |
+ = note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this trait
+ |
+5 | use derive_builder::export::core::clone::Clone;
+ |
+
+error[E0433]: failed to resolve: could not find `export` in `empty`
+ --> tests/compile-fail/crate_root.rs:7:10
+ |
+7 | #[derive(Builder)]
+ | ^^^^^^^ not found in `empty::export::core::result`
+ |
+ = note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing one of these items
+ |
+5 | use derive_builder::export::core::fmt::Result;
+ |
+5 | use derive_builder::export::core::io::Result;
+ |
+5 | use derive_builder::export::core::result::Result;
+ |
+5 | use derive_builder::export::core::thread::Result;
+ |
+
+error[E0433]: failed to resolve: could not find `export` in `empty`
+ --> tests/compile-fail/crate_root.rs:7:10
+ |
+7 | #[derive(Builder)]
+ | ^^^^^^^ not found in `empty::export::core::convert`
+ |
+ = note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this trait
+ |
+5 | use derive_builder::export::core::convert::Into;
+ |
+
+error[E0433]: failed to resolve: could not find `UninitializedFieldError` in `empty`
+ --> tests/compile-fail/crate_root.rs:7:10
+ |
+7 | #[derive(Builder)]
+ | ^^^^^^^ not found in `empty`
+ |
+ = note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct
+ |
+5 | use derive_builder::UninitializedFieldError;
+ |
+
+error[E0433]: failed to resolve: could not find `export` in `empty`
+ --> tests/compile-fail/crate_root.rs:7:10
+ |
+7 | #[derive(Builder)]
+ | ^^^^^^^ not found in `empty::export::core::default`
+ |
+ = note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this trait
+ |
+5 | use derive_builder::export::core::default::Default;
+ |
+
+error[E0412]: cannot find type `UninitializedFieldError` in module `empty`
+ --> tests/compile-fail/crate_root.rs:7:10
+ |
+7 | #[derive(Builder)]
+ | ^^^^^^^ not found in `empty`
+ |
+ = note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct
+ |
+5 | use derive_builder::UninitializedFieldError;
+ |
diff --git a/vendor/derive_builder/tests/compile-fail/custom_error_generic_missing_bound.rs b/vendor/derive_builder/tests/compile-fail/custom_error_generic_missing_bound.rs
new file mode 100644
index 000000000..b9b78dea2
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/custom_error_generic_missing_bound.rs
@@ -0,0 +1,44 @@
+#[macro_use]
+extern crate derive_builder;
+
+use derive_builder::UninitializedFieldError;
+
+trait Popular {
+ fn is_popular(&self) -> bool;
+}
+
+impl<'a> Popular for &'a str {
+ fn is_popular(&self) -> bool {
+ !self.starts_with('b')
+ }
+}
+
+#[derive(Debug, Builder)]
+#[builder(build_fn(validate = "check_person", error = "Error<N>"))]
+struct Person<N> {
+ name: N,
+ age: u16,
+}
+
+enum Error<N> {
+ UninitializedField(&'static str),
+ UnpopularName(N),
+}
+
+impl<N> From<UninitializedFieldError> for Error<N> {
+ fn from(error: UninitializedFieldError) -> Self {
+ Self::UninitializedField(error.field_name())
+ }
+}
+
+fn check_person<N: Popular + Clone>(builder: &PersonBuilder<N>) -> Result<(), Error<N>> {
+ if let Some(name) = &builder.name {
+ if !name.is_popular() {
+ return Err(Error::UnpopularName(name.clone()));
+ }
+ }
+
+ Ok(())
+}
+
+fn main() {}
diff --git a/vendor/derive_builder/tests/compile-fail/custom_error_generic_missing_bound.stderr b/vendor/derive_builder/tests/compile-fail/custom_error_generic_missing_bound.stderr
new file mode 100644
index 000000000..5fa9129ec
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/custom_error_generic_missing_bound.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `N: Popular` is not satisfied
+ --> tests/compile-fail/custom_error_generic_missing_bound.rs:17:31
+ |
+17 | #[builder(build_fn(validate = "check_person", error = "Error<N>"))]
+ | ^^^^^^^^^^^^^^ the trait `Popular` is not implemented for `N`
+ |
+note: required by a bound in `check_person`
+ --> tests/compile-fail/custom_error_generic_missing_bound.rs:34:20
+ |
+34 | fn check_person<N: Popular + Clone>(builder: &PersonBuilder<N>) -> Result<(), Error<N>> {
+ | ^^^^^^^ required by this bound in `check_person`
+help: consider restricting type parameter `N`
+ |
+18 | struct Person<N: Popular> {
+ | +++++++++
diff --git a/vendor/derive_builder/tests/compile-fail/custom_error_no_from.rs b/vendor/derive_builder/tests/compile-fail/custom_error_no_from.rs
new file mode 100644
index 000000000..f052a173f
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/custom_error_no_from.rs
@@ -0,0 +1,37 @@
+#[macro_use]
+extern crate derive_builder;
+
+fn validate_age(age: usize) -> Result<(), Error> {
+ if age > 200 {
+ Err(Error::UnrealisticAge(age))
+ } else {
+ Ok(())
+ }
+}
+
+fn check_person(builder: &PersonBuilder) -> Result<(), Error> {
+ if let Some(age) = builder.age {
+ validate_age(age)
+ } else {
+ Ok(())
+ }
+}
+
+#[derive(Builder)]
+#[builder(build_fn(validate = "check_person", error = "Error"))]
+struct Person {
+ name: String,
+ age: usize,
+}
+
+// NOTE: This enum has a variant for the uninitialized field case (called MissingData)
+// but has forgotten `impl From<derive_builder::UninitializedFieldError>`, which is a
+// compile-blocking mistake.
+#[derive(Debug)]
+enum Error {
+ /// A required field is not filled out.
+ MissingData(&'static str),
+ UnrealisticAge(usize),
+}
+
+fn main() {}
diff --git a/vendor/derive_builder/tests/compile-fail/custom_error_no_from.stderr b/vendor/derive_builder/tests/compile-fail/custom_error_no_from.stderr
new file mode 100644
index 000000000..cde3d817b
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/custom_error_no_from.stderr
@@ -0,0 +1,7 @@
+error[E0277]: the trait bound `Error: From<UninitializedFieldError>` is not satisfied
+ --> tests/compile-fail/custom_error_no_from.rs:21:55
+ |
+21 | #[builder(build_fn(validate = "check_person", error = "Error"))]
+ | ^^^^^^^ the trait `From<UninitializedFieldError>` is not implemented for `Error`
+ |
+ = note: required because of the requirements on the impl of `Into<Error>` for `UninitializedFieldError`
diff --git a/vendor/derive_builder/tests/compile-fail/deny_empty_default.rs b/vendor/derive_builder/tests/compile-fail/deny_empty_default.rs
new file mode 100644
index 000000000..fa5c0d0d6
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/deny_empty_default.rs
@@ -0,0 +1,12 @@
+#[macro_use]
+extern crate derive_builder;
+
+// deny `#[builder(default = "")]`, because we don't want to define a meaning (yet)! :-)
+#[allow(dead_code)]
+#[derive(Builder)]
+struct Lorem {
+ #[builder(default = "")]
+ ipsum: String,
+}
+
+fn main() {}
diff --git a/vendor/derive_builder/tests/compile-fail/deny_empty_default.stderr b/vendor/derive_builder/tests/compile-fail/deny_empty_default.stderr
new file mode 100644
index 000000000..df1319471
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/deny_empty_default.stderr
@@ -0,0 +1,5 @@
+error: Unknown literal value ``
+ --> $DIR/deny_empty_default.rs:8:25
+ |
+8 | #[builder(default = "")]
+ | ^^
diff --git a/vendor/derive_builder/tests/compile-fail/private_build_fn.rs b/vendor/derive_builder/tests/compile-fail/private_build_fn.rs
new file mode 100644
index 000000000..4ee0222d9
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/private_build_fn.rs
@@ -0,0 +1,30 @@
+#[macro_use]
+extern crate derive_builder;
+
+mod container {
+ /// `LoremBuilder` should be accessible outside the module, but its
+ /// build method should not be.
+ #[derive(Debug, Default, Builder)]
+ #[builder(default, public, build_fn(private))]
+ pub struct Lorem {
+ foo: usize,
+ bar: String,
+ }
+
+ impl LoremBuilder {
+ /// Create a `Lorem`
+ pub fn my_build(&self) -> Lorem {
+ self.build().expect("All good")
+ }
+ }
+}
+
+fn main() {
+ use container::{Lorem, LoremBuilder};
+
+ let lorem1 = LoremBuilder::default().my_build();
+
+ let lorem2 = LoremBuilder::default().build().unwrap();
+
+ println!("{:?} vs {:?}", lorem1, lorem2);
+}
diff --git a/vendor/derive_builder/tests/compile-fail/private_build_fn.stderr b/vendor/derive_builder/tests/compile-fail/private_build_fn.stderr
new file mode 100644
index 000000000..e74211557
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/private_build_fn.stderr
@@ -0,0 +1,16 @@
+warning: unused import: `Lorem`
+ --> tests/compile-fail/private_build_fn.rs:23:21
+ |
+23 | use container::{Lorem, LoremBuilder};
+ | ^^^^^
+ |
+ = note: `#[warn(unused_imports)]` on by default
+
+error[E0624]: associated function `build` is private
+ --> tests/compile-fail/private_build_fn.rs:27:42
+ |
+7 | #[derive(Debug, Default, Builder)]
+ | ------- private associated function defined here
+...
+27 | let lorem2 = LoremBuilder::default().build().unwrap();
+ | ^^^^^ private associated function
diff --git a/vendor/derive_builder/tests/compile-fail/private_builder.rs b/vendor/derive_builder/tests/compile-fail/private_builder.rs
new file mode 100644
index 000000000..cd13e52d5
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/private_builder.rs
@@ -0,0 +1,23 @@
+#[macro_use]
+extern crate derive_builder;
+
+pub mod foo {
+ /// The builder struct's declaration of privacy should override the field's
+ /// attempt to be public later on.
+ #[derive(Debug, PartialEq, Default, Builder, Clone)]
+ #[builder(private, setter(into))]
+ pub struct Lorem {
+ pub private: String,
+ #[builder(public)]
+ pub public: String,
+ }
+}
+
+fn main() {
+ let x = foo::LoremBuilder::default()
+ .public("Hello")
+ .build()
+ .unwrap();
+
+ assert_eq!(x.public, "Hello".to_string());
+}
diff --git a/vendor/derive_builder/tests/compile-fail/private_builder.stderr b/vendor/derive_builder/tests/compile-fail/private_builder.stderr
new file mode 100644
index 000000000..6684ac28c
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/private_builder.stderr
@@ -0,0 +1,21 @@
+error[E0603]: struct `LoremBuilder` is private
+ --> tests/compile-fail/private_builder.rs:17:18
+ |
+17 | let x = foo::LoremBuilder::default()
+ | ^^^^^^^^^^^^ private struct
+ |
+note: the struct `LoremBuilder` is defined here
+ --> tests/compile-fail/private_builder.rs:7:41
+ |
+7 | #[derive(Debug, PartialEq, Default, Builder, Clone)]
+ | ^^^^^^^
+ = note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0624]: associated function `build` is private
+ --> tests/compile-fail/private_builder.rs:19:10
+ |
+7 | #[derive(Debug, PartialEq, Default, Builder, Clone)]
+ | ------- private associated function defined here
+...
+19 | .build()
+ | ^^^^^ private associated function
diff --git a/vendor/derive_builder/tests/compile-fail/private_fields.rs b/vendor/derive_builder/tests/compile-fail/private_fields.rs
new file mode 100644
index 000000000..74f074df1
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/private_fields.rs
@@ -0,0 +1,26 @@
+#[macro_use]
+extern crate derive_builder;
+
+/// This builder is in an inner module to make sure private fields aren't accessible
+/// from the `main` function.
+mod inner {
+ /// The `LoremBuilder` struct will have private fields for `ipsum` and `dolor`, and
+ /// a public `sit` field.
+ #[derive(Debug, Builder)]
+ #[builder(field(private), setter(into))]
+ pub struct Lorem {
+ ipsum: String,
+ dolor: u16,
+ #[builder(field(public))]
+ sit: bool,
+ }
+}
+
+fn main() {
+ use inner::LoremBuilder;
+
+ let mut lorem = LoremBuilder::default();
+ lorem.dolor(15u16);
+ lorem.sit = Some(true); // <-- public
+ lorem.dolor = Some(0); // <-- private
+}
diff --git a/vendor/derive_builder/tests/compile-fail/private_fields.stderr b/vendor/derive_builder/tests/compile-fail/private_fields.stderr
new file mode 100644
index 000000000..403e89c81
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/private_fields.stderr
@@ -0,0 +1,5 @@
+error[E0616]: field `dolor` of struct `LoremBuilder` is private
+ --> tests/compile-fail/private_fields.rs:25:11
+ |
+25 | lorem.dolor = Some(0); // <-- private
+ | ^^^^^ private field
diff --git a/vendor/derive_builder/tests/compile-fail/rename_setter_struct_level.rs b/vendor/derive_builder/tests/compile-fail/rename_setter_struct_level.rs
new file mode 100644
index 000000000..7565efe64
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/rename_setter_struct_level.rs
@@ -0,0 +1,25 @@
+#[macro_use]
+extern crate pretty_assertions;
+#[macro_use]
+extern crate derive_builder;
+
+#[derive(Debug, PartialEq, Default, Builder, Clone)]
+#[builder(setter(name = "foo"))]
+struct Lorem {
+ ipsum: &'static str,
+ pub dolor: &'static str,
+}
+
+fn main() {
+ let x = LoremBuilder::default()
+ .ipsum("ipsum")
+ .foo("dolor")
+ .build()
+ .unwrap();
+
+ assert_eq!(x,
+ Lorem {
+ ipsum: "ipsum",
+ dolor: "dolor",
+ });
+}
diff --git a/vendor/derive_builder/tests/compile-fail/rename_setter_struct_level.stderr b/vendor/derive_builder/tests/compile-fail/rename_setter_struct_level.stderr
new file mode 100644
index 000000000..5e2141b1b
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/rename_setter_struct_level.stderr
@@ -0,0 +1,11 @@
+error: Unknown field: `name`
+ --> tests/compile-fail/rename_setter_struct_level.rs:7:18
+ |
+7 | #[builder(setter(name = "foo"))]
+ | ^^^^
+
+error[E0433]: failed to resolve: use of undeclared type `LoremBuilder`
+ --> tests/compile-fail/rename_setter_struct_level.rs:14:13
+ |
+14 | let x = LoremBuilder::default()
+ | ^^^^^^^^^^^^ use of undeclared type `LoremBuilder`
diff --git a/vendor/derive_builder/tests/compile-fail/vis_conflict.rs b/vendor/derive_builder/tests/compile-fail/vis_conflict.rs
new file mode 100644
index 000000000..68e38a417
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/vis_conflict.rs
@@ -0,0 +1,21 @@
+#[macro_use]
+extern crate derive_builder;
+
+#[derive(Builder)]
+#[builder(public, vis = "pub(crate)")]
+pub struct Example {
+ #[builder(public, private)]
+ field: String,
+}
+
+#[derive(Builder)]
+#[builder(public, vis = "pub(crate)", build_fn(private, public))]
+pub struct SecondExample {
+ #[builder(private, vis = "pub")]
+ a_field: String,
+}
+
+fn main() {
+ ExampleBuilder::default().build();
+ SecondExampleBuilder::default().build();
+}
diff --git a/vendor/derive_builder/tests/compile-fail/vis_conflict.stderr b/vendor/derive_builder/tests/compile-fail/vis_conflict.stderr
new file mode 100644
index 000000000..c8c2ed823
--- /dev/null
+++ b/vendor/derive_builder/tests/compile-fail/vis_conflict.stderr
@@ -0,0 +1,41 @@
+error: `public` and `private` cannot be used together
+ --> tests/compile-fail/vis_conflict.rs:7:15
+ |
+7 | #[builder(public, private)]
+ | ^^^^^^
+
+error: `vis="..."` cannot be used with `public` or `private`
+ --> tests/compile-fail/vis_conflict.rs:5:25
+ |
+5 | #[builder(public, vis = "pub(crate)")]
+ | ^^^^^^^^^^^^
+
+error: `public` and `private` cannot be used together
+ --> tests/compile-fail/vis_conflict.rs:12:57
+ |
+12 | #[builder(public, vis = "pub(crate)", build_fn(private, public))]
+ | ^^^^^^
+
+error: `vis="..."` cannot be used with `public` or `private`
+ --> tests/compile-fail/vis_conflict.rs:14:30
+ |
+14 | #[builder(private, vis = "pub")]
+ | ^^^^^
+
+error: `vis="..."` cannot be used with `public` or `private`
+ --> tests/compile-fail/vis_conflict.rs:12:25
+ |
+12 | #[builder(public, vis = "pub(crate)", build_fn(private, public))]
+ | ^^^^^^^^^^^^
+
+error[E0433]: failed to resolve: use of undeclared type `ExampleBuilder`
+ --> tests/compile-fail/vis_conflict.rs:19:5
+ |
+19 | ExampleBuilder::default().build();
+ | ^^^^^^^^^^^^^^ use of undeclared type `ExampleBuilder`
+
+error[E0433]: failed to resolve: use of undeclared type `SecondExampleBuilder`
+ --> tests/compile-fail/vis_conflict.rs:20:5
+ |
+20 | SecondExampleBuilder::default().build();
+ | ^^^^^^^^^^^^^^^^^^^^ use of undeclared type `SecondExampleBuilder`