diff options
| author | Jared Roesch <roeschinc@gmail.com> | 2016-08-16 18:41:27 -0700 |
|---|---|---|
| committer | Jared Roesch <roeschinc@gmail.com> | 2016-09-02 11:58:02 -0700 |
| commit | f18c99072e6b9ec0075d913ea6454f0c5e75881c (patch) | |
| tree | 490d6b6a8c9f3fbd620ac86c31225b730e13ee17 /src | |
| parent | 689c6c48ecd3d89d120c6aecf8b69222920e4520 (diff) | |
| download | rust-f18c99072e6b9ec0075d913ea6454f0c5e75881c.tar.gz rust-f18c99072e6b9ec0075d913ea6454f0c5e75881c.zip | |
Add tests for #29859
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/compile-fail/issue-29859-2.rs | 25 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-29859.rs | 25 |
2 files changed, 50 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-29859-2.rs b/src/test/compile-fail/issue-29859-2.rs new file mode 100644 index 00000000000..c0e50185f93 --- /dev/null +++ b/src/test/compile-fail/issue-29859-2.rs @@ -0,0 +1,25 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(optin_builtin_traits)] + +trait Magic: Copy {} +impl Magic for .. {} +impl<T:Magic> Magic for T {} + +fn copy<T: Magic>(x: T) -> (T, T) { (x, x) } + +#[derive(Debug)] +struct NoClone; + +fn main() { + let (a, b) = copy(NoClone); //~ ERROR E0277 + println!("{:?} {:?}", a, b); +} diff --git a/src/test/compile-fail/issue-29859.rs b/src/test/compile-fail/issue-29859.rs new file mode 100644 index 00000000000..c0e50185f93 --- /dev/null +++ b/src/test/compile-fail/issue-29859.rs @@ -0,0 +1,25 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(optin_builtin_traits)] + +trait Magic: Copy {} +impl Magic for .. {} +impl<T:Magic> Magic for T {} + +fn copy<T: Magic>(x: T) -> (T, T) { (x, x) } + +#[derive(Debug)] +struct NoClone; + +fn main() { + let (a, b) = copy(NoClone); //~ ERROR E0277 + println!("{:?} {:?}", a, b); +} |
