rust/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.rs
2023-01-11 09:32:08 +00:00

14 lines
340 B
Rust

// Check that reborrows are still illegal with Copy mutable references
#![feature(trivial_bounds)]
#![allow(unused)]
fn reborrow_mut<'a>(t: &'a &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
*t //~ ERROR
}
fn copy_reborrow_mut<'a>(t: &'a &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
{*t} //~ ERROR
}
fn main() {}