rust/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
340 B
Rust
Raw Normal View History

2018-05-06 21:54:00 +00:00
// 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() {}