diff options
| -rw-r--r-- | src/test/compile-fail/issue-6458-1.rs | 12 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-6458-2.rs | 13 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-6458-3.rs | 15 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-6458-4.rs | 17 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-6458.rs | 21 |
5 files changed, 78 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-6458-1.rs b/src/test/compile-fail/issue-6458-1.rs new file mode 100644 index 00000000000..a54f05ec348 --- /dev/null +++ b/src/test/compile-fail/issue-6458-1.rs @@ -0,0 +1,12 @@ +// Copyright 2013 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 foo<T>(t: T) {} +fn main() { foo(fail!()) } //~ ERROR cannot determine a type for this expression: unconstrained type diff --git a/src/test/compile-fail/issue-6458-2.rs b/src/test/compile-fail/issue-6458-2.rs new file mode 100644 index 00000000000..8621b37146f --- /dev/null +++ b/src/test/compile-fail/issue-6458-2.rs @@ -0,0 +1,13 @@ +// Copyright 2013 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() { + fmt!("%?", None); //~ ERROR: cannot determine a type for this expression: unconstrained type +} diff --git a/src/test/compile-fail/issue-6458-3.rs b/src/test/compile-fail/issue-6458-3.rs new file mode 100644 index 00000000000..ac41cc11682 --- /dev/null +++ b/src/test/compile-fail/issue-6458-3.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +use std::cast; + +fn main() { + cast::transmute(0); //~ ERROR: cannot determine a type for this expression: unconstrained type +} diff --git a/src/test/compile-fail/issue-6458-4.rs b/src/test/compile-fail/issue-6458-4.rs new file mode 100644 index 00000000000..131d9c824b6 --- /dev/null +++ b/src/test/compile-fail/issue-6458-4.rs @@ -0,0 +1,17 @@ +// Copyright 2013 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 foo(b: bool) -> Result<bool,~str> { + Err(~"bar"); //~ ERROR: cannot determine a type for this expression: unconstrained type +} + +fn main() { + foo(false); +} diff --git a/src/test/compile-fail/issue-6458.rs b/src/test/compile-fail/issue-6458.rs new file mode 100644 index 00000000000..8d9c63687ff --- /dev/null +++ b/src/test/compile-fail/issue-6458.rs @@ -0,0 +1,21 @@ +// Copyright 2013 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. + +pub struct TypeWithState<State>; +pub struct MyState; + +pub fn foo<State>(_: TypeWithState<State>) {} + +pub fn bar() { + foo(TypeWithState); //~ ERROR: cannot determine a type for this expression: unconstrained type +} + +fn main() { +} |
