diff options
| author | bors <bors@rust-lang.org> | 2014-08-18 10:11:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-08-18 10:11:03 +0000 |
| commit | 1721e81298abfbbde60081acd4698feb26b00fda (patch) | |
| tree | 863984364ed83fec8843635f0a15532242ee318f /src | |
| parent | ed7a3d6f1ebc9db39a45dc6139bbcdc16b32b0a8 (diff) | |
| parent | 5b9cd453c971b967049e63f5c048fbadf2a8e261 (diff) | |
| download | rust-1721e81298abfbbde60081acd4698feb26b00fda.tar.gz rust-1721e81298abfbbde60081acd4698feb26b00fda.zip | |
auto merge of #16568 : jakub-/rust/needstest, r=pcwalton
Closes #8761. Closes #16010. Closes #13033. Closes #15094.
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/compile-fail/issue-13033.rs | 22 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-15094.rs | 33 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-8761.rs | 18 | ||||
| -rw-r--r-- | src/test/run-pass/issue-16452.rs | 17 |
4 files changed, 90 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-13033.rs b/src/test/compile-fail/issue-13033.rs new file mode 100644 index 00000000000..43cf70e5bc3 --- /dev/null +++ b/src/test/compile-fail/issue-13033.rs @@ -0,0 +1,22 @@ +// Copyright 2014 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. + +trait Foo { + fn bar(&mut self, other: &mut Foo); +} + +struct Baz; + +impl Foo for Baz { + fn bar(&mut self, other: &Foo) {} + //~^ ERROR method `bar` has an incompatible type for trait: values differ in mutability [E0053] +} + +fn main() {} diff --git a/src/test/compile-fail/issue-15094.rs b/src/test/compile-fail/issue-15094.rs new file mode 100644 index 00000000000..2540c7edb0c --- /dev/null +++ b/src/test/compile-fail/issue-15094.rs @@ -0,0 +1,33 @@ +// Copyright 2014 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(overloaded_calls)] + +use std::{fmt, ops}; + +struct Shower<T> { + x: T +} + +impl<T: fmt::Show> ops::Fn<(), ()> for Shower<T> { + fn call(&self, _args: ()) { +//~^ ERROR `call` has an incompatible type for trait: expected "rust-call" fn but found "Rust" fn + println!("{}", self.x); + } +} + +fn make_shower<T>(x: T) -> Shower<T> { + Shower { x: x } +} + +pub fn main() { + let show3 = make_shower(3i); + show3(); +} diff --git a/src/test/compile-fail/issue-8761.rs b/src/test/compile-fail/issue-8761.rs new file mode 100644 index 00000000000..183965f099c --- /dev/null +++ b/src/test/compile-fail/issue-8761.rs @@ -0,0 +1,18 @@ +// Copyright 2014 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. + +enum Foo { + A = 1i64, + //~^ ERROR mismatched types: expected `int` but found `i64` + B = 2u8 + //~^ ERROR mismatched types: expected `int` but found `u8` +} + +fn main() {} diff --git a/src/test/run-pass/issue-16452.rs b/src/test/run-pass/issue-16452.rs new file mode 100644 index 00000000000..da480207490 --- /dev/null +++ b/src/test/run-pass/issue-16452.rs @@ -0,0 +1,17 @@ +// Copyright 2014 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. + +fn main() { + if true { return } + match () { + () => { static MAGIC: uint = 0; } + } +} + |
