about summary refs log tree commit diff
path: root/tests/ui/unsafe/unsafe-subtyping.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/unsafe/unsafe-subtyping.stderr')
-rw-r--r--tests/ui/unsafe/unsafe-subtyping.stderr14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/unsafe/unsafe-subtyping.stderr b/tests/ui/unsafe/unsafe-subtyping.stderr
new file mode 100644
index 00000000000..2db7cc31280
--- /dev/null
+++ b/tests/ui/unsafe/unsafe-subtyping.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+  --> $DIR/unsafe-subtyping.rs:4:5
+   |
+LL | fn foo(x: Option<fn(i32)>) -> Option<unsafe fn(i32)> {
+   |                               ---------------------- expected `Option<unsafe fn(i32)>` because of return type
+LL |     x
+   |     ^ expected unsafe fn, found normal fn
+   |
+   = note: expected enum `Option<unsafe fn(_)>`
+              found enum `Option<fn(_)>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.