rust/tests/ui/cast/ptr-to-trait-obj-ok.rs

18 lines
340 B
Rust
Raw Normal View History

2024-06-04 08:21:09 -05:00
//@ 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() {}