]> git.lizzy.rs Git - rust.git/blob - tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.rs
Rollup merge of #106397 - compiler-errors:new-solver-impl-wc, r=lcnr
[rust.git] / tests / ui / trivial-bounds / trivial-bounds-inconsistent-copy-reborrow.rs
1 // Check that reborrows are still illegal with Copy mutable references
2 #![feature(trivial_bounds)]
3 #![allow(unused)]
4
5 fn reborrow_mut<'a>(t: &'a &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
6     *t //~ ERROR
7 }
8
9 fn copy_reborrow_mut<'a>(t: &'a &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
10     {*t} //~ ERROR
11 }
12
13 fn main() {}