1 // Check that we do not allow coercions to object
2 // unsafe trait objects in match arms
4 #![feature(object_safe_for_dispatch)]
16 fn opt() -> Option<()> {
23 None => &R, //~ ERROR E0308
25 let t: &dyn Trait = match opt() { //~ ERROR E0038
26 Some(()) => &S, //~ ERROR E0038