]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/regions-fn-subtyping-return-static-fail.rs
New upstream version 1.46.0~beta.2+dfsg1
[rustc.git] / src / test / ui / regions-fn-subtyping-return-static-fail.rs
index 2dd0c9796e2584eaa12fb5a23b90a0e05d859d4e..539221b5a046c20c694430ab05cb46f77305282c 100644 (file)
@@ -13,11 +13,11 @@ struct S;
 
 // Given 'cx, return 'cx
 type F = for<'cx> fn(&'cx S) -> &'cx S;
-fn want_F(f: F) { }
+fn want_F(f: F) {}
 
 // Given anything, return 'static
 type G = for<'cx> fn(&'cx S) -> &'static S;
-fn want_G(f: G) { }
+fn want_G(f: G) {}
 
 // Should meet both.
 fn foo(x: &S) -> &'static S {
@@ -25,7 +25,7 @@ fn foo(x: &S) -> &'static S {
 }
 
 // Should meet both.
-fn bar<'a,'b>(x: &'a S) -> &'b S {
+fn bar<'a, 'b>(x: &'a S) -> &'b S {
     panic!()
 }
 
@@ -37,7 +37,7 @@ fn baz(x: &S) -> &S {
 fn supply_F() {
     want_F(foo);
 
-    want_F(bar); //~ ERROR mismatched types
+    want_F(bar);
 
     want_F(baz);
 }
@@ -48,5 +48,4 @@ fn supply_G() {
     want_G(baz); //~ ERROR mismatched types
 }
 
-pub fn main() {
-}
+pub fn main() {}