]> git.lizzy.rs Git - rust.git/blobdiff - tests/source/type.rs
fix internal error for long closure types (#3653)
[rust.git] / tests / source / type.rs
index b622d4363f53de91124fb8907a082d6d4953d574..27387c5bdcace31c89ef15b40c7ee40c36cc0640 100644 (file)
@@ -83,6 +83,10 @@ impl Future<Item = (), Error = SomeError> + 'a,
     'c {
 }
 
+// #3051
+token![impl];
+token![ impl ];
+
 // #3060
 macro_rules! foo {
     ($foo_api: ty) => {
@@ -92,6 +96,14 @@ macro_rules! foo {
 
 type Target = ( FooAPI ) + 'static;
 
+// #3137
+fn foo<T>(t: T)
+where
+    T: ( FnOnce() -> () ) + Clone,
+    U: ( FnOnce() -> () ) + 'static,
+{
+}
+
 // #3117
 fn issue3117() {
     {
@@ -113,3 +125,17 @@ fn issue3117() {
         }
     }
 }
+
+// #3139
+fn issue3139() {
+    assert_eq!(
+        to_json_value(&None ::  <i32>).unwrap(),
+        json!(  { "test": None  ::  <i32> }  )
+    );
+}
+
+// #3180
+fn foo(a: SomeLongComplexType, b: SomeOtherLongComplexType) -> Box<Future<Item = AnotherLongType, Error = ALongErrorType>> {
+}
+
+type MyFn = fn(a: SomeLongComplexType, b: SomeOtherLongComplexType,) -> Box<Future<Item = AnotherLongType, Error = ALongErrorType>>;