rust/tests/ui/issues/issue-28279.rs
2024-02-16 20:02:50 +00:00

21 lines
348 B
Rust

//@ check-pass
#![allow(dead_code)]
use std::rc::Rc;
fn test1() -> Rc<dyn for<'a> Fn(&'a usize) + 'static> {
if let Some(_) = Some(1) {
loop{}
} else {
loop{}
}
}
fn test2() -> *mut (dyn for<'a> Fn(&'a usize) + 'static) {
if let Some(_) = Some(1) {
loop{}
} else {
loop{}
}
}
fn main() {}