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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo(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 or the MIT license +// , 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 or the MIT license +// , 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo(b: bool) -> Result { + 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct TypeWithState; +pub struct MyState; + +pub fn foo(_: TypeWithState) {} + +pub fn bar() { + foo(TypeWithState); //~ ERROR: cannot determine a type for this expression: unconstrained type +} + +fn main() { +}