summaryrefslogtreecommitdiffstats
path: root/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.rs
blob: b1ff23fd09700fef2669e9d1e20a925b120a27d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// 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() {}