]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-42796.rs
Rollup merge of #106752 - sulami:master, r=estebank
[rust.git] / tests / ui / issues / issue-42796.rs
1 pub trait Mirror<Smoke> {
2     type Image;
3 }
4
5 impl<T, Smoke> Mirror<Smoke> for T {
6     type Image = T;
7 }
8
9 pub fn poison<S>(victim: String) where <String as Mirror<S>>::Image: Copy {
10     loop { drop(victim); }
11 }
12
13 fn main() {
14     let s = "Hello!".to_owned();
15     let mut s_copy = s;
16     s_copy.push_str("World!");
17     "0wned!".to_owned();
18     println!("{}", s); //~ ERROR borrow of moved value
19 }