mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-15 19:08:20 +00:00
14 lines
340 B
Rust
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() {}
|