mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +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() {}
|