about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/explain.stdout18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/test/ui/explain.stdout b/src/test/ui/explain.stdout
index c50c46ee564..62f1a7f98ea 100644
--- a/src/test/ui/explain.stdout
+++ b/src/test/ui/explain.stdout
@@ -1,12 +1,18 @@
 Per [RFC 401][rfc401], if you have a function declaration `foo`:
 
 ```
+struct S;
+
 // For the purposes of this explanation, all of these
 // different kinds of `fn` declarations are equivalent:
-struct S;
+
 fn foo(x: S) { /* ... */ }
-extern "C" { fn foo(x: S); }
-impl S { fn foo(self) { /* ... */ } }
+extern "C" {
+    fn foo(x: S);
+}
+impl S {
+    fn foo(self) { /* ... */ }
+}
 ```
 
 the type of `foo` is **not** `fn(S)`, as one might expect.
@@ -34,8 +40,10 @@ extern "C" fn foo(userdata: Box<i32>) {
     /* ... */
 }
 
-let f: extern "C" fn(*mut i32) = transmute(foo);
-callback(f);
+unsafe {
+    let f: extern "C" fn(*mut i32) = transmute(foo);
+    callback(f);
+}
 ```
 
 Here, transmute is being used to convert the types of the fn arguments.