Sign in
fuchsia
/
third_party
/
rust
/
7de9402b77ded0d8ec9e1c554521b2121449ef2b
/
.
/
src
/
test
/
ui
/
unsafe
/
unsafe-subtyping.rs
blob: a4b748a50f2f0f34ddb4ca89c697213338980b1e [
file
] [
log
] [
blame
]
// Check that safe fns are not a subtype of unsafe fns.
fn
foo
(
x
:
Option
<
fn
(
i32
)>)
->
Option
<
unsafe
fn
(
i32
)>
{
x
//~ ERROR mismatched types
}
fn
bar
(
x
:
fn
(
i32
))
->
unsafe
fn
(
i32
)
{
x
// OK, coercion!
}
fn
main
()
{
}