summaryrefslogtreecommitdiffstats
path: root/vendor/derivative/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/derivative/tests
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/derivative/tests')
-rw-r--r--vendor/derivative/tests/clippy-warning-clone-from.rs13
-rw-r--r--vendor/derivative/tests/compile-fail/derive-debug-unused.rs19
-rw-r--r--vendor/derivative/tests/compile-fail/derive-debug-unused.stderr11
-rw-r--r--vendor/derivative/tests/compile-fail/derive-debug.rs15
-rw-r--r--vendor/derivative/tests/compile-fail/derive-debug.stderr9
-rw-r--r--vendor/derivative/tests/compile-fail/derive-partial-ord.rs11
-rw-r--r--vendor/derivative/tests/compile-fail/derive-partial-ord.stderr5
-rw-r--r--vendor/derivative/tests/compile-fail/invalid-attribute.rs23
-rw-r--r--vendor/derivative/tests/compile-fail/invalid-attribute.stderr23
-rw-r--r--vendor/derivative/tests/compile-fail/unknown-attribute.rs15
-rw-r--r--vendor/derivative/tests/compile-fail/unknown-attribute.stderr11
-rw-r--r--vendor/derivative/tests/compile-fail/unknown-derive.rs22
-rw-r--r--vendor/derivative/tests/compile-fail/unknown-derive.stderr17
-rw-r--r--vendor/derivative/tests/compile-test.rs9
-rw-r--r--vendor/derivative/tests/derive-clone-generics.rs29
-rwxr-xr-xvendor/derivative/tests/derive-clone.rs66
-rw-r--r--vendor/derivative/tests/derive-debug-bounds.rs83
-rw-r--r--vendor/derivative/tests/derive-debug-generics.rs93
-rw-r--r--vendor/derivative/tests/derive-debug-packed.rs74
-rw-r--r--vendor/derivative/tests/derive-debug-transparent.rs39
-rw-r--r--vendor/derivative/tests/derive-debug.rs77
-rwxr-xr-xvendor/derivative/tests/derive-default-bounds.rs42
-rw-r--r--vendor/derivative/tests/derive-default.rs78
-rw-r--r--vendor/derivative/tests/derive-eq-packed.rs61
-rw-r--r--vendor/derivative/tests/derive-eq.rs50
-rwxr-xr-xvendor/derivative/tests/derive-hash.rs134
-rw-r--r--vendor/derivative/tests/derive-ord-packed.rs264
-rw-r--r--vendor/derivative/tests/derive-ord.rs266
-rw-r--r--vendor/derivative/tests/derive-partial-eq-packed.rs120
-rw-r--r--vendor/derivative/tests/derive-partial-eq.rs148
-rw-r--r--vendor/derivative/tests/issue-37-turbofish.rs12
-rw-r--r--vendor/derivative/tests/issue-55.rs21
-rw-r--r--vendor/derivative/tests/issue-57.rs19
-rw-r--r--vendor/derivative/tests/issue-58.rs18
-rw-r--r--vendor/derivative/tests/issue-67.rs11
-rw-r--r--vendor/derivative/tests/issue-82.rs13
-rw-r--r--vendor/derivative/tests/rustc-class-implement-traits.rs80
-rw-r--r--vendor/derivative/tests/rustc-deriving-bounds.rs24
-rw-r--r--vendor/derivative/tests/rustc-deriving-clone-array.rs27
-rw-r--r--vendor/derivative/tests/rustc-deriving-clone-enum.rs32
-rw-r--r--vendor/derivative/tests/rustc-deriving-clone-generic-enum.rs31
-rw-r--r--vendor/derivative/tests/rustc-deriving-clone-generic-tuple-struct.rs26
-rw-r--r--vendor/derivative/tests/rustc-deriving-clone-struct.rs47
-rw-r--r--vendor/derivative/tests/rustc-deriving-clone-tuple-struct.rs24
-rw-r--r--vendor/derivative/tests/rustc-deriving-cmp-generic-enum.rs68
-rw-r--r--vendor/derivative/tests/rustc-deriving-cmp-generic-struct-enum.rs66
-rw-r--r--vendor/derivative/tests/rustc-deriving-cmp-generic-struct.rs58
-rw-r--r--vendor/derivative/tests/rustc-deriving-cmp-generic-tuple-struct.rs55
-rw-r--r--vendor/derivative/tests/rustc-deriving-copyclone.rs61
-rw-r--r--vendor/derivative/tests/rustc-deriving-default-box.rs30
-rw-r--r--vendor/derivative/tests/rustc-deriving-enum-single-variant.rs30
-rw-r--r--vendor/derivative/tests/rustc-deriving-hash.rs83
-rw-r--r--vendor/derivative/tests/rustc-deriving-in-fn.rs27
-rw-r--r--vendor/derivative/tests/rustc-deriving-meta-multiple.rs42
-rw-r--r--vendor/derivative/tests/rustc-deriving-meta.rs39
-rw-r--r--vendor/derivative/tests/rustc-deriving-show-2.rs75
-rw-r--r--vendor/derivative/tests/rustc-deriving-show.rs51
-rw-r--r--vendor/derivative/tests/rustc-deriving-via-extension-hash-enum.rs36
-rw-r--r--vendor/derivative/tests/rustc-deriving-via-extension-hash-struct.rs34
-rw-r--r--vendor/derivative/tests/rustc-deriving-via-extension-type-params.rs33
-rw-r--r--vendor/derivative/tests/rustc-expr-copy.rs35
-rw-r--r--vendor/derivative/tests/rustc-exterior.rs41
-rw-r--r--vendor/derivative/tests/rustc-issue-12860.rs69
-rw-r--r--vendor/derivative/tests/rustc-issue-13434.rs38
-rw-r--r--vendor/derivative/tests/rustc-issue-16530.rs32
-rw-r--r--vendor/derivative/tests/rustc-issue-19037.rs38
-rw-r--r--vendor/derivative/tests/rustc-issue-19102.rs26
-rw-r--r--vendor/derivative/tests/rustc-issue-19135.rs30
-rw-r--r--vendor/derivative/tests/rustc-issue-19358.rs38
-rw-r--r--vendor/derivative/tests/rustc-issue-21402.rs29
-rw-r--r--vendor/derivative/tests/rustc-issue-23649-3.rs23
-rw-r--r--vendor/derivative/tests/rustc-issue-24085.rs38
-rw-r--r--vendor/derivative/tests/rustc-issue-25394.rs26
-rw-r--r--vendor/derivative/tests/rustc-issue-28561.rs136
-rw-r--r--vendor/derivative/tests/rustc-issue-29030.rs30
-rw-r--r--vendor/derivative/tests/rustc-issue-29540.rs509
-rw-r--r--vendor/derivative/tests/rustc-issue-29710.rs29
-rw-r--r--vendor/derivative/tests/rustc-issue-32292.rs27
-rw-r--r--vendor/derivative/tests/rustc-issue-3935.rs29
-rw-r--r--vendor/derivative/tests/rustc-issue-42453.rs28
-rw-r--r--vendor/derivative/tests/rustc-issue-58319.rs644
-rw-r--r--vendor/derivative/tests/rustc-issue-6341.rs30
-rw-r--r--vendor/derivative/tests/rustc-typeclasses-eq-example.rs83
-rw-r--r--vendor/derivative/tests/rustc-zero-sized-btreemap-insert.rs41
84 files changed, 5049 insertions, 0 deletions
diff --git a/vendor/derivative/tests/clippy-warning-clone-from.rs b/vendor/derivative/tests/clippy-warning-clone-from.rs
new file mode 100644
index 000000000..6811e1a4b
--- /dev/null
+++ b/vendor/derivative/tests/clippy-warning-clone-from.rs
@@ -0,0 +1,13 @@
+#![deny(clippy::all)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Clone(clone_from = "true"))]
+pub struct Foo {}
+
+fn main() {}
diff --git a/vendor/derivative/tests/compile-fail/derive-debug-unused.rs b/vendor/derivative/tests/compile-fail/derive-debug-unused.rs
new file mode 100644
index 000000000..91cc077c7
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/derive-debug-unused.rs
@@ -0,0 +1,19 @@
+#![deny(dead_code)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Foo {
+ foo: u8,
+ #[derivative(Debug="ignore")]
+ bar: u8,
+}
+
+fn main() {
+ let _ = Foo { foo: 42, bar: 1 };
+} \ No newline at end of file
diff --git a/vendor/derivative/tests/compile-fail/derive-debug-unused.stderr b/vendor/derivative/tests/compile-fail/derive-debug-unused.stderr
new file mode 100644
index 000000000..a56c9a2c6
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/derive-debug-unused.stderr
@@ -0,0 +1,11 @@
+error: field is never used: `bar`
+ --> $DIR/derive-debug-unused.rs:14:5
+ |
+14 | bar: u8,
+ | ^^^^^^^
+ |
+note: lint level defined here
+ --> $DIR/derive-debug-unused.rs:1:9
+ |
+1 | #![deny(dead_code)]
+ | ^^^^^^^^^
diff --git a/vendor/derivative/tests/compile-fail/derive-debug.rs b/vendor/derivative/tests/compile-fail/derive-debug.rs
new file mode 100644
index 000000000..82822a853
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/derive-debug.rs
@@ -0,0 +1,15 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Foo<T, U> {
+ foo: T,
+ #[derivative(Debug(format_with="std::fmt::Debug::fmt"))]
+ bar: U,
+}
+
+fn main() {} \ No newline at end of file
diff --git a/vendor/derivative/tests/compile-fail/derive-debug.stderr b/vendor/derivative/tests/compile-fail/derive-debug.stderr
new file mode 100644
index 000000000..9bca7161e
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/derive-debug.stderr
@@ -0,0 +1,9 @@
+error[E0277]: `U` doesn't implement `std::fmt::Debug`
+ --> $DIR/derive-debug.rs:11:36
+ |
+11 | #[derivative(Debug(format_with="std::fmt::Debug::fmt"))]
+ | ^^^^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
+ |
+ = help: the trait `std::fmt::Debug` is not implemented for `U`
+ = help: consider adding a `where U: std::fmt::Debug` bound
+ = note: required by `std::fmt::Debug::fmt`
diff --git a/vendor/derivative/tests/compile-fail/derive-partial-ord.rs b/vendor/derivative/tests/compile-fail/derive-partial-ord.rs
new file mode 100644
index 000000000..619788be7
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/derive-partial-ord.rs
@@ -0,0 +1,11 @@
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative, PartialEq)]
+#[derivative(PartialOrd)]
+enum Option {
+ Some,
+ None,
+}
+
+fn main() {}
diff --git a/vendor/derivative/tests/compile-fail/derive-partial-ord.stderr b/vendor/derivative/tests/compile-fail/derive-partial-ord.stderr
new file mode 100644
index 000000000..5786998cd
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/derive-partial-ord.stderr
@@ -0,0 +1,5 @@
+error: can't use `#[derivative(PartialOrd)]` on an enumeration without `feature_allow_slow_enum`; see the documentation for more details
+ --> $DIR/derive-partial-ord.rs:5:1
+ |
+5 | #[derivative(PartialOrd)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/vendor/derivative/tests/compile-fail/invalid-attribute.rs b/vendor/derivative/tests/compile-fail/invalid-attribute.rs
new file mode 100644
index 000000000..b03412356
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/invalid-attribute.rs
@@ -0,0 +1,23 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Clone = not_a_string)]
+struct Foo1;
+
+#[derive(Derivative)]
+#[derivative(Clone = 1+2)]
+struct Foo2;
+
+#[derive(Derivative)]
+#[derivative(Default(new = "True"))]
+struct Foo3;
+
+#[derive(Derivative)]
+#[derivative(Debug(bound))]
+struct Foo4;
+
+fn main() {} \ No newline at end of file
diff --git a/vendor/derivative/tests/compile-fail/invalid-attribute.stderr b/vendor/derivative/tests/compile-fail/invalid-attribute.stderr
new file mode 100644
index 000000000..e3e0bb7b6
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/invalid-attribute.stderr
@@ -0,0 +1,23 @@
+error: invalid attribute: expected literal
+ --> $DIR/invalid-attribute.rs:8:22
+ |
+8 | #[derivative(Clone = not_a_string)]
+ | ^^^^^^^^^^^^
+
+error: invalid attribute: expected `,`
+ --> $DIR/invalid-attribute.rs:12:23
+ |
+12 | #[derivative(Clone = 1+2)]
+ | ^
+
+error: expected `"true"` or `"false"` for `new`, got `True`
+ --> $DIR/invalid-attribute.rs:16:28
+ |
+16 | #[derivative(Default(new = "True"))]
+ | ^^^^^^
+
+error: expected named value
+ --> $DIR/invalid-attribute.rs:20:20
+ |
+20 | #[derivative(Debug(bound))]
+ | ^^^^^
diff --git a/vendor/derivative/tests/compile-fail/unknown-attribute.rs b/vendor/derivative/tests/compile-fail/unknown-attribute.rs
new file mode 100644
index 000000000..31cdaf431
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/unknown-attribute.rs
@@ -0,0 +1,15 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Clone = "does_not_exist")]
+struct Foo;
+
+#[derive(Derivative)]
+#[derivative(Clone(does_not_exist = "true"))]
+struct Bar;
+
+fn main() {} \ No newline at end of file
diff --git a/vendor/derivative/tests/compile-fail/unknown-attribute.stderr b/vendor/derivative/tests/compile-fail/unknown-attribute.stderr
new file mode 100644
index 000000000..5383a2f4a
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/unknown-attribute.stderr
@@ -0,0 +1,11 @@
+error: Unknown attribute `does_not_exist` for trait `Clone`
+ --> $DIR/unknown-attribute.rs:8:22
+ |
+8 | #[derivative(Clone = "does_not_exist")]
+ | ^^^^^^^^^^^^^^^^
+
+error: Unknown attribute `does_not_exist` for trait `Clone`
+ --> $DIR/unknown-attribute.rs:12:20
+ |
+12 | #[derivative(Clone(does_not_exist = "true"))]
+ | ^^^^^^^^^^^^^^
diff --git a/vendor/derivative/tests/compile-fail/unknown-derive.rs b/vendor/derivative/tests/compile-fail/unknown-derive.rs
new file mode 100644
index 000000000..0a9a689ae
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/unknown-derive.rs
@@ -0,0 +1,22 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(DoesNotExist1)]
+struct Foo;
+
+#[derive(Derivative)]
+#[derivative(DoesNotExist2(with_some="argument"))]
+struct Bar;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Baz {
+ #[derivative(DoesNotExist3)]
+ _baz: (),
+}
+
+fn main() {} \ No newline at end of file
diff --git a/vendor/derivative/tests/compile-fail/unknown-derive.stderr b/vendor/derivative/tests/compile-fail/unknown-derive.stderr
new file mode 100644
index 000000000..2d83f1834
--- /dev/null
+++ b/vendor/derivative/tests/compile-fail/unknown-derive.stderr
@@ -0,0 +1,17 @@
+error: deriving `DoesNotExist1` is not supported by derivative
+ --> $DIR/unknown-derive.rs:8:14
+ |
+8 | #[derivative(DoesNotExist1)]
+ | ^^^^^^^^^^^^^
+
+error: deriving `DoesNotExist2` is not supported by derivative
+ --> $DIR/unknown-derive.rs:12:14
+ |
+12 | #[derivative(DoesNotExist2(with_some="argument"))]
+ | ^^^^^^^^^^^^^
+
+error: deriving `DoesNotExist3` is not supported by derivative
+ --> $DIR/unknown-derive.rs:18:18
+ |
+18 | #[derivative(DoesNotExist3)]
+ | ^^^^^^^^^^^^^
diff --git a/vendor/derivative/tests/compile-test.rs b/vendor/derivative/tests/compile-test.rs
new file mode 100644
index 000000000..361332a1c
--- /dev/null
+++ b/vendor/derivative/tests/compile-test.rs
@@ -0,0 +1,9 @@
+extern crate trybuild;
+
+#[test]
+#[ignore]
+fn compile_test() {
+ let t = trybuild::TestCases::new();
+ let pattern = std::env::var("DERIVATIVE_TEST_FILTER").unwrap_or_else(|_| String::from("*.rs"));
+ t.compile_fail(format!("tests/compile-fail/{}", pattern));
+}
diff --git a/vendor/derivative/tests/derive-clone-generics.rs b/vendor/derivative/tests/derive-clone-generics.rs
new file mode 100644
index 000000000..96919f9b3
--- /dev/null
+++ b/vendor/derivative/tests/derive-clone-generics.rs
@@ -0,0 +1,29 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+use std::marker::PhantomData;
+
+struct NoClone;
+
+#[derive(Derivative)]
+#[derivative(Clone, PartialEq)]
+struct PhantomField<T> {
+ foo: PhantomData<T>,
+}
+
+#[derive(Derivative)]
+#[derivative(Clone, PartialEq)]
+struct PhantomTuple<T> {
+ foo: PhantomData<(T,)>,
+}
+
+#[test]
+fn main() {
+ let phantom_field = PhantomField::<NoClone> { foo: Default::default() };
+ let phantom_tuple = PhantomTuple::<NoClone> { foo: Default::default() };
+ assert!(phantom_field == phantom_field.clone());
+ assert!(phantom_tuple == phantom_tuple.clone());
+}
diff --git a/vendor/derivative/tests/derive-clone.rs b/vendor/derivative/tests/derive-clone.rs
new file mode 100755
index 000000000..9120d3ee3
--- /dev/null
+++ b/vendor/derivative/tests/derive-clone.rs
@@ -0,0 +1,66 @@
+#![allow(clippy::blacklisted_name, clippy::redundant_clone, clippy::trivially_copy_pass_by_ref)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Debug, Derivative, PartialEq)]
+#[derivative(Clone)]
+struct Foo {
+ foo: u8,
+ #[derivative(Clone(clone_with="seventh"))]
+ bar: u8,
+}
+
+fn seventh(a: &u8) -> u8 {
+ a/7
+}
+
+#[derive(Debug, PartialEq)]
+struct EvilCloneFrom(u8);
+
+impl Clone for EvilCloneFrom {
+ fn clone(&self) -> Self {
+ EvilCloneFrom(self.0)
+ }
+
+ fn clone_from(&mut self, _: &Self) {
+ self.0 = 42;
+ }
+}
+
+#[derive(Derivative)]
+#[derivative(Clone(clone_from="true"))]
+struct StructWithCloneFrom(EvilCloneFrom);
+
+#[derive(Debug, Derivative, PartialEq)]
+#[derivative(Clone(clone_from="true"))]
+enum EnumWithCloneFrom {
+ Evil(EvilCloneFrom),
+ Good(u32),
+ None
+}
+
+#[test]
+fn main() {
+ let foo = Foo { foo: 31, bar: 42 };
+ assert_eq!(Foo { foo: 31, bar: 6 }, foo.clone());
+
+ let mut foo = StructWithCloneFrom(EvilCloneFrom(27));
+ foo.clone_from(&StructWithCloneFrom(EvilCloneFrom(0)));
+ assert_eq!((foo.0).0, 42);
+
+ let mut foo = EnumWithCloneFrom::Evil(EvilCloneFrom(27));
+ foo.clone_from(&EnumWithCloneFrom::Evil(EvilCloneFrom(0)));
+ assert_eq!(foo, EnumWithCloneFrom::Evil(EvilCloneFrom(42)));
+
+ let mut foo = EnumWithCloneFrom::Evil(EvilCloneFrom(27));
+ foo.clone_from(&EnumWithCloneFrom::None);
+ assert_eq!(foo, EnumWithCloneFrom::None);
+
+ let mut foo = EnumWithCloneFrom::Good(27);
+ foo.clone_from(&EnumWithCloneFrom::None);
+ assert_eq!(foo, EnumWithCloneFrom::None);
+}
diff --git a/vendor/derivative/tests/derive-debug-bounds.rs b/vendor/derivative/tests/derive-debug-bounds.rs
new file mode 100644
index 000000000..c572a508f
--- /dev/null
+++ b/vendor/derivative/tests/derive-debug-bounds.rs
@@ -0,0 +1,83 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+use std::fmt::{Formatter, Result as FmtResult};
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Foo<T, U> {
+ foo: T,
+ #[derivative(Debug(format_with="MyDebug::my_fmt", bound="U: MyDebug"))]
+ bar: U,
+}
+
+#[derive(Derivative)]
+#[derivative(Debug(bound="T: std::fmt::Debug, U: MyDebug"))]
+struct Foo2<T, U> {
+ foo: T,
+ #[derivative(Debug(format_with="MyDebug::my_fmt"))]
+ bar: U,
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Bar<T, U> (
+ T,
+ #[derivative(Debug(format_with="MyDebug::my_fmt", bound="U: MyDebug"))]
+ U,
+);
+
+#[derive(Derivative)]
+#[derivative(Debug(bound="T: std::fmt::Debug, U: MyDebug"))]
+struct Bar2<T, U> (
+ T,
+ #[derivative(Debug(format_with="MyDebug::my_fmt"))]
+ U,
+);
+
+struct NoDebug;
+
+struct GenericNeedsNoDebug<T>(T);
+impl<T> std::fmt::Debug for GenericNeedsNoDebug<T> {
+ fn fmt(&self, f: &mut std::fmt::Formatter) -> FmtResult {
+ f.write_str("GenericNeedsNoDebug")
+ }
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct TestUnneededBound<T>( // Test that we don't add T: Debug
+ #[derivative(Debug(bound=""))] GenericNeedsNoDebug<T>,
+);
+
+trait MyDebug {
+ fn my_fmt(&self, f: &mut Formatter) -> FmtResult {
+ f.write_str("MyDebug")
+ }
+}
+
+impl MyDebug for i32 { }
+impl<'a, T> MyDebug for &'a T { }
+
+
+trait ToDebug {
+ fn to_show(&self) -> String;
+}
+
+impl<T: std::fmt::Debug> ToDebug for T {
+ fn to_show(&self) -> String {
+ format!("{:?}", self)
+ }
+}
+
+#[test]
+fn main() {
+ assert_eq!(Foo { foo: 42, bar: 0 }.to_show(), "Foo { foo: 42, bar: MyDebug }".to_string());
+ assert_eq!(Foo2 { foo: 42, bar: 0 }.to_show(), "Foo2 { foo: 42, bar: MyDebug }".to_string());
+ assert_eq!(Bar(42, 0).to_show(), "Bar(42, MyDebug)".to_string());
+ assert_eq!(Bar2(42, 0).to_show(), "Bar2(42, MyDebug)".to_string());
+ assert_eq!(TestUnneededBound(GenericNeedsNoDebug(NoDebug)).to_show(), "TestUnneededBound(GenericNeedsNoDebug)".to_string());
+}
diff --git a/vendor/derivative/tests/derive-debug-generics.rs b/vendor/derivative/tests/derive-debug-generics.rs
new file mode 100644
index 000000000..97104c1d2
--- /dev/null
+++ b/vendor/derivative/tests/derive-debug-generics.rs
@@ -0,0 +1,93 @@
+#![allow(dead_code)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+use std::marker::PhantomData;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Foo<T, U> {
+ foo: T,
+ #[derivative(Debug="ignore")]
+ bar: U,
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Bar<T, U> (
+ T,
+ #[derivative(Debug="ignore")]
+ U,
+);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+enum C<T, U> {
+ V1(T),
+ V2(#[derivative(Debug="ignore")] U),
+ V3(String),
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+enum D<U> {
+ V1 {
+ #[derivative(Debug="ignore")]
+ a: U
+ }
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct F<U>(#[derivative(Debug="ignore")] U);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct G<U>(isize, #[derivative(Debug="ignore")] U);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct J<U>(#[derivative(Debug="ignore")] U);
+
+struct NoDebug;
+
+trait ToDebug {
+ fn to_show(&self) -> String;
+}
+
+impl<T: std::fmt::Debug> ToDebug for T {
+ fn to_show(&self) -> String {
+ format!("{:?}", self)
+ }
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct PhantomField<T> {
+ foo: PhantomData<T>,
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct PhantomTuple<T> {
+ foo: PhantomData<(T,)>,
+}
+
+#[test]
+fn main() {
+ assert_eq!(Foo { foo: 42, bar: NoDebug }.to_show(), "Foo { foo: 42 }".to_string());
+ assert_eq!(Bar(42, NoDebug).to_show(), "Bar(42)".to_string());
+ assert_eq!(C::V1::<i32, NoDebug>(12).to_show(), "V1(12)".to_string());
+ assert_eq!(C::V2::<i32, NoDebug>(NoDebug).to_show(), "V2".to_string());
+ assert_eq!(C::V3::<i32, NoDebug>("foo".to_string()).to_show(), "V3(\"foo\")".to_string());
+ assert_eq!(D::V1 { a: NoDebug }.to_show(), "V1".to_string());
+ assert_eq!(F(NoDebug).to_show(), "F".to_string());
+ assert_eq!(G(42, NoDebug).to_show(), "G(42)".to_string());
+ assert_eq!(J(NoDebug).to_show(), "J".to_string());
+ assert_eq!(&format!("{:?}", PhantomField::<NoDebug> { foo: Default::default() }), "PhantomField { foo: PhantomData }");
+ assert_eq!(&format!("{:?}", PhantomTuple::<NoDebug> { foo: Default::default() }), "PhantomTuple { foo: PhantomData }");
+}
diff --git a/vendor/derivative/tests/derive-debug-packed.rs b/vendor/derivative/tests/derive-debug-packed.rs
new file mode 100644
index 000000000..08ece8fea
--- /dev/null
+++ b/vendor/derivative/tests/derive-debug-packed.rs
@@ -0,0 +1,74 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+#[repr(C, packed)]
+struct Foo {
+ foo: u8,
+ #[derivative(Debug="ignore")]
+ bar: u8,
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+#[repr(C, packed)]
+struct Bar (
+ u8,
+ #[derivative(Debug="ignore")]
+ u8,
+);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+#[repr(C, packed)]
+struct F(#[derivative(Debug="ignore")] isize);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+#[repr(C, packed)]
+struct G(isize, #[derivative(Debug="ignore")] isize);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+#[repr(C, packed)]
+struct J(#[derivative(Debug="ignore")] NoDebug);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+#[repr(C, packed)]
+struct K(isize, #[derivative(Debug="ignore")] NoDebug);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+#[repr(C, packed)]
+struct L {
+ #[derivative(Debug="ignore")]
+ foo: NoDebug
+}
+
+struct NoDebug;
+
+trait ToDebug {
+ fn to_show(&self) -> String;
+}
+
+impl<T: std::fmt::Debug> ToDebug for T {
+ fn to_show(&self) -> String {
+ format!("{:?}", self)
+ }
+}
+
+#[test]
+fn main() {
+ assert_eq!(Foo { foo: 42, bar: 1 }.to_show(), "Foo { foo: 42 }".to_string());
+ assert_eq!(Bar(42, 1).to_show(), "Bar(42)".to_string());
+ assert_eq!(F(42).to_show(), "F".to_string());
+ assert_eq!(G(42, 0).to_show(), "G(42)".to_string());
+ assert_eq!(J(NoDebug).to_show(), "J".to_string());
+ assert_eq!(K(42, NoDebug).to_show(), "K(42)".to_string());
+ assert_eq!(L{ foo: NoDebug }.to_show(), "L".to_string());
+}
diff --git a/vendor/derivative/tests/derive-debug-transparent.rs b/vendor/derivative/tests/derive-debug-transparent.rs
new file mode 100644
index 000000000..fcbc587f8
--- /dev/null
+++ b/vendor/derivative/tests/derive-debug-transparent.rs
@@ -0,0 +1,39 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug="transparent")]
+struct A(isize);
+
+#[derive(Derivative)]
+#[derivative(Debug="transparent")]
+struct B([isize; 1]);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+enum C {
+ Foo(u8),
+ #[derivative(Debug="transparent")]
+ Bar(u8),
+}
+
+trait ToDebug {
+ fn to_show(&self) -> String;
+}
+
+impl<T: std::fmt::Debug> ToDebug for T {
+ fn to_show(&self) -> String {
+ format!("{:?}", self)
+ }
+}
+
+#[test]
+fn main() {
+ assert_eq!(A(42).to_show(), "42".to_string());
+ assert_eq!(B([42]).to_show(), "[42]".to_string());
+ assert_eq!(C::Foo(42).to_show(), "Foo(42)".to_string());
+ assert_eq!(C::Bar(42).to_show(), "42".to_string());
+}
diff --git a/vendor/derivative/tests/derive-debug.rs b/vendor/derivative/tests/derive-debug.rs
new file mode 100644
index 000000000..1c218bbeb
--- /dev/null
+++ b/vendor/derivative/tests/derive-debug.rs
@@ -0,0 +1,77 @@
+#![allow(dead_code)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Foo {
+ foo: u8,
+ #[derivative(Debug="ignore")]
+ bar: u8,
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Bar (
+ u8,
+ #[derivative(Debug="ignore")]
+ u8,
+);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+enum C {
+ V1(isize),
+ V2(#[derivative(Debug="ignore")] i32),
+ V3(String),
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+enum D {
+ V1 {
+ #[derivative(Debug="ignore")]
+ a: isize
+ }
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct F(#[derivative(Debug="ignore")] isize);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct G(isize, #[derivative(Debug="ignore")] isize);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct J(#[derivative(Debug="ignore")] NoDebug);
+
+struct NoDebug;
+
+trait ToDebug {
+ fn to_show(&self) -> String;
+}
+
+impl<T: std::fmt::Debug> ToDebug for T {
+ fn to_show(&self) -> String {
+ format!("{:?}", self)
+ }
+}
+
+#[test]
+fn main() {
+ assert_eq!(Foo { foo: 42, bar: 1 }.to_show(), "Foo { foo: 42 }".to_string());
+ assert_eq!(Bar(42, 1).to_show(), "Bar(42)".to_string());
+ assert_eq!(C::V1(12).to_show(), "V1(12)".to_string());
+ assert_eq!(C::V2(12).to_show(), "V2".to_string());
+ assert_eq!(C::V3("foo".to_string()).to_show(), "V3(\"foo\")".to_string());
+ assert_eq!(D::V1 { a: 42 }.to_show(), "V1".to_string());
+ assert_eq!(F(42).to_show(), "F".to_string());
+ assert_eq!(G(42, 0).to_show(), "G(42)".to_string());
+ assert_eq!(J(NoDebug).to_show(), "J".to_string());
+}
diff --git a/vendor/derivative/tests/derive-default-bounds.rs b/vendor/derivative/tests/derive-default-bounds.rs
new file mode 100755
index 000000000..fda2efc98
--- /dev/null
+++ b/vendor/derivative/tests/derive-default-bounds.rs
@@ -0,0 +1,42 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Debug, Derivative, PartialEq)]
+#[derivative(Default="new")]
+struct Foo<T, U> {
+ foo: T,
+ #[derivative(Default(value="min()", bound="U: std::ops::Not<Output=U>, U: Default"))]
+ bar: U,
+}
+
+#[derive(Debug, Derivative, PartialEq)]
+#[derivative(Default(bound="T: Default, U: std::ops::Not<Output=U>, U: Default", new="true"))]
+struct Bar<T, U> {
+ foo: T,
+ #[derivative(Default(value="min()"))]
+ bar: U,
+}
+
+fn min<T: Default + std::ops::Not<Output=T>>() -> T {
+ !T::default()
+}
+
+#[derive(Debug, Derivative, PartialEq)]
+#[derivative(Default(bound=""))]
+struct WithOption<T> {
+ foo: Option<T>,
+}
+
+struct NonDefault;
+
+#[test]
+fn main() {
+ assert_eq!(Foo::default(), Foo { foo: 0u8, bar: 0xffu8 });
+ assert_eq!(Bar::default(), Bar { foo: 0u8, bar: 0xffu8 });
+ assert_eq!(Foo::new(), Foo { foo: 0u8, bar: 0xffu8 });
+ assert_eq!(Bar::new(), Bar { foo: 0u8, bar: 0xffu8 });
+ WithOption::<NonDefault>::default();
+}
diff --git a/vendor/derivative/tests/derive-default.rs b/vendor/derivative/tests/derive-default.rs
new file mode 100644
index 000000000..34e0806b8
--- /dev/null
+++ b/vendor/derivative/tests/derive-default.rs
@@ -0,0 +1,78 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Debug, Derivative, PartialEq)]
+#[derivative(Default="new")]
+struct Foo {
+ foo: u8,
+ #[derivative(Default(value="42"))]
+ bar: u8,
+}
+
+#[derive(Debug, Derivative, PartialEq)]
+#[derivative(Default(new="true"))]
+struct Bar (
+ u8,
+ #[derivative(Default(value="42"))]
+ u8,
+);
+
+#[derive(Debug, PartialEq)]
+struct B1(u8, u8);
+#[derive(Debug, PartialEq)]
+struct B2{a:u8, b:u8}
+
+#[derive(Debug, Derivative, PartialEq)]
+#[derivative(Default(new="true"))]
+struct Baz (
+ #[derivative(Default(value="[1,2]"))]
+ [u8;2],
+ #[derivative(Default(value="[3;2]"))]
+ [u8;2],
+ #[derivative(Default(value="(4,5)"))]
+ (u8, u8),
+ #[derivative(Default(value="B1(6,7)"))]
+ B1,
+ #[derivative(Default(value="B2{a:8,b:9}"))]
+ B2,
+);
+
+#[derive(Debug, Derivative, PartialEq)]
+#[derivative(Default)]
+enum Enum1 {
+ #[allow(dead_code)]
+ A,
+ #[derivative(Default)]
+ B,
+}
+
+#[derive(Debug, Derivative, PartialEq)]
+#[derivative(Default)]
+enum Enum2 {
+ #[derivative(Default)]
+ A,
+ #[allow(dead_code)]
+ B,
+}
+
+#[derive(Debug, Derivative, PartialEq)]
+#[derivative(Default)]
+struct A(#[derivative(Default(value="NoDefault"))] NoDefault);
+
+#[derive(Debug, PartialEq)]
+struct NoDefault;
+
+#[test]
+fn main() {
+ assert_eq!(Foo::default(), Foo { foo: 0, bar: 42 });
+ assert_eq!(Foo::new(), Foo { foo: 0, bar: 42 });
+ assert_eq!(Bar::default(), Bar(0, 42));
+ assert_eq!(Bar::new(), Bar(0, 42));
+ assert_eq!(Baz::new(), Baz([1,2], [3,3], (4,5), B1(6,7), B2{a:8,b:9}));
+ assert_eq!(A::default(), A(NoDefault));
+ assert_eq!(Enum1::default(), Enum1::B);
+ assert_eq!(Enum2::default(), Enum2::A);
+}
diff --git a/vendor/derivative/tests/derive-eq-packed.rs b/vendor/derivative/tests/derive-eq-packed.rs
new file mode 100644
index 000000000..6e495c274
--- /dev/null
+++ b/vendor/derivative/tests/derive-eq-packed.rs
@@ -0,0 +1,61 @@
+#![allow(clippy::eq_op)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative, PartialEq)]
+#[derivative(Eq)]
+#[repr(C, packed)]
+struct Foo {
+ foo: u8
+}
+
+#[derive(Derivative)]
+#[derivative(Eq)]
+#[repr(C, packed)]
+struct WithPtr<T: ?Sized> {
+ #[derivative(Eq(bound=""))]
+ foo: *const T
+}
+
+impl<T: ?Sized> PartialEq for WithPtr<T> {
+ fn eq(&self, other: &Self) -> bool {
+ self.foo == other.foo
+ }
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq, Eq)]
+#[repr(C, packed)]
+struct Generic<T>(T);
+
+trait SomeTrait {}
+#[derive(Clone, Copy, PartialEq, Eq)]
+struct SomeType {
+ #[allow(dead_code)]
+ foo: u8
+}
+impl SomeTrait for SomeType {}
+
+fn assert_eq<T: Eq>(_: T) {}
+
+#[test]
+fn main() {
+ assert!(Foo { foo: 7 } == Foo { foo: 7 });
+ assert!(Foo { foo: 7 } != Foo { foo: 42 });
+
+ assert_eq(Foo { foo: 7 });
+
+ let ptr1: *const dyn SomeTrait = &SomeType { foo: 0 };
+ let ptr2: *const dyn SomeTrait = &SomeType { foo: 1 };
+ assert!(WithPtr { foo: ptr1 } == WithPtr { foo: ptr1 });
+ assert!(WithPtr { foo: ptr1 } != WithPtr { foo: ptr2 });
+
+ assert_eq(WithPtr { foo: ptr1 });
+
+ assert!(Generic(SomeType { foo: 0 }) == Generic(SomeType { foo: 0 }));
+ assert_eq(Generic(SomeType { foo: 0 }));
+}
diff --git a/vendor/derivative/tests/derive-eq.rs b/vendor/derivative/tests/derive-eq.rs
new file mode 100644
index 000000000..c52a5d3b3
--- /dev/null
+++ b/vendor/derivative/tests/derive-eq.rs
@@ -0,0 +1,50 @@
+#![allow(clippy::eq_op)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative, PartialEq)]
+#[derivative(Eq)]
+struct Foo {
+ foo: u8
+}
+
+#[derive(Derivative)]
+#[derivative(Eq)]
+struct WithPtr<T: ?Sized> {
+ #[derivative(Eq(bound=""))]
+ foo: *const T
+}
+
+impl<T: ?Sized> PartialEq for WithPtr<T> {
+ fn eq(&self, other: &Self) -> bool {
+ self.foo == other.foo
+ }
+}
+
+trait SomeTrait {}
+struct SomeType {
+ #[allow(dead_code)]
+ foo: u8
+}
+impl SomeTrait for SomeType {}
+
+fn assert_eq<T: Eq>(_: T) {}
+
+#[test]
+fn main() {
+ assert!(Foo { foo: 7 } == Foo { foo: 7 });
+ assert!(Foo { foo: 7 } != Foo { foo: 42 });
+
+ assert_eq(Foo { foo: 7 });
+
+ let ptr1: *const dyn SomeTrait = &SomeType { foo: 0 };
+ let ptr2: *const dyn SomeTrait = &SomeType { foo: 1 };
+ assert!(WithPtr { foo: ptr1 } == WithPtr { foo: ptr1 });
+ assert!(WithPtr { foo: ptr1 } != WithPtr { foo: ptr2 });
+
+ assert_eq(WithPtr { foo: ptr1 });
+}
diff --git a/vendor/derivative/tests/derive-hash.rs b/vendor/derivative/tests/derive-hash.rs
new file mode 100755
index 000000000..e7d057aed
--- /dev/null
+++ b/vendor/derivative/tests/derive-hash.rs
@@ -0,0 +1,134 @@
+//! This tests that we compute the same hash as `derive(Hash)`.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+macro_rules! define {
+ ($kw:tt $($rest:tt)*) => {
+ #[derive(Derivative)]
+ #[derivative(Hash)]
+ $kw Ours $($rest)*
+
+ #[derive(Hash)]
+ $kw Theirs $($rest)*
+ }
+}
+
+struct FakeHasher<'a>(&'a mut Vec<u8>);
+impl<'a> ::std::hash::Hasher for FakeHasher<'a> {
+ fn finish(&self) -> u64 {
+ unimplemented!()
+ }
+
+ fn write(&mut self, bytes: &[u8]) {
+ self.0.extend(bytes);
+ }
+}
+
+fn fake_hash<E: ::std::hash::Hash>(e: E) -> Vec<u8> {
+ let mut v = Vec::new();
+ e.hash(&mut FakeHasher(&mut v));
+ v
+}
+
+#[test]
+fn main() {
+ {
+ define! {
+ struct;
+ }
+
+ assert_eq!(fake_hash(Ours), fake_hash(Theirs));
+ }
+
+ {
+ define! {
+ struct {
+ foo: u8
+ }
+ }
+
+ assert_eq!(fake_hash(Ours { foo: 0 }), fake_hash(Theirs { foo: 0 }));
+ assert_eq!(fake_hash(Ours { foo: 42 }), fake_hash(Theirs { foo: 42 }));
+ }
+
+ {
+ define! {
+ struct<'a> {
+ foo: u8,
+ bar: &'a str,
+ }
+ }
+
+ assert_eq!(fake_hash(Ours { foo: 0, bar: "bar" }), fake_hash(Theirs { foo: 0, bar: "bar" }));
+ assert_eq!(fake_hash(Ours { foo: 42, bar: "bar" }), fake_hash(Theirs { foo: 42, bar: "bar" }));
+ }
+
+ {
+ define! {
+ struct<'a> (u8, &'a str);
+ }
+
+ assert_eq!(fake_hash(Ours ( 0, "bar" )), fake_hash(Theirs ( 0, "bar" )));
+ assert_eq!(fake_hash(Ours ( 42, "bar" )), fake_hash(Theirs ( 42, "bar" )));
+ }
+
+ {
+ define! {
+ enum {
+ A, B, C
+ }
+ }
+
+ assert_eq!(fake_hash(Ours::A), fake_hash(Theirs::A));
+ assert_eq!(fake_hash(Ours::B), fake_hash(Theirs::B));
+ assert_eq!(fake_hash(Ours::C), fake_hash(Theirs::C));
+ }
+
+ {
+ define! {
+ enum {
+ A, B = 42, C
+ }
+ }
+
+ assert_eq!(fake_hash(Ours::A), fake_hash(Theirs::A));
+ assert_eq!(fake_hash(Ours::B), fake_hash(Theirs::B));
+ assert_eq!(fake_hash(Ours::C), fake_hash(Theirs::C));
+ }
+
+ {
+ define! {
+ enum {
+ A, B = 42, C=1
+ }
+ }
+
+ assert_eq!(fake_hash(Ours::A), fake_hash(Theirs::A));
+ assert_eq!(fake_hash(Ours::B), fake_hash(Theirs::B));
+ assert_eq!(fake_hash(Ours::C), fake_hash(Theirs::C));
+ }
+
+ {
+ #[derive(Derivative)]
+ #[derivative(Hash)]
+ struct Ours<'a> {
+ foo: u8,
+ #[derivative(Hash="ignore")]
+ bar: &'a str,
+ baz: i64,
+ }
+
+ #[derive(Hash)]
+ struct Theirs {
+ foo: u8,
+ baz: i64,
+ }
+
+ assert_eq!(fake_hash(Ours { foo: 0, bar: "bar", baz: 312 }), fake_hash(Theirs { foo: 0, baz: 312 }));
+ assert_eq!(fake_hash(Ours { foo: 42, bar: "bar", baz: 312 }), fake_hash(Theirs { foo: 42, baz: 312 }));
+ }
+}
diff --git a/vendor/derivative/tests/derive-ord-packed.rs b/vendor/derivative/tests/derive-ord-packed.rs
new file mode 100644
index 000000000..7b4cad711
--- /dev/null
+++ b/vendor/derivative/tests/derive-ord-packed.rs
@@ -0,0 +1,264 @@
+#![allow(renamed_and_removed_lints)] // clippy::cyclomatic_complexity → clippy::cognitive_complexity
+#![allow(clippy::cyclomatic_complexity)]
+#![allow(clippy::cognitive_complexity)]
+#![allow(clippy::trivially_copy_pass_by_ref)]
+#![allow(clippy::unknown_clippy_lints)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(PartialEq, Eq, Derivative)]
+#[derivative(PartialOrd, Ord)]
+#[repr(C, packed)]
+struct Foo {
+ foo: u8,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq, PartialOrd, Ord, Eq)]
+#[repr(C, packed)]
+struct WithPtr<T: ?Sized> {
+ #[derivative(PartialEq(bound = ""))]
+ #[derivative(PartialOrd(bound = ""))]
+ #[derivative(Ord(bound = ""))]
+ #[derivative(Eq(bound = ""))]
+ foo: *const T,
+}
+
+#[derive(PartialEq, Eq, Derivative)]
+#[derivative(PartialOrd, Ord)]
+#[repr(C, packed)]
+struct Empty;
+
+#[derive(PartialEq, Eq, Derivative)]
+#[derivative(PartialOrd, Ord)]
+#[repr(C, packed)]
+struct AllIgnored {
+ #[derivative(PartialOrd = "ignore")]
+ #[derivative(Ord = "ignore")]
+ foo: u8,
+}
+
+#[derive(PartialEq, Eq, Derivative)]
+#[derivative(PartialOrd, Ord)]
+#[repr(C, packed)]
+struct OneIgnored {
+ #[derivative(PartialOrd = "ignore")]
+ #[derivative(Ord = "ignore")]
+ foo: u8,
+ bar: u8,
+}
+
+#[derive(PartialEq, Eq, Derivative)]
+#[derivative(PartialOrd, Ord)]
+#[repr(C, packed)]
+struct Tenth(
+ #[derivative(
+ PartialOrd(compare_with = "partial_cmp_tenth"),
+ Ord(compare_with = "cmp_tenth")
+ )]
+ u8,
+);
+
+fn partial_cmp_tenth(lhs: &u8, rhs: &u8) -> std::option::Option<std::cmp::Ordering> {
+ if *lhs == 0 {
+ None
+ } else {
+ Some((lhs / 10).cmp(&(rhs / 10)))
+ }
+}
+fn cmp_tenth(lhs: &u8, rhs: &u8) -> std::cmp::Ordering {
+ (lhs / 10).cmp(&(rhs / 10))
+}
+
+#[derive(Derivative)]
+#[derivative(PartialOrd, Ord, PartialEq, Eq)]
+#[repr(C, packed)]
+struct Generic<T>(
+ #[derivative(
+ PartialEq = "ignore",
+ PartialOrd(compare_with = "dummy_partial_cmp", bound = ""),
+ Ord(compare_with = "dummy_cmp", bound = "")
+ )]
+ T,
+);
+
+fn dummy_partial_cmp<T>(_: &T, _: &T) -> std::option::Option<std::cmp::Ordering> {
+ Some(std::cmp::Ordering::Less)
+}
+fn dummy_cmp<T>(_: &T, _: &T) -> std::cmp::Ordering {
+ std::cmp::Ordering::Less
+}
+
+struct NonPartialOrd;
+
+#[derive(Derivative)]
+#[derivative(PartialEq, PartialOrd, Ord, Eq)]
+#[repr(C, packed)]
+struct GenericIgnore<T> {
+ f: u32,
+ #[derivative(PartialEq = "ignore")]
+ #[derivative(PartialOrd = "ignore")]
+ #[derivative(Ord = "ignore")]
+ t: T,
+}
+
+trait SomeTrait {}
+
+#[derive(Clone, Copy)]
+struct SomeType {
+ #[allow(dead_code)]
+ foo: u8,
+}
+impl SomeTrait for SomeType {}
+
+#[test]
+fn main() {
+ use std::cmp::Ordering;
+
+ assert_eq!(
+ Foo { foo: 7 }.partial_cmp(&Foo { foo: 42 }),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ Foo { foo: 42 }.partial_cmp(&Foo { foo: 42 }),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ Foo { foo: 42 }.partial_cmp(&Foo { foo: 7 }),
+ Some(Ordering::Greater)
+ );
+ assert_eq!(Foo { foo: 7 }.cmp(&Foo { foo: 42 }), Ordering::Less);
+ assert_eq!(Foo { foo: 42 }.cmp(&Foo { foo: 42 }), Ordering::Equal);
+ assert_eq!(Foo { foo: 42 }.cmp(&Foo { foo: 7 }), Ordering::Greater);
+
+ let pointers: [*const dyn SomeTrait; 2] = [&SomeType { foo: 1 }, &SomeType { foo: 0 }];
+ let ptr1: *const dyn SomeTrait = pointers[0];
+ let ptr2: *const dyn SomeTrait = pointers[1];
+ let (ptr1, ptr2) = (std::cmp::min(ptr1, ptr2), std::cmp::max(ptr1, ptr2));
+ assert_eq!(
+ WithPtr { foo: ptr1 }.partial_cmp(&WithPtr { foo: ptr1 }),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ WithPtr { foo: ptr1 }.cmp(&WithPtr { foo: ptr1 }),
+ Ordering::Equal
+ );
+ assert_eq!(
+ WithPtr { foo: ptr1 }.partial_cmp(&WithPtr { foo: ptr2 }),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ WithPtr { foo: ptr1 }.cmp(&WithPtr { foo: ptr2 }),
+ Ordering::Less
+ );
+
+ assert_eq!(Empty.partial_cmp(&Empty), Some(Ordering::Equal));
+ assert_eq!(
+ AllIgnored { foo: 0 }.partial_cmp(&AllIgnored { foo: 42 }),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 6 }.partial_cmp(&OneIgnored { foo: 42, bar: 7 }),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 6 }.partial_cmp(&OneIgnored { foo: 42, bar: 6 }),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 7 }.partial_cmp(&OneIgnored { foo: 42, bar: 6 }),
+ Some(Ordering::Greater)
+ );
+ assert_eq!(Empty.cmp(&Empty), Ordering::Equal);
+ assert_eq!(
+ AllIgnored { foo: 0 }.cmp(&AllIgnored { foo: 42 }),
+ Ordering::Equal
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 6 }.cmp(&OneIgnored { foo: 42, bar: 7 }),
+ Ordering::Less
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 6 }.cmp(&OneIgnored { foo: 42, bar: 6 }),
+ Ordering::Equal
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 7 }.cmp(&OneIgnored { foo: 42, bar: 6 }),
+ Ordering::Greater
+ );
+
+ assert_eq!(
+ Option::None::<u8>.partial_cmp(&Option::Some(7)),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ Option::Some(6).partial_cmp(&Option::Some(7)),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ Option::Some(42).partial_cmp(&Option::Some(42)),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ Option::None::<u8>.partial_cmp(&Option::None::<u8>),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ Option::Some(7).partial_cmp(&Option::Some(6)),
+ Some(Ordering::Greater)
+ );
+ assert_eq!(
+ Option::Some(7).partial_cmp(&Option::None::<u8>),
+ Some(Ordering::Greater)
+ );
+ assert_eq!(Option::None::<u8>.cmp(&Option::Some(7)), Ordering::Less);
+ assert_eq!(Option::Some(6).cmp(&Option::Some(7)), Ordering::Less);
+ assert_eq!(Option::Some(42).cmp(&Option::Some(42)), Ordering::Equal);
+ assert_eq!(Option::None::<u8>.cmp(&Option::None::<u8>), Ordering::Equal);
+ assert_eq!(Option::Some(7).cmp(&Option::Some(6)), Ordering::Greater);
+ assert_eq!(Option::Some(7).cmp(&Option::None::<u8>), Ordering::Greater);
+
+ assert_eq!(Tenth(0).partial_cmp(&Tenth(67)), None);
+ assert_eq!(Tenth(42).partial_cmp(&Tenth(67)), Some(Ordering::Less));
+ assert_eq!(Tenth(60).partial_cmp(&Tenth(67)), Some(Ordering::Equal));
+ assert_eq!(Tenth(100).partial_cmp(&Tenth(67)), Some(Ordering::Greater));
+ assert_eq!(Tenth(42).cmp(&Tenth(67)), Ordering::Less);
+ assert_eq!(Tenth(60).cmp(&Tenth(67)), Ordering::Equal);
+ assert_eq!(Tenth(100).cmp(&Tenth(67)), Ordering::Greater);
+
+ assert_eq!(
+ Generic(SomeType { foo: 0 }).partial_cmp(&Generic(SomeType { foo: 0 })),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ Generic(SomeType { foo: 0 }).cmp(&Generic(SomeType { foo: 0 })),
+ Ordering::Less
+ );
+
+ assert_eq!(
+ GenericIgnore {
+ f: 123,
+ t: NonPartialOrd
+ }
+ .cmp(&GenericIgnore {
+ f: 123,
+ t: NonPartialOrd
+ }),
+ Ordering::Equal
+ );
+ assert_eq!(
+ GenericIgnore {
+ f: 123,
+ t: NonPartialOrd
+ }
+ .partial_cmp(&GenericIgnore {
+ f: 123,
+ t: NonPartialOrd
+ }),
+ Some(Ordering::Equal)
+ );
+}
diff --git a/vendor/derivative/tests/derive-ord.rs b/vendor/derivative/tests/derive-ord.rs
new file mode 100644
index 000000000..cb55a19e8
--- /dev/null
+++ b/vendor/derivative/tests/derive-ord.rs
@@ -0,0 +1,266 @@
+#![allow(renamed_and_removed_lints)] // clippy::cyclomatic_complexity → clippy::cognitive_complexity
+#![allow(clippy::cyclomatic_complexity)]
+#![allow(clippy::cognitive_complexity)]
+#![allow(clippy::trivially_copy_pass_by_ref)]
+#![allow(clippy::unknown_clippy_lints)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+use std::marker::PhantomData;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(PartialEq, Eq, Derivative)]
+#[derivative(PartialOrd, Ord)]
+struct Foo {
+ foo: u8,
+}
+
+#[derive(PartialEq, Eq, Derivative)]
+#[derivative(
+ PartialOrd = "feature_allow_slow_enum",
+ Ord = "feature_allow_slow_enum"
+)]
+enum Option<T> {
+ None,
+ Some(T),
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq, PartialOrd, Ord, Eq)]
+struct WithPtr<T: ?Sized> {
+ #[derivative(PartialEq(bound = ""))]
+ #[derivative(PartialOrd(bound = ""))]
+ #[derivative(Ord(bound = ""))]
+ #[derivative(Eq(bound = ""))]
+ foo: *const T,
+}
+
+#[derive(PartialEq, Eq, Derivative)]
+#[derivative(PartialOrd, Ord)]
+struct Empty;
+
+#[derive(PartialEq, Eq, Derivative)]
+#[derivative(PartialOrd, Ord)]
+struct AllIgnored {
+ #[derivative(PartialOrd = "ignore")]
+ #[derivative(Ord = "ignore")]
+ foo: u8,
+}
+
+#[derive(PartialEq, Eq, Derivative)]
+#[derivative(PartialOrd, Ord)]
+struct OneIgnored {
+ #[derivative(PartialOrd = "ignore")]
+ #[derivative(Ord = "ignore")]
+ foo: u8,
+ bar: u8,
+}
+
+#[derive(PartialEq, Eq, Derivative)]
+#[derivative(PartialOrd, Ord)]
+struct Tenth(
+ #[derivative(
+ PartialOrd(compare_with = "partial_cmp_tenth"),
+ Ord(compare_with = "cmp_tenth")
+ )]
+ u8,
+);
+
+fn partial_cmp_tenth(lhs: &u8, rhs: &u8) -> std::option::Option<std::cmp::Ordering> {
+ if *lhs == 0 {
+ None
+ } else {
+ Some((lhs / 10).cmp(&(rhs / 10)))
+ }
+}
+fn cmp_tenth(lhs: &u8, rhs: &u8) -> std::cmp::Ordering {
+ (lhs / 10).cmp(&(rhs / 10))
+}
+
+#[derive(Derivative)]
+#[derivative(PartialOrd, Ord, PartialEq, Eq)]
+struct Generic<T>(
+ #[derivative(
+ PartialEq = "ignore",
+ PartialOrd(compare_with = "dummy_partial_cmp", bound = ""),
+ Ord(compare_with = "dummy_cmp", bound = "")
+ )]
+ T,
+);
+
+fn dummy_partial_cmp<T>(_: &T, _: &T) -> std::option::Option<std::cmp::Ordering> {
+ Some(std::cmp::Ordering::Less)
+}
+fn dummy_cmp<T>(_: &T, _: &T) -> std::cmp::Ordering {
+ std::cmp::Ordering::Less
+}
+
+struct NonPartialOrd;
+
+#[derive(Derivative)]
+#[derivative(PartialEq, PartialOrd, Ord, Eq)]
+struct GenericIgnore<T> {
+ f: u32,
+ #[derivative(PartialEq = "ignore")]
+ #[derivative(PartialOrd = "ignore")]
+ #[derivative(Ord = "ignore")]
+ t: PhantomData<T>,
+}
+
+trait SomeTrait {}
+struct SomeType {
+ #[allow(dead_code)]
+ foo: u8,
+}
+impl SomeTrait for SomeType {}
+
+#[test]
+fn main() {
+ use std::cmp::Ordering;
+
+ assert_eq!(
+ Foo { foo: 7 }.partial_cmp(&Foo { foo: 42 }),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ Foo { foo: 42 }.partial_cmp(&Foo { foo: 42 }),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ Foo { foo: 42 }.partial_cmp(&Foo { foo: 7 }),
+ Some(Ordering::Greater)
+ );
+ assert_eq!(Foo { foo: 7 }.cmp(&Foo { foo: 42 }), Ordering::Less);
+ assert_eq!(Foo { foo: 42 }.cmp(&Foo { foo: 42 }), Ordering::Equal);
+ assert_eq!(Foo { foo: 42 }.cmp(&Foo { foo: 7 }), Ordering::Greater);
+
+ let pointers: [*const dyn SomeTrait; 2] = [&SomeType { foo: 1 }, &SomeType { foo: 0 }];
+ let ptr1: *const dyn SomeTrait = pointers[0];
+ let ptr2: *const dyn SomeTrait = pointers[1];
+ let (ptr1, ptr2) = (std::cmp::min(ptr1, ptr2), std::cmp::max(ptr1, ptr2));
+ assert_eq!(
+ WithPtr { foo: ptr1 }.partial_cmp(&WithPtr { foo: ptr1 }),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ WithPtr { foo: ptr1 }.cmp(&WithPtr { foo: ptr1 }),
+ Ordering::Equal
+ );
+ assert_eq!(
+ WithPtr { foo: ptr1 }.partial_cmp(&WithPtr { foo: ptr2 }),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ WithPtr { foo: ptr1 }.cmp(&WithPtr { foo: ptr2 }),
+ Ordering::Less
+ );
+
+ assert_eq!(Empty.partial_cmp(&Empty), Some(Ordering::Equal));
+ assert_eq!(
+ AllIgnored { foo: 0 }.partial_cmp(&AllIgnored { foo: 42 }),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 6 }.partial_cmp(&OneIgnored { foo: 42, bar: 7 }),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 6 }.partial_cmp(&OneIgnored { foo: 42, bar: 6 }),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 7 }.partial_cmp(&OneIgnored { foo: 42, bar: 6 }),
+ Some(Ordering::Greater)
+ );
+ assert_eq!(Empty.cmp(&Empty), Ordering::Equal);
+ assert_eq!(
+ AllIgnored { foo: 0 }.cmp(&AllIgnored { foo: 42 }),
+ Ordering::Equal
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 6 }.cmp(&OneIgnored { foo: 42, bar: 7 }),
+ Ordering::Less
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 6 }.cmp(&OneIgnored { foo: 42, bar: 6 }),
+ Ordering::Equal
+ );
+ assert_eq!(
+ OneIgnored { foo: 0, bar: 7 }.cmp(&OneIgnored { foo: 42, bar: 6 }),
+ Ordering::Greater
+ );
+
+ assert_eq!(
+ Option::None::<u8>.partial_cmp(&Option::Some(7)),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ Option::Some(6).partial_cmp(&Option::Some(7)),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ Option::Some(42).partial_cmp(&Option::Some(42)),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ Option::None::<u8>.partial_cmp(&Option::None::<u8>),
+ Some(Ordering::Equal)
+ );
+ assert_eq!(
+ Option::Some(7).partial_cmp(&Option::Some(6)),
+ Some(Ordering::Greater)
+ );
+ assert_eq!(
+ Option::Some(7).partial_cmp(&Option::None::<u8>),
+ Some(Ordering::Greater)
+ );
+ assert_eq!(Option::None::<u8>.cmp(&Option::Some(7)), Ordering::Less);
+ assert_eq!(Option::Some(6).cmp(&Option::Some(7)), Ordering::Less);
+ assert_eq!(Option::Some(42).cmp(&Option::Some(42)), Ordering::Equal);
+ assert_eq!(Option::None::<u8>.cmp(&Option::None::<u8>), Ordering::Equal);
+ assert_eq!(Option::Some(7).cmp(&Option::Some(6)), Ordering::Greater);
+ assert_eq!(Option::Some(7).cmp(&Option::None::<u8>), Ordering::Greater);
+
+ assert_eq!(Tenth(0).partial_cmp(&Tenth(67)), None);
+ assert_eq!(Tenth(42).partial_cmp(&Tenth(67)), Some(Ordering::Less));
+ assert_eq!(Tenth(60).partial_cmp(&Tenth(67)), Some(Ordering::Equal));
+ assert_eq!(Tenth(100).partial_cmp(&Tenth(67)), Some(Ordering::Greater));
+ assert_eq!(Tenth(42).cmp(&Tenth(67)), Ordering::Less);
+ assert_eq!(Tenth(60).cmp(&Tenth(67)), Ordering::Equal);
+ assert_eq!(Tenth(100).cmp(&Tenth(67)), Ordering::Greater);
+
+ assert_eq!(
+ Generic(SomeType { foo: 0 }).partial_cmp(&Generic(SomeType { foo: 0 })),
+ Some(Ordering::Less)
+ );
+ assert_eq!(
+ Generic(SomeType { foo: 0 }).cmp(&Generic(SomeType { foo: 0 })),
+ Ordering::Less
+ );
+
+ assert_eq!(
+ GenericIgnore {
+ f: 123,
+ t: PhantomData::<NonPartialOrd>::default()
+ }
+ .cmp(&GenericIgnore {
+ f: 123,
+ t: PhantomData::<NonPartialOrd>::default()
+ }),
+ Ordering::Equal
+ );
+ assert_eq!(
+ GenericIgnore {
+ f: 123,
+ t: PhantomData::<NonPartialOrd>::default()
+ }
+ .partial_cmp(&GenericIgnore {
+ f: 123,
+ t: PhantomData::<NonPartialOrd>::default()
+ }),
+ Some(Ordering::Equal)
+ );
+}
diff --git a/vendor/derivative/tests/derive-partial-eq-packed.rs b/vendor/derivative/tests/derive-partial-eq-packed.rs
new file mode 100644
index 000000000..e3bce6c78
--- /dev/null
+++ b/vendor/derivative/tests/derive-partial-eq-packed.rs
@@ -0,0 +1,120 @@
+#![allow(clippy::eq_op, clippy::trivially_copy_pass_by_ref)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+#[repr(C, packed)]
+struct Foo {
+ foo: u8,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+#[repr(C, packed)]
+struct WithPtr<T: ?Sized> {
+ #[derivative(PartialEq(bound = ""))]
+ foo: *const T,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+#[repr(C, packed)]
+struct Empty;
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+#[repr(C, packed)]
+struct AllIgnored {
+ #[derivative(PartialEq = "ignore")]
+ foo: u8,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+#[repr(C, packed)]
+struct OneIgnored {
+ #[derivative(PartialEq = "ignore")]
+ foo: u8,
+ bar: u8,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+#[repr(C, packed)]
+struct Parity(#[derivative(PartialEq(compare_with = "same_parity"))] u8);
+
+fn same_parity(lhs: &u8, rhs: &u8) -> bool {
+ lhs % 2 == rhs % 2
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+#[repr(C, packed)]
+struct Generic<T>(#[derivative(PartialEq(compare_with = "dummy_cmp", bound = ""))] T);
+
+fn dummy_cmp<T>(_: &T, _: &T) -> bool {
+ true
+}
+
+struct NonPartialEq;
+
+#[derive(Derivative)]
+#[derivative(PartialEq, Eq)]
+#[repr(C, packed)]
+struct GenericIgnore<T> {
+ f: u32,
+ #[derivative(PartialEq = "ignore")]
+ t: T,
+}
+
+trait SomeTrait {}
+
+#[derive(Copy, Clone)]
+struct SomeType {
+ #[allow(dead_code)]
+ foo: u8,
+}
+impl SomeTrait for SomeType {}
+
+#[test]
+fn main() {
+ assert!(Foo { foo: 7 } == Foo { foo: 7 });
+ assert!(Foo { foo: 7 } != Foo { foo: 42 });
+
+ let ptr1: *const dyn SomeTrait = &SomeType { foo: 0 };
+ let ptr2: *const dyn SomeTrait = &SomeType { foo: 1 };
+ assert!(WithPtr { foo: ptr1 } == WithPtr { foo: ptr1 });
+ assert!(WithPtr { foo: ptr1 } != WithPtr { foo: ptr2 });
+
+ assert!(Empty == Empty);
+ assert!(AllIgnored { foo: 0 } == AllIgnored { foo: 42 });
+ assert!(OneIgnored { foo: 0, bar: 6 } == OneIgnored { foo: 42, bar: 6 });
+ assert!(OneIgnored { foo: 0, bar: 6 } != OneIgnored { foo: 42, bar: 7 });
+
+ assert!(Option::Some(42) == Option::Some(42));
+ assert!(Option::Some(0) != Option::Some(42));
+ assert!(Option::Some(42) != Option::None);
+ assert!(Option::None != Option::Some(42));
+ assert!(Option::None::<u8> == Option::None::<u8>);
+
+ assert!(Parity(3) == Parity(7));
+ assert!(Parity(2) == Parity(42));
+ assert!(Parity(3) != Parity(42));
+ assert!(Parity(2) != Parity(7));
+
+ assert!(Generic(SomeType { foo: 0 }) == Generic(SomeType { foo: 0 }));
+ assert!(
+ GenericIgnore {
+ f: 123,
+ t: NonPartialEq
+ } == GenericIgnore {
+ f: 123,
+ t: NonPartialEq
+ }
+ );
+}
diff --git a/vendor/derivative/tests/derive-partial-eq.rs b/vendor/derivative/tests/derive-partial-eq.rs
new file mode 100644
index 000000000..d9e67f38d
--- /dev/null
+++ b/vendor/derivative/tests/derive-partial-eq.rs
@@ -0,0 +1,148 @@
+#![allow(clippy::eq_op, clippy::trivially_copy_pass_by_ref, dead_code)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+use std::marker::PhantomData;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+struct Foo {
+ foo: u8,
+}
+
+/// Test for backward compatibility.
+#[derive(Derivative)]
+#[derivative(PartialEq = "feature_allow_slow_enum")]
+#[allow(unused)]
+enum AllowsFeature<T> {
+ Some(T),
+ None,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+enum Option<T> {
+ Some(T),
+ None,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+enum SimpleEnum {
+ Some,
+ None,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+enum UnitEnum {
+ Single,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+struct WithPtr<T: ?Sized> {
+ #[derivative(PartialEq(bound = ""))]
+ foo: *const T,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+struct Empty;
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+struct AllIgnored {
+ #[derivative(PartialEq = "ignore")]
+ foo: u8,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+struct OneIgnored {
+ #[derivative(PartialEq = "ignore")]
+ foo: u8,
+ bar: u8,
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+struct Parity(#[derivative(PartialEq(compare_with = "same_parity"))] u8);
+
+fn same_parity(lhs: &u8, rhs: &u8) -> bool {
+ lhs % 2 == rhs % 2
+}
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+struct Generic<T>(#[derivative(PartialEq(compare_with = "dummy_cmp", bound = ""))] T);
+
+fn dummy_cmp<T>(_: &T, _: &T) -> bool {
+ true
+}
+
+struct NonPartialEq;
+
+#[derive(Derivative)]
+#[derivative(PartialEq, Eq)]
+struct GenericIgnore<T> {
+ f: u32,
+ #[derivative(PartialEq = "ignore")]
+ t: PhantomData<T>,
+}
+
+trait SomeTrait {}
+struct SomeType {
+ #[allow(dead_code)]
+ foo: u8,
+}
+impl SomeTrait for SomeType {}
+
+#[test]
+fn main() {
+ assert!(Foo { foo: 7 } == Foo { foo: 7 });
+ assert!(Foo { foo: 7 } != Foo { foo: 42 });
+
+ let ptr1: *const dyn SomeTrait = &SomeType { foo: 0 };
+ let ptr2: *const dyn SomeTrait = &SomeType { foo: 1 };
+ assert!(WithPtr { foo: ptr1 } == WithPtr { foo: ptr1 });
+ assert!(WithPtr { foo: ptr1 } != WithPtr { foo: ptr2 });
+
+ assert!(Empty == Empty);
+ assert!(AllIgnored { foo: 0 } == AllIgnored { foo: 42 });
+ assert!(OneIgnored { foo: 0, bar: 6 } == OneIgnored { foo: 42, bar: 6 });
+ assert!(OneIgnored { foo: 0, bar: 6 } != OneIgnored { foo: 42, bar: 7 });
+
+ assert!(Option::Some(42) == Option::Some(42));
+ assert!(Option::Some(0) != Option::Some(42));
+ assert!(Option::Some(42) != Option::None);
+ assert!(Option::None != Option::Some(42));
+ assert!(Option::None::<u8> == Option::None::<u8>);
+
+ assert!(SimpleEnum::Some == SimpleEnum::Some);
+ assert!(SimpleEnum::None == SimpleEnum::None);
+ assert!(SimpleEnum::Some != SimpleEnum::None);
+ assert!(SimpleEnum::None != SimpleEnum::Some);
+
+ assert!(UnitEnum::Single == UnitEnum::Single);
+
+ assert!(Parity(3) == Parity(7));
+ assert!(Parity(2) == Parity(42));
+ assert!(Parity(3) != Parity(42));
+ assert!(Parity(2) != Parity(7));
+
+ assert!(Generic(SomeType { foo: 0 }) == Generic(SomeType { foo: 0 }));
+ assert!(
+ GenericIgnore {
+ f: 123,
+ t: PhantomData::<NonPartialEq>::default()
+ } == GenericIgnore {
+ f: 123,
+ t: PhantomData::<NonPartialEq>::default()
+ }
+ );
+}
diff --git a/vendor/derivative/tests/issue-37-turbofish.rs b/vendor/derivative/tests/issue-37-turbofish.rs
new file mode 100644
index 000000000..4e634b8c1
--- /dev/null
+++ b/vendor/derivative/tests/issue-37-turbofish.rs
@@ -0,0 +1,12 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+pub struct A {
+ #[derivative(Debug(format_with = "std::fmt::Debug::fmt"))]
+ v: u64,
+}
diff --git a/vendor/derivative/tests/issue-55.rs b/vendor/derivative/tests/issue-55.rs
new file mode 100644
index 000000000..7b98142f5
--- /dev/null
+++ b/vendor/derivative/tests/issue-55.rs
@@ -0,0 +1,21 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+trait Foo {}
+
+fn fmt<T>(_: &T, _: &mut std::fmt::Formatter) -> std::fmt::Result {
+ unimplemented!()
+}
+
+#[derive(Debug)]
+struct Qux<'a, T: Foo>(&'a T);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct _Bar<'a, T: Foo>(#[derivative(Debug(format_with="fmt"))] Qux<'a, T>);
+
+fn main() {
+} \ No newline at end of file
diff --git a/vendor/derivative/tests/issue-57.rs b/vendor/derivative/tests/issue-57.rs
new file mode 100644
index 000000000..e3dc6502c
--- /dev/null
+++ b/vendor/derivative/tests/issue-57.rs
@@ -0,0 +1,19 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+macro_rules! gen {
+ ($name:ident) => {
+ #[derive(Derivative)]
+ #[derivative(Debug)]
+ pub struct $name {
+ a: i32
+ }
+ };
+}
+
+gen!(Test);
+
+fn main() {} \ No newline at end of file
diff --git a/vendor/derivative/tests/issue-58.rs b/vendor/derivative/tests/issue-58.rs
new file mode 100644
index 000000000..313ffd5c2
--- /dev/null
+++ b/vendor/derivative/tests/issue-58.rs
@@ -0,0 +1,18 @@
+#![deny(clippy::all)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Default, Derivative)]
+#[derivative(Debug)]
+pub struct Foo {
+ foo: u8,
+}
+
+fn main() {
+ let foo1 = Foo::default();
+ println!("foo = {:?}", foo1);
+}
diff --git a/vendor/derivative/tests/issue-67.rs b/vendor/derivative/tests/issue-67.rs
new file mode 100644
index 000000000..27af67fb5
--- /dev/null
+++ b/vendor/derivative/tests/issue-67.rs
@@ -0,0 +1,11 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Hash)]
+enum _Enumeration<T> {
+ _Variant(T),
+} \ No newline at end of file
diff --git a/vendor/derivative/tests/issue-82.rs b/vendor/derivative/tests/issue-82.rs
new file mode 100644
index 000000000..69913d494
--- /dev/null
+++ b/vendor/derivative/tests/issue-82.rs
@@ -0,0 +1,13 @@
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Copy, Clone, Derivative)]
+#[derivative(Debug)]
+#[repr(C, packed)]
+struct Test {
+ a: u8,
+ b: u32,
+} \ No newline at end of file
diff --git a/vendor/derivative/tests/rustc-class-implement-traits.rs b/vendor/derivative/tests/rustc-class-implement-traits.rs
new file mode 100644
index 000000000..3e4574dfc
--- /dev/null
+++ b/vendor/derivative/tests/rustc-class-implement-traits.rs
@@ -0,0 +1,80 @@
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(non_camel_case_types)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+trait noisy {
+ fn speak(&mut self);
+}
+
+#[derive(Derivative)]
+#[derivative(Clone)]
+struct cat {
+ meows : usize,
+
+ how_hungry : isize,
+ name : String,
+}
+
+impl cat {
+ fn meow(&mut self) {
+ println!("Meow");
+ self.meows += 1_usize;
+ if self.meows % 5_usize == 0_usize {
+ self.how_hungry += 1;
+ }
+ }
+}
+
+impl cat {
+ pub fn eat(&mut self) -> bool {
+ if self.how_hungry > 0 {
+ println!("OM NOM NOM");
+ self.how_hungry -= 2;
+ true
+ } else {
+ println!("Not hungry!");
+ false
+ }
+ }
+}
+
+impl noisy for cat {
+ fn speak(&mut self) { self.meow(); }
+}
+
+fn cat(in_x : usize, in_y : isize, in_name: String) -> cat {
+ cat {
+ meows: in_x,
+ how_hungry: in_y,
+ name: in_name,
+ }
+}
+
+
+fn make_speak<C:noisy>(mut c: C) {
+ c.speak();
+}
+
+#[test]
+fn main() {
+ let mut nyan = cat(0_usize, 2, "nyan".to_string());
+ nyan.eat();
+ assert!((!nyan.eat()));
+ for _ in 1_usize..10_usize {
+ make_speak(nyan.clone());
+ }
+}
diff --git a/vendor/derivative/tests/rustc-deriving-bounds.rs b/vendor/derivative/tests/rustc-deriving-bounds.rs
new file mode 100644
index 000000000..7be0c57e7
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-bounds.rs
@@ -0,0 +1,24 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Copy, Clone)]
+struct Test;
+
+#[test]
+fn main() {
+ let _ = Test;
+}
diff --git a/vendor/derivative/tests/rustc-deriving-clone-array.rs b/vendor/derivative/tests/rustc-deriving-clone-array.rs
new file mode 100644
index 000000000..446eb49cf
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-clone-array.rs
@@ -0,0 +1,27 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// test for issue #30244
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Copy, Clone)]
+#[allow(dead_code)]
+struct Array {
+ arr: [[u8; 256]; 4]
+}
+
+#[test]
+fn main() {}
diff --git a/vendor/derivative/tests/rustc-deriving-clone-enum.rs b/vendor/derivative/tests/rustc-deriving-clone-enum.rs
new file mode 100644
index 000000000..0464d970f
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-clone-enum.rs
@@ -0,0 +1,32 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Clone)]
+enum E {
+ A,
+ B(()),
+ C,
+}
+
+#[test]
+fn main() {
+ let _ = E::A.clone();
+ let _ = E::B(()).clone();
+ let _ = E::C.clone();
+}
diff --git a/vendor/derivative/tests/rustc-deriving-clone-generic-enum.rs b/vendor/derivative/tests/rustc-deriving-clone-generic-enum.rs
new file mode 100644
index 000000000..58b9b1e28
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-clone-generic-enum.rs
@@ -0,0 +1,31 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Clone)]
+#[allow(dead_code)]
+enum E<T,U> {
+ A(T),
+ B(T,U),
+ C
+}
+
+#[test]
+fn main() {
+ let _ = E::A::<isize, isize>(1).clone();
+}
diff --git a/vendor/derivative/tests/rustc-deriving-clone-generic-tuple-struct.rs b/vendor/derivative/tests/rustc-deriving-clone-generic-tuple-struct.rs
new file mode 100644
index 000000000..e1cc22454
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-clone-generic-tuple-struct.rs
@@ -0,0 +1,26 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Clone)]
+struct S<T>(T, ());
+
+#[test]
+fn main() {
+ let _ = S(1, ()).clone();
+}
diff --git a/vendor/derivative/tests/rustc-deriving-clone-struct.rs b/vendor/derivative/tests/rustc-deriving-clone-struct.rs
new file mode 100644
index 000000000..2e0440518
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-clone-struct.rs
@@ -0,0 +1,47 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#![allow(clippy::redundant_clone)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Default, Derivative)]
+#[derivative(Clone)]
+struct S {
+ _int: isize,
+ _i8: i8,
+ _i16: i16,
+ _i32: i32,
+ _i64: i64,
+
+ _uint: usize,
+ _u8: u8,
+ _u16: u16,
+ _u32: u32,
+ _u64: u64,
+
+ _f32: f32,
+ _f64: f64,
+
+ _bool: bool,
+ _char: char,
+ _nil: ()
+}
+
+#[test]
+fn main() {
+ let _ = S::default().clone();
+}
diff --git a/vendor/derivative/tests/rustc-deriving-clone-tuple-struct.rs b/vendor/derivative/tests/rustc-deriving-clone-tuple-struct.rs
new file mode 100644
index 000000000..f5815d633
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-clone-tuple-struct.rs
@@ -0,0 +1,24 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Clone)]
+struct S((), ());
+
+#[test]
+fn main() {}
diff --git a/vendor/derivative/tests/rustc-deriving-cmp-generic-enum.rs b/vendor/derivative/tests/rustc-deriving-cmp-generic-enum.rs
new file mode 100644
index 000000000..d7bbe3998
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-cmp-generic-enum.rs
@@ -0,0 +1,68 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// no-pretty-expanded FIXME #15189
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(
+ PartialEq = "feature_allow_slow_enum",
+ Eq,
+ PartialOrd = "feature_allow_slow_enum",
+ Ord = "feature_allow_slow_enum"
+)]
+enum E<T> {
+ V0,
+ V1(T),
+ V2(T, T),
+}
+
+#[test]
+fn main() {
+ let e0 = E::V0;
+ let e11 = E::V1(1);
+ let e12 = E::V1(2);
+ let e21 = E::V2(1, 1);
+ let e22 = E::V2(1, 2);
+
+ // in order for both PartialOrd and Ord
+ let es = [e0, e11, e12, e21, e22];
+
+ for (i, e1) in es.iter().enumerate() {
+ for (j, e2) in es.iter().enumerate() {
+ let ord = i.cmp(&j);
+
+ let eq = i == j;
+ let lt = i < j;
+ let le = i <= j;
+ let gt = i > j;
+ let ge = i >= j;
+
+ // PartialEq
+ assert_eq!(*e1 == *e2, eq);
+ assert_eq!(*e1 != *e2, !eq);
+
+ // PartialOrd
+ assert_eq!(*e1 < *e2, lt);
+ assert_eq!(*e1 > *e2, gt);
+
+ assert_eq!(*e1 <= *e2, le);
+ assert_eq!(*e1 >= *e2, ge);
+
+ // Ord
+ assert_eq!(e1.cmp(e2), ord);
+ }
+ }
+}
diff --git a/vendor/derivative/tests/rustc-deriving-cmp-generic-struct-enum.rs b/vendor/derivative/tests/rustc-deriving-cmp-generic-struct-enum.rs
new file mode 100644
index 000000000..780ef3a79
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-cmp-generic-struct-enum.rs
@@ -0,0 +1,66 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// no-pretty-expanded FIXME #15189
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(
+ PartialEq = "feature_allow_slow_enum",
+ Eq,
+ PartialOrd = "feature_allow_slow_enum",
+ Ord = "feature_allow_slow_enum"
+)]
+enum ES<T> {
+ ES1 { x: T },
+ ES2 { x: T, y: T },
+}
+
+
+pub fn main() {
+ let (es11, es12, es21, es22) = (
+ ES::ES1 { x: 1 },
+ ES::ES1 { x: 2 },
+ ES::ES2 { x: 1, y: 1 },
+ ES::ES2 { x: 1, y: 2 },
+ );
+
+ // in order for both PartialOrd and Ord
+ let ess = [es11, es12, es21, es22];
+
+ for (i, es1) in ess.iter().enumerate() {
+ for (j, es2) in ess.iter().enumerate() {
+ let ord = i.cmp(&j);
+
+ let eq = i == j;
+ let (lt, le) = (i < j, i <= j);
+ let (gt, ge) = (i > j, i >= j);
+
+ // PartialEq
+ assert_eq!(*es1 == *es2, eq);
+ assert_eq!(*es1 != *es2, !eq);
+
+ // PartialOrd
+ assert_eq!(*es1 < *es2, lt);
+ assert_eq!(*es1 > *es2, gt);
+
+ assert_eq!(*es1 <= *es2, le);
+ assert_eq!(*es1 >= *es2, ge);
+
+ // Ord
+ assert_eq!(es1.cmp(es2), ord);
+ }
+ }
+}
diff --git a/vendor/derivative/tests/rustc-deriving-cmp-generic-struct.rs b/vendor/derivative/tests/rustc-deriving-cmp-generic-struct.rs
new file mode 100644
index 000000000..2c387282e
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-cmp-generic-struct.rs
@@ -0,0 +1,58 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// no-pretty-expanded FIXME #15189
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(PartialEq, Eq, PartialOrd, Ord)]
+struct S<T> {
+ x: T,
+ y: T,
+}
+
+pub fn main() {
+ let s1 = S { x: 1, y: 1 };
+ let s2 = S { x: 1, y: 2 };
+
+ // in order for both PartialOrd and Ord
+ let ss = [s1, s2];
+
+ for (i, s1) in ss.iter().enumerate() {
+ for (j, s2) in ss.iter().enumerate() {
+ let ord = i.cmp(&j);
+
+ let eq = i == j;
+ let lt = i < j;
+ let le = i <= j;
+ let gt = i > j;
+ let ge = i >= j;
+
+ // PartialEq
+ assert_eq!(*s1 == *s2, eq);
+ assert_eq!(*s1 != *s2, !eq);
+
+ // PartialOrd
+ assert_eq!(*s1 < *s2, lt);
+ assert_eq!(*s1 > *s2, gt);
+
+ assert_eq!(*s1 <= *s2, le);
+ assert_eq!(*s1 >= *s2, ge);
+
+ // Ord
+ assert_eq!(s1.cmp(s2), ord);
+ }
+ }
+}
diff --git a/vendor/derivative/tests/rustc-deriving-cmp-generic-tuple-struct.rs b/vendor/derivative/tests/rustc-deriving-cmp-generic-tuple-struct.rs
new file mode 100644
index 000000000..ffcb177ef
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-cmp-generic-tuple-struct.rs
@@ -0,0 +1,55 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// no-pretty-expanded FIXME #15189
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(PartialEq, Eq, PartialOrd, Ord)]
+struct TS<T>(T, T);
+
+pub fn main() {
+ let ts1 = TS(1, 1);
+ let ts2 = TS(1, 2);
+
+ // in order for both PartialOrd and Ord
+ let tss = [ts1, ts2];
+
+ for (i, ts1) in tss.iter().enumerate() {
+ for (j, ts2) in tss.iter().enumerate() {
+ let ord = i.cmp(&j);
+
+ let eq = i == j;
+ let lt = i < j;
+ let le = i <= j;
+ let gt = i > j;
+ let ge = i >= j;
+
+ // PartialEq
+ assert_eq!(*ts1 == *ts2, eq);
+ assert_eq!(*ts1 != *ts2, !eq);
+
+ // PartialOrd
+ assert_eq!(*ts1 < *ts2, lt);
+ assert_eq!(*ts1 > *ts2, gt);
+
+ assert_eq!(*ts1 <= *ts2, le);
+ assert_eq!(*ts1 >= *ts2, ge);
+
+ // Ord
+ assert_eq!(ts1.cmp(ts2), ord);
+ }
+ }
+}
diff --git a/vendor/derivative/tests/rustc-deriving-copyclone.rs b/vendor/derivative/tests/rustc-deriving-copyclone.rs
new file mode 100644
index 000000000..873263386
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-copyclone.rs
@@ -0,0 +1,61 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Test that #[derive(Copy, Clone)] produces a shallow copy
+//! even when a member violates RFC 1521
+
+#![allow(clippy::clone_on_copy)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+use std::sync::atomic::{AtomicBool, Ordering};
+
+/// A struct that pretends to be Copy, but actually does something
+/// in its Clone impl
+#[derive(Copy)]
+struct Liar;
+
+/// Static cooperating with the rogue Clone impl
+static CLONED: AtomicBool = AtomicBool::new(false);
+
+impl Clone for Liar {
+ fn clone(&self) -> Self {
+ // this makes Clone vs Copy observable
+ CLONED.store(true, Ordering::SeqCst);
+
+ *self
+ }
+}
+
+/// This struct is actually Copy... at least, it thinks it is!
+#[derive(Copy, Clone)]
+struct TheirTheir(Liar);
+
+#[derive(Derivative)]
+#[derivative(Copy, Clone)]
+struct OurOur1(Liar);
+#[derive(Derivative)]
+#[derivative(Clone, Copy)]
+struct OurOur2(Liar);
+
+#[test]
+fn main() {
+ let _ = TheirTheir(Liar).clone();
+ assert!(!CLONED.load(Ordering::SeqCst), "TheirTheir");
+
+ let _ = OurOur1(Liar).clone();
+ assert!(!CLONED.load(Ordering::SeqCst), "OurOur1");
+ let _ = OurOur2(Liar).clone();
+ assert!(!CLONED.load(Ordering::SeqCst), "OurOur2");
+}
diff --git a/vendor/derivative/tests/rustc-deriving-default-box.rs b/vendor/derivative/tests/rustc-deriving-default-box.rs
new file mode 100644
index 000000000..adcdd9261
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-default-box.rs
@@ -0,0 +1,30 @@
+// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+use std::default::Default;
+
+#[derive(Derivative)]
+#[derivative(Default)]
+struct A {
+ foo: Box<[bool]>,
+}
+
+#[test]
+fn main() {
+ let a: A = Default::default();
+ let b: Box<[_]> = Box::<[bool; 0]>::new([]);
+ assert_eq!(a.foo, b);
+}
diff --git a/vendor/derivative/tests/rustc-deriving-enum-single-variant.rs b/vendor/derivative/tests/rustc-deriving-enum-single-variant.rs
new file mode 100644
index 000000000..70b647c88
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-enum-single-variant.rs
@@ -0,0 +1,30 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+pub type TaskId = isize;
+
+#[derive(Derivative)]
+#[derivative(PartialEq="feature_allow_slow_enum")]
+pub enum Task {
+ TaskHandle(TaskId)
+}
+
+#[test]
+fn main() {
+ let _ = Task::TaskHandle(42);
+}
diff --git a/vendor/derivative/tests/rustc-deriving-hash.rs b/vendor/derivative/tests/rustc-deriving-hash.rs
new file mode 100644
index 000000000..bae6e8c8e
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-hash.rs
@@ -0,0 +1,83 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(non_camel_case_types)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+use std::hash::{Hash, Hasher};
+use std::collections::hash_map::DefaultHasher;
+
+#[derive(Derivative)]
+#[derivative(Hash)]
+struct Person {
+ id: u16,
+ name: String,
+ phone: u64,
+}
+
+// test for hygiene name collisions
+#[derive(Derivative)]
+#[derivative(Hash)] struct __H__H;
+#[derive(Derivative)]
+#[allow(dead_code)] #[derivative(Hash)] struct Collision<__H> ( __H );
+// TODO(rustc) #[derivative(Hash)] enum Collision<__H> { __H { __H__H: __H } }
+
+#[derive(Derivative)]
+#[derivative(Hash)]
+enum E { A=1, B }
+
+fn hash<T: Hash>(t: &T) -> u64 {
+ let mut s = DefaultHasher::new();
+ t.hash(&mut s);
+ s.finish()
+}
+
+struct FakeHasher<'a>(&'a mut Vec<u8>);
+impl<'a> Hasher for FakeHasher<'a> {
+ fn finish(&self) -> u64 {
+ unimplemented!()
+ }
+
+ fn write(&mut self, bytes: &[u8]) {
+ self.0.extend(bytes);
+ }
+}
+
+fn fake_hash(v: &mut Vec<u8>, e: E) {
+ e.hash(&mut FakeHasher(v));
+}
+
+#[test]
+fn main() {
+ let person1 = Person {
+ id: 5,
+ name: "Janet".to_string(),
+ phone: 555_666_777,
+ };
+ let person2 = Person {
+ id: 5,
+ name: "Bob".to_string(),
+ phone: 555_666_777,
+ };
+ assert_eq!(hash(&person1), hash(&person1));
+ assert!(hash(&person1) != hash(&person2));
+
+ // test #21714
+ let mut va = vec![];
+ let mut vb = vec![];
+ fake_hash(&mut va, E::A);
+ fake_hash(&mut vb, E::B);
+ assert!(va != vb);
+}
diff --git a/vendor/derivative/tests/rustc-deriving-in-fn.rs b/vendor/derivative/tests/rustc-deriving-in-fn.rs
new file mode 100644
index 000000000..7d38e749d
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-in-fn.rs
@@ -0,0 +1,27 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[test]
+fn main() {
+ #[derive(Derivative)]
+ #[derivative(Debug)]
+ struct Foo {
+ foo: isize,
+ }
+
+ let f = Foo { foo: 10 };
+ format!("{:?}", f);
+}
diff --git a/vendor/derivative/tests/rustc-deriving-meta-multiple.rs b/vendor/derivative/tests/rustc-deriving-meta-multiple.rs
new file mode 100644
index 000000000..beb41d696
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-meta-multiple.rs
@@ -0,0 +1,42 @@
+// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#![allow(clippy::eq_op, clippy::redundant_clone)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+use std::hash::Hash;
+
+// testing multiple separate deriving attributes
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+#[derivative(Clone)]
+#[derivative(Hash)]
+struct Foo {
+ bar: usize,
+ baz: isize
+}
+
+fn hash<T: Hash>(_t: &T) {}
+
+#[test]
+fn main() {
+ let a = Foo {bar: 4, baz: -3};
+
+ let _ = a == a; // check for PartialEq impl w/o testing its correctness
+ let _ = a.clone(); // check for Clone impl w/o testing its correctness
+ hash(&a); // check for Hash impl w/o testing its correctness
+}
diff --git a/vendor/derivative/tests/rustc-deriving-meta.rs b/vendor/derivative/tests/rustc-deriving-meta.rs
new file mode 100644
index 000000000..9281e3e05
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-meta.rs
@@ -0,0 +1,39 @@
+// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#![allow(clippy::eq_op, clippy::redundant_clone)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+use std::hash::Hash;
+
+#[derive(Derivative)]
+#[derivative(PartialEq, Clone, Hash)]
+struct Foo {
+ bar: usize,
+ baz: isize
+}
+
+fn hash<T: Hash>(_t: &T) {}
+
+#[test]
+fn main() {
+ let a = Foo {bar: 4, baz: -3};
+
+ let _ = a == a; // check for PartialEq impl w/o testing its correctness
+ let _ = a.clone(); // check for Clone impl w/o testing its correctness
+ hash(&a); // check for Hash impl w/o testing its correctness
+}
diff --git a/vendor/derivative/tests/rustc-deriving-show-2.rs b/vendor/derivative/tests/rustc-deriving-show-2.rs
new file mode 100644
index 000000000..f4c173cb4
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-show-2.rs
@@ -0,0 +1,75 @@
+#![allow(dead_code)]
+#![deny(unused_variables)] // We used to generate warning: unused variable: `f`
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+use std::fmt;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+enum A {}
+#[derive(Derivative)]
+#[derivative(Debug)]
+enum B { V1, V2, V3 }
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+enum C { V1(isize), V2(B), V3(String) }
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+enum D { V1{ a: isize } }
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct E;
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct F(isize);
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct G(isize, isize);
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct H { a: isize }
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct I { a: isize, b: isize }
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct J(Custom);
+
+struct Custom;
+impl fmt::Debug for Custom {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "yay")
+ }
+}
+
+trait ToDebug {
+ fn to_show(&self) -> String;
+}
+
+impl<T: fmt::Debug> ToDebug for T {
+ fn to_show(&self) -> String {
+ format!("{:?}", self)
+ }
+}
+
+#[test]
+fn main() {
+ assert_eq!(B::V1.to_show(), "V1".to_string());
+ assert_eq!(B::V2.to_show(), "V2".to_string());
+ assert_eq!(C::V1(3).to_show(), "V1(3)".to_string());
+ assert_eq!(C::V2(B::V2).to_show(), "V2(V2)".to_string());
+ assert_eq!(D::V1{ a: 2 }.to_show(), "V1 { a: 2 }".to_string());
+ assert_eq!(E.to_show(), "E".to_string());
+ assert_eq!(F(3).to_show(), "F(3)".to_string());
+ assert_eq!(G(3, 4).to_show(), "G(3, 4)".to_string());
+ assert_eq!(I{ a: 2, b: 4 }.to_show(), "I { a: 2, b: 4 }".to_string());
+ assert_eq!(J(Custom).to_show(), "J(yay)".to_string());
+}
diff --git a/vendor/derivative/tests/rustc-deriving-show.rs b/vendor/derivative/tests/rustc-deriving-show.rs
new file mode 100644
index 000000000..525d6020e
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-show.rs
@@ -0,0 +1,51 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Unit;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Tuple(isize, usize);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Struct { x: isize, y: usize }
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+enum Enum {
+ Nullary,
+ Variant(isize, usize),
+ StructVariant { x: isize, y : usize }
+}
+
+macro_rules! t {
+ ($x:expr, $expected:expr) => {
+ assert_eq!(format!("{:?}", $x), $expected.to_string())
+ }
+}
+
+#[test]
+fn main() {
+ t!(Unit, "Unit");
+ t!(Tuple(1, 2), "Tuple(1, 2)");
+ t!(Struct { x: 1, y: 2 }, "Struct { x: 1, y: 2 }");
+ t!(Enum::Nullary, "Nullary");
+ t!(Enum::Variant(1, 2), "Variant(1, 2)");
+ t!(Enum::StructVariant { x: 1, y: 2 }, "StructVariant { x: 1, y: 2 }");
+}
diff --git a/vendor/derivative/tests/rustc-deriving-via-extension-hash-enum.rs b/vendor/derivative/tests/rustc-deriving-via-extension-hash-enum.rs
new file mode 100644
index 000000000..c5348587d
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-via-extension-hash-enum.rs
@@ -0,0 +1,36 @@
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Hash)]
+#[allow(dead_code)]
+enum Foo {
+ Bar(isize, char),
+ Baz(char, isize)
+}
+
+#[derive(Derivative)]
+#[derivative(Hash)]
+#[allow(dead_code)]
+enum A {
+ B,
+ C,
+ D,
+ E
+}
+
+#[test]
+fn main(){}
diff --git a/vendor/derivative/tests/rustc-deriving-via-extension-hash-struct.rs b/vendor/derivative/tests/rustc-deriving-via-extension-hash-struct.rs
new file mode 100644
index 000000000..c653154c5
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-via-extension-hash-struct.rs
@@ -0,0 +1,34 @@
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+use std::collections::hash_map::DefaultHasher;
+
+#[derive(Derivative)]
+#[derivative(Hash)]
+struct Foo {
+ x: isize,
+ y: isize,
+ z: isize
+}
+
+#[test]
+fn main() {
+ use std::hash::Hash;
+ let mut hasher = DefaultHasher::new();
+ Foo { x: 0, y: 0, z: 0 }.hash(&mut hasher);
+}
diff --git a/vendor/derivative/tests/rustc-deriving-via-extension-type-params.rs b/vendor/derivative/tests/rustc-deriving-via-extension-type-params.rs
new file mode 100644
index 000000000..9fb62ce1c
--- /dev/null
+++ b/vendor/derivative/tests/rustc-deriving-via-extension-type-params.rs
@@ -0,0 +1,33 @@
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(PartialEq, Hash, Debug)]
+struct Foo<T> {
+ x: isize,
+ y: T,
+ z: isize
+}
+
+#[test]
+fn main() {
+ let a = Foo { x: 1, y: 2.0f64, z: 3 };
+ let b = Foo { x: 1, y: 2.0f64, z: 3 };
+ assert_eq!(a, b);
+ assert!(!(a != b));
+ assert!(a.eq(&b));
+ assert!(!a.ne(&b));
+}
diff --git a/vendor/derivative/tests/rustc-expr-copy.rs b/vendor/derivative/tests/rustc-expr-copy.rs
new file mode 100644
index 000000000..ab3ae912e
--- /dev/null
+++ b/vendor/derivative/tests/rustc-expr-copy.rs
@@ -0,0 +1,35 @@
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+
+fn f(arg: &mut A) {
+ arg.a = 100;
+}
+
+#[derive(Derivative)]
+#[derivative(Copy, Clone)]
+struct A { a: isize }
+
+#[test]
+fn main() {
+ let mut x = A {a: 10};
+ f(&mut x);
+ assert_eq!(x.a, 100);
+ x.a = 20;
+ let mut y = x;
+ f(&mut y);
+ assert_eq!(x.a, 20);
+}
diff --git a/vendor/derivative/tests/rustc-exterior.rs b/vendor/derivative/tests/rustc-exterior.rs
new file mode 100644
index 000000000..ec59daa0e
--- /dev/null
+++ b/vendor/derivative/tests/rustc-exterior.rs
@@ -0,0 +1,41 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+use std::cell::Cell;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Copy, Clone)]
+struct Point {x: isize, y: isize, z: isize}
+
+fn f(p: &Cell<Point>) {
+ assert_eq!(p.get().z, 12);
+ p.set(Point {x: 10, y: 11, z: 13});
+ assert_eq!(p.get().z, 13);
+}
+
+#[test]
+fn main() {
+ let a: Point = Point {x: 10, y: 11, z: 12};
+ let b: &Cell<Point> = &Cell::new(a);
+ assert_eq!(b.get().z, 12);
+ f(b);
+ assert_eq!(a.x, 10);
+ assert_eq!(a.y, 11);
+ assert_eq!(a.z, 12);
+ assert_eq!(b.get().x, 10);
+ assert_eq!(b.get().y, 11);
+ assert_eq!(b.get().z, 13);
+}
diff --git a/vendor/derivative/tests/rustc-issue-12860.rs b/vendor/derivative/tests/rustc-issue-12860.rs
new file mode 100644
index 000000000..b4d878ce2
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-12860.rs
@@ -0,0 +1,69 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(clippy::derive_hash_xor_eq)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+use std::collections::HashSet;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Hash)]
+#[derive(Copy, Clone, PartialEq, Eq)]
+struct XYZ {
+ x: isize,
+ y: isize,
+ z: isize
+}
+
+#[test]
+fn main() {
+ let mut connected = HashSet::new();
+ let mut border = HashSet::new();
+
+ let middle = XYZ{x: 0, y: 0, z: 0};
+ border.insert(middle);
+
+ while !border.is_empty() && connected.len() < 10000 {
+ let choice = *(border.iter().next().unwrap());
+ border.remove(&choice);
+ connected.insert(choice);
+
+ let cxp = XYZ{x: choice.x + 1, y: choice.y, z: choice.z};
+ let cxm = XYZ{x: choice.x - 1, y: choice.y, z: choice.z};
+ let cyp = XYZ{x: choice.x, y: choice.y + 1, z: choice.z};
+ let cym = XYZ{x: choice.x, y: choice.y - 1, z: choice.z};
+ let czp = XYZ{x: choice.x, y: choice.y, z: choice.z + 1};
+ let czm = XYZ{x: choice.x, y: choice.y, z: choice.z - 1};
+
+ if !connected.contains(&cxp) {
+ border.insert(cxp);
+ }
+ if !connected.contains(&cxm){
+ border.insert(cxm);
+ }
+ if !connected.contains(&cyp){
+ border.insert(cyp);
+ }
+ if !connected.contains(&cym) {
+ border.insert(cym);
+ }
+ if !connected.contains(&czp){
+ border.insert(czp);
+ }
+ if !connected.contains(&czm) {
+ border.insert(czm);
+ }
+ }
+}
diff --git a/vendor/derivative/tests/rustc-issue-13434.rs b/vendor/derivative/tests/rustc-issue-13434.rs
new file mode 100644
index 000000000..f2ccab5e8
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-13434.rs
@@ -0,0 +1,38 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct MyStruct;
+
+trait Repro {
+ fn repro(self, s: MyStruct) -> String;
+}
+
+impl<F> Repro for F where F: FnOnce(MyStruct) -> String {
+ fn repro(self, s: MyStruct) -> String {
+ self(s)
+ }
+}
+
+fn do_stuff<R: Repro>(r: R) -> String {
+ r.repro(MyStruct)
+}
+
+#[test]
+fn main() {
+ assert_eq!("MyStruct".to_string(), do_stuff(|s: MyStruct| format!("{:?}", s)));
+}
diff --git a/vendor/derivative/tests/rustc-issue-16530.rs b/vendor/derivative/tests/rustc-issue-16530.rs
new file mode 100644
index 000000000..3cf55c671
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-16530.rs
@@ -0,0 +1,32 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(deprecated)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+use std::hash::{SipHasher, Hasher, Hash};
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Hash)]
+struct Empty;
+
+#[test]
+fn main() {
+ let mut s1 = SipHasher::new_with_keys(0, 0);
+ Empty.hash(&mut s1);
+ let mut s2 = SipHasher::new_with_keys(0, 0);
+ Empty.hash(&mut s2);
+ assert_eq!(s1.finish(), s2.finish());
+}
diff --git a/vendor/derivative/tests/rustc-issue-19037.rs b/vendor/derivative/tests/rustc-issue-19037.rs
new file mode 100644
index 000000000..06f461ab1
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-19037.rs
@@ -0,0 +1,38 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#![allow(dead_code)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+struct Str([u8]);
+
+#[derive(Derivative)]
+#[derivative(Clone)]
+struct CharSplits<'a, Sep> {
+ string: &'a Str,
+ sep: Sep,
+ allow_trailing_empty: bool,
+ only_ascii: bool,
+ finished: bool,
+}
+
+fn clone(s: &Str) -> &Str {
+ Clone::clone(&s)
+}
+
+#[test]
+fn main() {}
diff --git a/vendor/derivative/tests/rustc-issue-19102.rs b/vendor/derivative/tests/rustc-issue-19102.rs
new file mode 100644
index 000000000..8530b843a
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-19102.rs
@@ -0,0 +1,26 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![deny(unused_qualifications)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(PartialEq="feature_allow_slow_enum")]
+pub enum A {
+ B,
+}
+
+#[test]
+fn main() {}
diff --git a/vendor/derivative/tests/rustc-issue-19135.rs b/vendor/derivative/tests/rustc-issue-19135.rs
new file mode 100644
index 000000000..a73625c97
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-19135.rs
@@ -0,0 +1,30 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+use std::marker::PhantomData;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct LifetimeStruct<'a>(PhantomData<&'a ()>);
+
+#[test]
+fn main() {
+ takes_hrtb_closure(|lts| println!("{:?}", lts));
+}
+
+fn takes_hrtb_closure<F: for<'a>FnMut(LifetimeStruct<'a>)>(mut f: F) {
+ f(LifetimeStruct(PhantomData));
+}
diff --git a/vendor/derivative/tests/rustc-issue-19358.rs b/vendor/derivative/tests/rustc-issue-19358.rs
new file mode 100644
index 000000000..6f528adfe
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-19358.rs
@@ -0,0 +1,38 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+trait Trait { fn dummy(&self) { } }
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Foo<T: Trait> {
+ foo: T,
+}
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Bar<T> where T: Trait {
+ bar: T,
+}
+
+impl Trait for isize {}
+
+#[test]
+fn main() {
+ let a = Foo { foo: 12 };
+ let b = Bar { bar: 12 };
+ println!("{:?} {:?}", a, b);
+}
diff --git a/vendor/derivative/tests/rustc-issue-21402.rs b/vendor/derivative/tests/rustc-issue-21402.rs
new file mode 100644
index 000000000..6e951178d
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-21402.rs
@@ -0,0 +1,29 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Hash)]
+#[allow(dead_code)]
+struct Foo {
+ a: Vec<bool>,
+ b: (bool, bool),
+ c: [bool; 2],
+}
+
+#[test]
+fn main() {}
diff --git a/vendor/derivative/tests/rustc-issue-23649-3.rs b/vendor/derivative/tests/rustc-issue-23649-3.rs
new file mode 100644
index 000000000..1437fe1e1
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-23649-3.rs
@@ -0,0 +1,23 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[allow(dead_code)]
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+struct Slice { slice: [u8] }
+
+#[test]
+fn main() {}
diff --git a/vendor/derivative/tests/rustc-issue-24085.rs b/vendor/derivative/tests/rustc-issue-24085.rs
new file mode 100644
index 000000000..d3db02615
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-24085.rs
@@ -0,0 +1,38 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Regression test for #24085. Errors were occurring in region
+// inference due to the requirement that `'a:b'`, which was getting
+// incorrectly translated in connection with the closure below.
+
+#![allow(clippy::redundant_closure)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Copy,Clone)]
+#[allow(dead_code)]
+struct Path<'a:'b, 'b> {
+ x: &'a i32,
+ tail: Option<&'b Path<'a, 'b>>
+}
+
+#[allow(dead_code, unconditional_recursion)]
+fn foo<'a,'b,F>(p: Path<'a, 'b>, mut f: F)
+ where F: for<'c> FnMut(Path<'a, 'c>) {
+ foo(p, |x| f(x))
+}
+
+#[test]
+fn main() { }
diff --git a/vendor/derivative/tests/rustc-issue-25394.rs b/vendor/derivative/tests/rustc-issue-25394.rs
new file mode 100644
index 000000000..7f75ef993
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-25394.rs
@@ -0,0 +1,26 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Row<T>([T]);
+
+fn use_row(_: &Row<u8>) {}
+
+#[test]
+fn main() {
+ let _ = use_row;
+}
diff --git a/vendor/derivative/tests/rustc-issue-28561.rs b/vendor/derivative/tests/rustc-issue-28561.rs
new file mode 100644
index 000000000..4476646fa
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-28561.rs
@@ -0,0 +1,136 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(clippy::zero_prefixed_literal, clippy::type_complexity)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug, Default, Eq, Hash, PartialEq)]
+// TODO: Ord, PartialOrd
+struct Array<T> {
+ f00: [T; 00],
+ f01: [T; 01],
+ f02: [T; 02],
+ f03: [T; 03],
+ f04: [T; 04],
+ f05: [T; 05],
+ f06: [T; 06],
+ f07: [T; 07],
+ f08: [T; 08],
+ f09: [T; 09],
+ f10: [T; 10],
+ f11: [T; 11],
+ f12: [T; 12],
+ f13: [T; 13],
+ f14: [T; 14],
+ f15: [T; 15],
+ f16: [T; 16],
+ f17: [T; 17],
+ f18: [T; 18],
+ f19: [T; 19],
+ f20: [T; 20],
+ f21: [T; 21],
+ f22: [T; 22],
+ f23: [T; 23],
+ f24: [T; 24],
+ f25: [T; 25],
+ f26: [T; 26],
+ f27: [T; 27],
+ f28: [T; 28],
+ f29: [T; 29],
+ f30: [T; 30],
+ f31: [T; 31],
+ f32: [T; 32],
+}
+
+// FIXME(#7622): merge with `Array` once `[T; N]: Clone` where `T: Clone`
+#[derive(Derivative)]
+#[derivative(Clone, Copy)]
+struct CopyArray<T: Copy> {
+ f00: [T; 00],
+ f01: [T; 01],
+ f02: [T; 02],
+ f03: [T; 03],
+ f04: [T; 04],
+ f05: [T; 05],
+ f06: [T; 06],
+ f07: [T; 07],
+ f08: [T; 08],
+ f09: [T; 09],
+ f10: [T; 10],
+ f11: [T; 11],
+ f12: [T; 12],
+ f13: [T; 13],
+ f14: [T; 14],
+ f15: [T; 15],
+ f16: [T; 16],
+ f17: [T; 17],
+ f18: [T; 18],
+ f19: [T; 19],
+ f20: [T; 20],
+ f21: [T; 21],
+ f22: [T; 22],
+ f23: [T; 23],
+ f24: [T; 24],
+ f25: [T; 25],
+ f26: [T; 26],
+ f27: [T; 27],
+ f28: [T; 28],
+ f29: [T; 29],
+ f30: [T; 30],
+ f31: [T; 31],
+ f32: [T; 32],
+}
+
+#[derive(Derivative)]
+#[derivative(Clone, Copy, Debug, Eq, Hash, PartialEq)]
+// TODO: Ord, PartialOrd
+struct Fn<A, B, C, D, E, F, G, H, I, J, K, L> {
+ f00: fn(),
+ f01: fn(A),
+ f02: fn(A, B),
+ f03: fn(A, B, C),
+ f04: fn(A, B, C, D),
+ f05: fn(A, B, C, D, E),
+ f06: fn(A, B, C, D, E, F),
+ f07: fn(A, B, C, D, E, F, G),
+ f08: fn(A, B, C, D, E, F, G, H),
+ f09: fn(A, B, C, D, E, F, G, H, I),
+ f10: fn(A, B, C, D, E, F, G, H, I, J),
+ f11: fn(A, B, C, D, E, F, G, H, I, J, K),
+ f12: fn(A, B, C, D, E, F, G, H, I, J, K, L),
+}
+
+#[derive(Derivative)]
+#[derivative(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
+// TODO: Ord, PartialOrd
+struct Tuple<A, B, C, D, E, F, G, H, I, J, K, L> {
+ f00: (),
+ f01: (A,),
+ f02: (A, B),
+ f03: (A, B, C),
+ f04: (A, B, C, D),
+ f05: (A, B, C, D, E),
+ f06: (A, B, C, D, E, F),
+ f07: (A, B, C, D, E, F, G),
+ f08: (A, B, C, D, E, F, G, H),
+ f09: (A, B, C, D, E, F, G, H, I),
+ f10: (A, B, C, D, E, F, G, H, I, J),
+ f11: (A, B, C, D, E, F, G, H, I, J, K),
+ f12: (A, B, C, D, E, F, G, H, I, J, K, L),
+}
+
+#[test]
+fn main() {}
diff --git a/vendor/derivative/tests/rustc-issue-29030.rs b/vendor/derivative/tests/rustc-issue-29030.rs
new file mode 100644
index 000000000..c893ece7d
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-29030.rs
@@ -0,0 +1,30 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct Message<'a, P: 'a = &'a [u8]> {
+ header: &'a [u8],
+ payload: P,
+}
+
+#[test]
+fn main() {
+ let _ = Message {
+ header: &[1],
+ payload: &[1],
+ };
+}
diff --git a/vendor/derivative/tests/rustc-issue-29540.rs b/vendor/derivative/tests/rustc-issue-29540.rs
new file mode 100644
index 000000000..3b1fcf74d
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-29540.rs
@@ -0,0 +1,509 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+pub struct Config {
+ pub name: String,
+ pub cluster: String,
+ pub debug_none: String,
+ pub debug_lockdep: String,
+ pub debug_context: String,
+ pub debug_crush: String,
+ pub debug_mds: String,
+ pub debug_mds_balancer: String,
+ pub debug_mds_locker: String,
+ pub debug_mds_log: String,
+ pub debug_mds_log_expire: String,
+ pub debug_mds_migrator: String,
+ pub debug_buffer: String,
+ pub debug_timer: String,
+ pub debug_filer: String,
+ pub debug_striper: String,
+ pub debug_objecter: String,
+ pub debug_rados: String,
+ pub debug_rbd: String,
+ pub debug_journaler: String,
+ pub debug_objectcacher: String,
+ pub debug_client: String,
+ pub debug_osd: String,
+ pub debug_optracker: String,
+ pub debug_objclass: String,
+ pub debug_filestore: String,
+ pub debug_keyvaluestore: String,
+ pub debug_journal: String,
+ pub debug_ms: String,
+ pub debug_mon: String,
+ pub debug_monc: String,
+ pub debug_paxos: String,
+ pub debug_tp: String,
+ pub debug_auth: String,
+ pub debug_crypto: String,
+ pub debug_finisher: String,
+ pub debug_heartbeatmap: String,
+ pub debug_perfcounter: String,
+ pub debug_rgw: String,
+ pub debug_civetweb: String,
+ pub debug_javaclient: String,
+ pub debug_asok: String,
+ pub debug_throttle: String,
+ pub host: String,
+ pub fsid: String,
+ pub public_addr: String,
+ pub cluster_addr: String,
+ pub public_network: String,
+ pub cluster_network: String,
+ pub num_client: String,
+ pub monmap: String,
+ pub mon_host: String,
+ pub lockdep: String,
+ pub run_dir: String,
+ pub admin_socket: String,
+ pub daemonize: String,
+ pub pid_file: String,
+ pub chdir: String,
+ pub max_open_files: String,
+ pub restapi_log_level: String,
+ pub restapi_base_url: String,
+ pub fatal_signal_handlers: String,
+ pub log_file: String,
+ pub log_max_new: String,
+ pub log_max_recent: String,
+ pub log_to_stderr: String,
+ pub err_to_stderr: String,
+ pub log_to_syslog: String,
+ pub err_to_syslog: String,
+ pub log_flush_on_exit: String,
+ pub log_stop_at_utilization: String,
+ pub clog_to_monitors: String,
+ pub clog_to_syslog: String,
+ pub clog_to_syslog_level: String,
+ pub clog_to_syslog_facility: String,
+ pub mon_cluster_log_to_syslog: String,
+ pub mon_cluster_log_to_syslog_level: String,
+ pub mon_cluster_log_to_syslog_facility: String,
+ pub mon_cluster_log_file: String,
+ pub mon_cluster_log_file_level: String,
+ pub key: String,
+ pub keyfile: String,
+ pub keyring: String,
+ pub heartbeat_interval: String,
+ pub heartbeat_file: String,
+ pub heartbeat_inject_failure: String,
+ pub perf: String,
+ pub ms_tcp_nodelay: String,
+ pub ms_tcp_rcvbuf: String,
+ pub ms_initial_backoff: String,
+ pub ms_max_backoff: String,
+ pub ms_nocrc: String,
+ pub ms_die_on_bad_msg: String,
+ pub ms_die_on_unhandled_msg: String,
+ pub ms_die_on_old_message: String,
+ pub ms_dispatch_throttle_bytes: String,
+ pub ms_bind_ipv6: String,
+ pub ms_bind_port_min: String,
+ pub ms_bind_port_max: String,
+ pub ms_rwthread_stack_bytes: String,
+ pub ms_tcp_read_timeout: String,
+ pub ms_pq_max_tokens_per_priority: String,
+ pub ms_pq_min_cost: String,
+ pub ms_inject_socket_failures: String,
+ pub ms_inject_delay_type: String,
+ pub ms_inject_delay_msg_type: String,
+ pub ms_inject_delay_max: String,
+ pub ms_inject_delay_probability: String,
+ pub ms_inject_internal_delays: String,
+ pub ms_dump_on_send: String,
+ pub inject_early_sigterm: String,
+ pub mon_data: String,
+ pub mon_initial_members: String,
+ pub mon_sync_fs_threshold: String,
+ pub mon_compact_on_start: String,
+ pub mon_compact_on_bootstrap: String,
+ pub mon_compact_on_trim: String,
+ pub mon_tick_interval: String,
+ pub mon_subscribe_interval: String,
+ pub mon_delta_reset_interval: String,
+ pub mon_osd_laggy_halflife: String,
+ pub mon_osd_laggy_weight: String,
+ pub mon_osd_adjust_heartbeat_grace: String,
+ pub mon_osd_adjust_down_out_interval: String,
+ pub mon_osd_auto_mark_in: String,
+ pub mon_osd_auto_mark_auto_out_in: String,
+ pub mon_osd_auto_mark_new_in: String,
+ pub mon_osd_down_out_interval: String,
+ pub mon_osd_down_out_subtree_limit: String,
+ pub mon_osd_min_up_ratio: String,
+ pub mon_osd_min_in_ratio: String,
+ pub mon_osd_max_op_age: String,
+ pub mon_osd_max_split_count: String,
+ pub mon_osd_allow_primary_temp: String,
+ pub mon_osd_allow_primary_affinity: String,
+ pub mon_stat_smooth_intervals: String,
+ pub mon_lease: String,
+ pub mon_lease_renew_interval: String,
+ pub mon_lease_ack_timeout: String,
+ pub mon_clock_drift_allowed: String,
+ pub mon_clock_drift_warn_backoff: String,
+ pub mon_timecheck_interval: String,
+ pub mon_accept_timeout: String,
+ pub mon_pg_create_interval: String,
+ pub mon_pg_stuck_threshold: String,
+ pub mon_pg_warn_min_per_osd: String,
+ pub mon_pg_warn_max_object_skew: String,
+ pub mon_pg_warn_min_objects: String,
+ pub mon_pg_warn_min_pool_objects: String,
+ pub mon_cache_target_full_warn_ratio: String,
+ pub mon_osd_full_ratio: String,
+ pub mon_osd_nearfull_ratio: String,
+ pub mon_globalid_prealloc: String,
+ pub mon_osd_report_timeout: String,
+ pub mon_force_standby_active: String,
+ pub mon_warn_on_old_mons: String,
+ pub mon_warn_on_legacy_crush_tunables: String,
+ pub mon_warn_on_osd_down_out_interval_zero: String,
+ pub mon_warn_on_cache_pools_without_hit_sets: String,
+ pub mon_min_osdmap_epochs: String,
+ pub mon_max_pgmap_epochs: String,
+ pub mon_max_log_epochs: String,
+ pub mon_max_mdsmap_epochs: String,
+ pub mon_max_osd: String,
+ pub mon_probe_timeout: String,
+ pub mon_slurp_timeout: String,
+ pub mon_slurp_bytes: String,
+ pub mon_client_bytes: String,
+ pub mon_daemon_bytes: String,
+ pub mon_max_log_entries_per_event: String,
+ pub mon_health_data_update_interval: String,
+ pub mon_data_avail_crit: String,
+ pub mon_data_avail_warn: String,
+ pub mon_config_key_max_entry_size: String,
+ pub mon_sync_timeout: String,
+ pub mon_sync_max_payload_size: String,
+ pub mon_sync_debug: String,
+ pub mon_sync_debug_leader: String,
+ pub mon_sync_debug_provider: String,
+ pub mon_sync_debug_provider_fallback: String,
+ pub mon_inject_sync_get_chunk_delay: String,
+ pub mon_osd_min_down_reporters: String,
+ pub mon_osd_min_down_reports: String,
+ pub mon_osd_force_trim_to: String,
+ pub mon_mds_force_trim_to: String,
+ pub mon_advanced_debug_mode: String,
+ pub mon_debug_dump_transactions: String,
+ pub mon_debug_dump_location: String,
+ pub mon_sync_provider_kill_at: String,
+ pub mon_sync_requester_kill_at: String,
+ pub mon_leveldb_write_buffer_size: String,
+ pub mon_leveldb_cache_size: String,
+ pub mon_leveldb_block_size: String,
+ pub mon_leveldb_bloom_size: String,
+ pub mon_leveldb_max_open_files: String,
+ pub mon_leveldb_compression: String,
+ pub mon_leveldb_paranoid: String,
+ pub mon_leveldb_log: String,
+ pub mon_leveldb_size_warn: String,
+ pub mon_force_quorum_join: String,
+ pub paxos_stash_full_interval: String,
+ pub paxos_max_join_drift: String,
+ pub paxos_propose_interval: String,
+ pub paxos_min_wait: String,
+ pub paxos_min: String,
+ pub paxos_trim_min: String,
+ pub paxos_trim_max: String,
+ pub paxos_service_trim_min: String,
+ pub paxos_service_trim_max: String,
+ pub paxos_kill_at: String,
+ pub clock_offset: String,
+ pub auth_cluster_required: String,
+ pub auth_service_required: String,
+ pub auth_client_required: String,
+ pub auth_supported: String,
+ pub cephx_require_signatures: String,
+ pub cephx_cluster_require_signatures: String,
+ pub cephx_service_require_signatures: String,
+ pub cephx_sign_messages: String,
+ pub auth_mon_ticket_ttl: String,
+ pub auth_service_ticket_ttl: String,
+ pub auth_debug: String,
+ pub mon_client_hunt_interval: String,
+ pub mon_client_ping_interval: String,
+ pub mon_client_ping_timeout: String,
+ pub mon_client_hunt_interval_backoff: String,
+ pub mon_client_hunt_interval_max_multiple: String,
+ pub mon_client_max_log_entries_per_message: String,
+ pub mon_max_pool_pg_num: String,
+ pub mon_pool_quota_warn_threshold: String,
+ pub mon_pool_quota_crit_threshold: String,
+ pub client_cache_size: String,
+ pub client_cache_mid: String,
+ pub client_use_random_mds: String,
+ pub client_mount_timeout: String,
+ pub client_tick_interval: String,
+ pub client_trace: String,
+ pub client_readahead_min: String,
+ pub client_readahead_max_bytes: String,
+ pub client_readahead_max_periods: String,
+ pub client_snapdir: String,
+ pub client_mountpoint: String,
+ pub client_notify_timeout: String,
+ pub osd_client_watch_timeout: String,
+ pub client_caps_release_delay: String,
+ pub client_oc: String,
+ pub client_oc_size: String,
+ pub client_oc_max_dirty: String,
+ pub client_oc_target_dirty: String,
+ pub client_oc_max_dirty_age: String,
+ pub client_oc_max_objects: String,
+ pub client_debug_force_sync_read: String,
+ pub client_debug_inject_tick_delay: String,
+ pub client_max_inline_size: String,
+ pub fuse_use_invalidate_cb: String,
+ pub fuse_allow_other: String,
+ pub fuse_default_permissions: String,
+ pub fuse_big_writes: String,
+ pub fuse_atomic_o_trunc: String,
+ pub fuse_debug: String,
+ pub fuse_multithreaded: String,
+ pub crush_location: String,
+ pub objecter_tick_interval: String,
+ pub objecter_timeout: String,
+ pub objecter_inflight_op_bytes: String,
+ pub objecter_inflight_ops: String,
+ pub journaler_allow_split_entries: String,
+ pub journaler_write_head_interval: String,
+ pub journaler_prefetch_periods: String,
+ pub journaler_prezero_periods: String,
+ pub journaler_batch_interval: String,
+ pub journaler_batch_max: String,
+ pub mds_data: String,
+ pub mds_max_file_size: String,
+ pub mds_cache_size: String,
+ pub mds_cache_mid: String,
+ pub mds_mem_max: String,
+ pub mds_dir_max_commit_size: String,
+ pub mds_decay_halflife: String,
+ pub mds_beacon_interval: String,
+ pub mds_beacon_grace: String,
+ pub mds_enforce_unique_name: String,
+ pub mds_blacklist_interval: String,
+ pub mds_session_timeout: String,
+ pub mds_freeze_tree_timeout: String,
+ pub mds_session_autoclose: String,
+ pub mds_reconnect_timeout: String,
+ pub mds_tick_interval: String,
+ pub mds_dirstat_min_interval: String,
+ pub mds_scatter_nudge_interval: String,
+ pub mds_client_prealloc_inos: String,
+ pub mds_early_reply: String,
+ pub mds_default_dir_hash: String,
+ pub mds_log: String,
+ pub mds_log_skip_corrupt_events: String,
+ pub mds_log_max_events: String,
+ pub mds_log_segment_size: String,
+ pub mds_log_max_segments: String,
+ pub mds_log_max_expiring: String,
+ pub mds_bal_sample_interval: String,
+ pub mds_bal_replicate_threshold: String,
+ pub mds_bal_unreplicate_threshold: String,
+ pub mds_bal_frag: String,
+ pub mds_bal_split_size: String,
+ pub mds_bal_split_rd: String,
+ pub mds_bal_split_wr: String,
+ pub mds_bal_split_bits: String,
+ pub mds_bal_merge_size: String,
+ pub mds_bal_merge_rd: String,
+ pub mds_bal_merge_wr: String,
+ pub mds_bal_interval: String,
+ pub mds_bal_fragment_interval: String,
+ pub mds_bal_idle_threshold: String,
+ pub mds_bal_max: String,
+ pub mds_bal_max_until: String,
+ pub mds_bal_mode: String,
+ pub mds_bal_min_rebalance: String,
+ pub mds_bal_min_start: String,
+ pub mds_bal_need_min: String,
+ pub mds_bal_need_max: String,
+ pub mds_bal_midchunk: String,
+ pub mds_bal_minchunk: String,
+ pub mds_bal_target_removal_min: String,
+ pub mds_bal_target_removal_max: String,
+ pub mds_replay_interval: String,
+ pub mds_shutdown_check: String,
+ pub mds_thrash_exports: String,
+ pub mds_thrash_fragments: String,
+ pub mds_dump_cache_on_map: String,
+ pub mds_dump_cache_after_rejoin: String,
+ pub mds_verify_scatter: String,
+ pub mds_debug_scatterstat: String,
+ pub mds_debug_frag: String,
+ pub mds_debug_auth_pins: String,
+ pub mds_debug_subtrees: String,
+ pub mds_kill_mdstable_at: String,
+ pub mds_kill_export_at: String,
+ pub mds_kill_import_at: String,
+ pub mds_kill_link_at: String,
+ pub mds_kill_rename_at: String,
+ pub mds_kill_openc_at: String,
+ pub mds_kill_journal_at: String,
+ pub mds_kill_journal_expire_at: String,
+ pub mds_kill_journal_replay_at: String,
+ pub mds_kill_create_at: String,
+ pub mds_open_remote_link_mode: String,
+ pub mds_inject_traceless_reply_probability: String,
+ pub mds_wipe_sessions: String,
+ pub mds_wipe_ino_prealloc: String,
+ pub mds_skip_ino: String,
+ pub max_mds: String,
+ pub mds_standby_for_name: String,
+ pub mds_standby_for_rank: String,
+ pub mds_standby_replay: String,
+ pub osd_compact_leveldb_on_mount: String,
+ pub osd_max_backfills: String,
+ pub osd_backfill_full_ratio: String,
+ pub osd_backfill_retry_interval: String,
+ pub osd_agent_max_ops: String,
+ pub osd_agent_min_evict_effort: String,
+ pub osd_agent_quantize_effort: String,
+ pub osd_agent_delay_time: String,
+ pub osd_agent_hist_halflife: String,
+ pub osd_agent_slop: String,
+ pub osd_uuid: String,
+ pub osd_data: String,
+ pub osd_journal: String,
+ pub osd_journal_size: String,
+ pub osd_max_write_size: String,
+ pub osd_max_pgls: String,
+ pub osd_client_message_size_cap: String,
+ pub osd_client_message_cap: String,
+ pub osd_pg_bits: String,
+ pub osd_pgp_bits: String,
+ pub osd_crush_chooseleaf_type: String,
+ pub osd_pool_default_crush_rule: String,
+ pub osd_pool_default_crush_replicated_ruleset: String,
+ pub osd_pool_erasure_code_stripe_width: String,
+ pub osd_pool_default_size: String,
+ pub osd_pool_default_min_size: String,
+ pub osd_pool_default_pg_num: String,
+ pub osd_pool_default_pgp_num: String,
+ pub osd_pool_default_erasure_code_directory: String,
+ pub osd_pool_default_erasure_code_profile: String,
+ pub osd_erasure_code_plugins: String,
+ pub osd_pool_default_flags: String,
+ pub osd_pool_default_flag_hashpspool: String,
+ pub osd_pool_default_hit_set_bloom_fpp: String,
+ pub osd_pool_default_cache_target_dirty_ratio: String,
+ pub osd_pool_default_cache_target_full_ratio: String,
+ pub osd_pool_default_cache_min_flush_age: String,
+ pub osd_pool_default_cache_min_evict_age: String,
+ pub osd_hit_set_min_size: String,
+ pub osd_hit_set_max_size: String,
+ pub osd_hit_set_namespace: String,
+ pub osd_tier_default_cache_mode: String,
+ pub osd_tier_default_cache_hit_set_count: String,
+ pub osd_tier_default_cache_hit_set_period: String,
+ pub osd_tier_default_cache_hit_set_type: String,
+ pub osd_map_dedup: String,
+ pub osd_map_max_advance: String,
+ pub osd_map_cache_size: String,
+ pub osd_map_message_max: String,
+ pub osd_map_share_max_epochs: String,
+ pub osd_op_threads: String,
+ pub osd_peering_wq_batch_size: String,
+ pub osd_op_pq_max_tokens_per_priority: String,
+ pub osd_op_pq_min_cost: String,
+ pub osd_disk_threads: String,
+ pub osd_disk_thread_ioprio_class: String,
+ pub osd_disk_thread_ioprio_priority: String,
+ pub osd_recovery_threads: String,
+ pub osd_recover_clone_overlap: String,
+ pub osd_recover_clone_overlap_limit: String,
+ pub osd_backfill_scan_min: String,
+ pub osd_backfill_scan_max: String,
+ pub osd_op_thread_timeout: String,
+ pub osd_recovery_thread_timeout: String,
+ pub osd_snap_trim_thread_timeout: String,
+ pub osd_snap_trim_sleep: String,
+ pub osd_scrub_thread_timeout: String,
+ pub osd_scrub_finalize_thread_timeout: String,
+ pub osd_scrub_invalid_stats: String,
+ pub osd_remove_thread_timeout: String,
+ pub osd_command_thread_timeout: String,
+ pub osd_age: String,
+ pub osd_age_time: String,
+ pub osd_heartbeat_addr: String,
+ pub osd_heartbeat_interval: String,
+ pub osd_heartbeat_grace: String,
+ pub osd_heartbeat_min_peers: String,
+ pub osd_pg_max_concurrent_snap_trims: String,
+ pub osd_heartbeat_min_healthy_ratio: String,
+ pub osd_mon_heartbeat_interval: String,
+ pub osd_mon_report_interval_max: String,
+ pub osd_mon_report_interval_min: String,
+ pub osd_pg_stat_report_interval_max: String,
+ pub osd_mon_ack_timeout: String,
+ pub osd_default_data_pool_replay_window: String,
+ pub osd_preserve_trimmed_log: String,
+ pub osd_auto_mark_unfound_lost: String,
+ pub osd_recovery_delay_start: String,
+ pub osd_recovery_max_active: String,
+ pub osd_recovery_max_single_start: String,
+ pub osd_recovery_max_chunk: String,
+ pub osd_copyfrom_max_chunk: String,
+ pub osd_push_per_object_cost: String,
+ pub osd_max_push_cost: String,
+ pub osd_max_push_objects: String,
+ pub osd_recovery_forget_lost_objects: String,
+ pub osd_max_scrubs: String,
+ pub osd_scrub_load_threshold: String,
+ pub osd_scrub_min_interval: String,
+ pub osd_scrub_max_interval: String,
+ pub osd_scrub_chunk_min: String,
+ pub osd_scrub_chunk_max: String,
+ pub osd_scrub_sleep: String,
+ pub osd_deep_scrub_interval: String,
+ pub osd_deep_scrub_stride: String,
+ pub osd_scan_list_ping_tp_interval: String,
+ pub osd_auto_weight: String,
+ pub osd_class_dir: String,
+ pub osd_open_classes_on_start: String,
+ pub osd_check_for_log_corruption: String,
+ pub osd_use_stale_snap: String,
+ pub osd_rollback_to_cluster_snap: String,
+ pub osd_default_notify_timeout: String,
+ pub osd_kill_backfill_at: String,
+ pub osd_pg_epoch_persisted_max_stale: String,
+ pub osd_min_pg_log_entries: String,
+ pub osd_max_pg_log_entries: String,
+ pub osd_op_complaint_time: String,
+ pub osd_command_max_records: String,
+ pub osd_op_log_threshold: String,
+ pub osd_verify_sparse_read_holes: String,
+ pub osd_debug_drop_ping_probability: String,
+ pub osd_debug_drop_ping_duration: String,
+ pub osd_debug_drop_pg_create_probability: String,
+ pub osd_debug_drop_pg_create_duration: String,
+ pub osd_debug_drop_op_probability: String,
+ pub osd_debug_op_order: String,
+ pub osd_debug_verify_snaps_on_info: String,
+ pub osd_debug_verify_stray_on_activate: String,
+ pub osd_debug_skip_full_check_in_backfill_reservation: String,
+ pub osd_debug_reject_backfill_probability: String,
+ pub osd_enable_op_tracker: String,
+}
+
+#[test]
+fn main() {}
diff --git a/vendor/derivative/tests/rustc-issue-29710.rs b/vendor/derivative/tests/rustc-issue-29710.rs
new file mode 100644
index 000000000..d2198ed7a
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-29710.rs
@@ -0,0 +1,29 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![deny(unused_results)]
+#![allow(dead_code)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct A(usize);
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct B { a: usize }
+
+#[test]
+fn main() {}
diff --git a/vendor/derivative/tests/rustc-issue-32292.rs b/vendor/derivative/tests/rustc-issue-32292.rs
new file mode 100644
index 000000000..6d4be3838
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-32292.rs
@@ -0,0 +1,27 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![deny(warnings)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Hash, Eq, PartialEq, Debug, Clone, Copy)]
+// TODO: Ord, PartialOrd
+struct Foo;
+
+#[test]
+fn main() {
+ let _ = Foo;
+}
diff --git a/vendor/derivative/tests/rustc-issue-3935.rs b/vendor/derivative/tests/rustc-issue-3935.rs
new file mode 100644
index 000000000..a63e6a771
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-3935.rs
@@ -0,0 +1,29 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+struct Bike {
+ name: String,
+}
+
+#[test]
+fn main() {
+ let town_bike = Bike { name: "schwinn".to_string() };
+ let my_bike = Bike { name: "surly".to_string() };
+
+ assert!(town_bike != my_bike);
+}
diff --git a/vendor/derivative/tests/rustc-issue-42453.rs b/vendor/derivative/tests/rustc-issue-42453.rs
new file mode 100644
index 000000000..bd349de77
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-42453.rs
@@ -0,0 +1,28 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![deny(warnings)]
+
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(Debug)]
+struct builder;
+
+fn main() {
+
+}
diff --git a/vendor/derivative/tests/rustc-issue-58319.rs b/vendor/derivative/tests/rustc-issue-58319.rs
new file mode 100644
index 000000000..4bb0077da
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-58319.rs
@@ -0,0 +1,644 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![deny(warnings)]
+
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+fn main() {}
+
+#[derive(Derivative)]
+#[derivative(Clone)]
+pub struct Little;
+
+#[derive(Clone)]
+pub struct Big(
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+ Little,
+);
diff --git a/vendor/derivative/tests/rustc-issue-6341.rs b/vendor/derivative/tests/rustc-issue-6341.rs
new file mode 100644
index 000000000..674f1918c
--- /dev/null
+++ b/vendor/derivative/tests/rustc-issue-6341.rs
@@ -0,0 +1,30 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// pretty-expanded FIXME #23616
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+#[derive(Derivative)]
+#[derivative(PartialEq)]
+struct A { x: usize }
+
+impl Drop for A {
+ fn drop(&mut self) {}
+}
+
+#[test]
+fn main() {
+ A { x: 42 };
+}
diff --git a/vendor/derivative/tests/rustc-typeclasses-eq-example.rs b/vendor/derivative/tests/rustc-typeclasses-eq-example.rs
new file mode 100644
index 000000000..4755df5b9
--- /dev/null
+++ b/vendor/derivative/tests/rustc-typeclasses-eq-example.rs
@@ -0,0 +1,83 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![allow(non_snake_case)]
+#![allow(non_camel_case_types)]
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+// Example from lkuper's intern talk, August 2012.
+use Color::{cyan, magenta, yellow, black};
+use ColorTree::{leaf, branch};
+
+trait Equal {
+ fn isEq(&self, a: &Self) -> bool;
+}
+
+#[derive(Derivative)]
+#[derivative(Clone, Copy)]
+enum Color { cyan, magenta, yellow, black }
+
+impl Equal for Color {
+ fn isEq(&self, a: &Color) -> bool {
+ match (*self, *a) {
+ (cyan, cyan) => { true }
+ (magenta, magenta) => { true }
+ (yellow, yellow) => { true }
+ (black, black) => { true }
+ _ => { false }
+ }
+ }
+}
+
+#[derive(Derivative)]
+#[derivative(Clone)]
+enum ColorTree {
+ leaf(Color),
+ branch(Box<ColorTree>, Box<ColorTree>)
+}
+
+impl Equal for ColorTree {
+ fn isEq(&self, a: &ColorTree) -> bool {
+ match (self, a) {
+ (&leaf(ref x), &leaf(ref y)) => { x.isEq(&(*y)) }
+ (&branch(ref l1, ref r1), &branch(ref l2, ref r2)) => {
+ (*l1).isEq(&(**l2).clone()) && (*r1).isEq(&(**r2).clone())
+ }
+ _ => { false }
+ }
+ }
+}
+
+#[test]
+fn main() {
+ assert!(cyan.isEq(&cyan));
+ assert!(magenta.isEq(&magenta));
+ assert!(!cyan.isEq(&yellow));
+ assert!(!magenta.isEq(&cyan));
+
+ assert!(leaf(cyan).isEq(&leaf(cyan)));
+ assert!(!leaf(cyan).isEq(&leaf(yellow)));
+
+ assert!(branch(Box::new(leaf(magenta)), Box::new(leaf(cyan)))
+ .isEq(&branch(Box::new(leaf(magenta)), Box::new(leaf(cyan)))));
+
+ assert!(branch(Box::new(leaf(black)), Box::new(leaf(cyan)))
+ .isEq(&branch(Box::new(leaf(black)), Box::new(leaf(cyan)))));
+
+ assert!(!branch(Box::new(leaf(magenta)), Box::new(leaf(cyan)))
+ .isEq(&branch(Box::new(leaf(magenta)), Box::new(leaf(magenta)))));
+
+ println!("Assertions all succeeded!");
+}
diff --git a/vendor/derivative/tests/rustc-zero-sized-btreemap-insert.rs b/vendor/derivative/tests/rustc-zero-sized-btreemap-insert.rs
new file mode 100644
index 000000000..b6329f5d4
--- /dev/null
+++ b/vendor/derivative/tests/rustc-zero-sized-btreemap-insert.rs
@@ -0,0 +1,41 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "use_core")]
+extern crate core;
+
+#[macro_use]
+extern crate derivative;
+
+use std::collections::BTreeMap;
+use std::iter::Iterator;
+
+#[derive(Derivative)]
+#[derive(Ord, PartialOrd)]
+#[derivative(Eq, Hash, Debug, PartialEq)]
+// TODO: Ord, PartialOrd
+struct Zst;
+
+#[test]
+fn main() {
+ const N: usize = 8;
+
+ for len in 0..N {
+ let mut tester = BTreeMap::new();
+ assert_eq!(tester.len(), 0);
+ for _ in 0..len {
+ tester.insert(Zst, ());
+ }
+ assert_eq!(tester.len(), if len == 0 { 0 } else { 1 });
+ assert_eq!(tester.iter().count(), if len == 0 { 0 } else { 1 });
+ assert_eq!(tester.get(&Zst).is_some(), len > 0);
+ tester.clear();
+ }
+}