]> git.lizzy.rs Git - rust.git/blobdiff - tests/target/impls.rs
Fix up tests for empty impls
[rust.git] / tests / target / impls.rs
index c592ab6f9f92aeca62ab687ba2101c951a0154c5..390f1a12cd3090eccebfcf4421dd4d46561966fd 100644 (file)
@@ -1,3 +1,4 @@
+// rustfmt-normalize_comments: true
 impl Foo for Bar {
     fn foo() {
         "hi"
@@ -21,7 +22,8 @@ fn foo() {
 }
 
 pub unsafe impl<'a, 'b, X, Y: Foo<Bar>> !Foo<'a, X> for Bar<'b, Y>
-    where X: Foo<'a, Z>
+where
+    X: Foo<'a, Z>,
 {
     fn foo() {
         "hi"
@@ -29,7 +31,8 @@ fn foo() {
 }
 
 impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
-    where X: Fooooooooooooooooooooooooooooo<'a, Z>
+where
+    X: Fooooooooooooooooooooooooooooo<'a, Z>,
 {
     fn foo() {
         "hi"
@@ -37,7 +40,8 @@ fn foo() {
 }
 
 impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
-    where X: Foooooooooooooooooooooooooooo<'a, Z>
+where
+    X: Foooooooooooooooooooooooooooo<'a, Z>,
 {
     fn foo() {
         "hi"
@@ -47,7 +51,8 @@ fn foo() {
 impl<T> Foo for Bar<T> where T: Baz {}
 
 impl<T> Foo for Bar<T>
-    where T: Baz
+where
+    T: Baz,
 {
     // Comment
 }
@@ -69,7 +74,6 @@ fn foo() {}
     }
 }
 
-
 mod b {
     mod a {
         impl Foo {
@@ -100,7 +104,8 @@ fn turbo_bad(self: X<'a, 'b>, (x, y): CoorT) {}
 }
 
 pub impl<T> Foo for Bar<T>
-    where T: Foo
+where
+    T: Foo,
 {
     fn foo() {
         "hi"
@@ -108,7 +113,120 @@ fn foo() {
 }
 
 pub impl<T, Z> Foo for Bar<T, Z>
-    where T: Foo,
-          Z: Baz
+where
+    T: Foo,
+    Z: Baz,
 {
 }
+
+mod m {
+    impl<T> PartialEq for S<T>
+    where
+        T: PartialEq,
+    {
+        fn eq(&self, other: &Self) {
+            true
+        }
+    }
+
+    impl<T> PartialEq for S<T> where T: PartialEq {}
+}
+
+impl<BorrowType, K, V, NodeType, HandleType>
+    Handle<NodeRef<BorrowType, K, V, NodeType>, HandleType>
+{}
+
+impl<BorrowType, K, V, NodeType, HandleType> PartialEq
+    for Handle<NodeRef<BorrowType, K, V, NodeType>, HandleType>
+{}
+
+mod x {
+    impl<A, B, C, D> Foo
+    where
+        A: 'static,
+        B: 'static,
+        C: 'static,
+        D: 'static,
+    {}
+}
+
+impl<ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNodeFoo>
+    Issue1249<ConcreteThreadSafeLayoutNode>
+{
+    // Creates a new flow constructor.
+    fn foo() {}
+}
+
+// #1600
+impl<#[may_dangle] K, #[may_dangle] V> Drop for RawTable<K, V> {
+    fn drop() {}
+}
+
+// #1168
+pub trait Number:
+    Copy
+    + Eq
+    + Not<Output = Self>
+    + Shl<u8, Output = Self>
+    + Shr<u8, Output = Self>
+    + BitAnd<Self, Output = Self>
+    + BitOr<Self, Output = Self>
+    + BitAndAssign
+    + BitOrAssign
+{
+    // test
+    fn zero() -> Self;
+}
+
+// #1642
+pub trait SomeTrait:
+    Clone
+    + Eq
+    + PartialEq
+    + Ord
+    + PartialOrd
+    + Default
+    + Hash
+    + Debug
+    + Display
+    + Write
+    + Read
+    + FromStr
+{
+    // comment
+}
+
+// #1995
+impl Foo {
+    fn f(
+        S {
+            aaaaaaaaaa: aaaaaaaaaa,
+            bbbbbbbbbb: bbbbbbbbbb,
+            cccccccccc: cccccccccc,
+        }: S,
+    ) -> u32 {
+        1
+    }
+}
+
+// #2491
+impl<'a, 'b, 'c> SomeThing<Something>
+    for (
+        &'a mut SomethingLong,
+        &'b mut SomethingLong,
+        &'c mut SomethingLong,
+    )
+{
+    fn foo() {}
+}
+
+// #2746
+impl<'seq1, 'seq2, 'body, 'scope, Channel>
+    Adc12<
+        Dual,
+        MasterRunningDma<'seq1, 'body, 'scope, Channel>,
+        SlaveRunningDma<'seq2, 'body, 'scope>,
+    >
+where
+    Channel: DmaChannel,
+{}