rust/tests/ui/cast/ptr-to-trait-obj-ok.rs
2024-07-04 17:56:09 +02:00

18 lines
340 B
Rust

//@ check-pass
trait Trait<'a> {}
fn remove_auto<'a>(x: *mut (dyn Trait<'a> + Send)) -> *mut dyn Trait<'a> {
x as _
}
fn cast_inherent_lt<'a, 'b>(x: *mut (dyn Trait<'static> + 'a)) -> *mut (dyn Trait<'static> + 'b) {
x as _
}
fn unprincipled<'a, 'b>(x: *mut (dyn Send + 'a)) -> *mut (dyn Sync + 'b) {
x as _
}
fn main() {}