rust/tests/ui/trivial-bounds/trivial-bounds-leak-copy.rs

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

13 lines
220 B
Rust
Raw Normal View History

2018-05-06 16:54:00 -05:00
// Check that false Copy bounds don't leak
#![feature(trivial_bounds)]
fn copy_out_string(t: &String) -> String where String: Copy {
*t
}
fn move_out_string(t: &String) -> String {
*t //~ ERROR
}
fn main() {}