mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 08:53:35 +00:00
parent
9feaf1d023
commit
77279a73cb
12
src/test/compile-fail/issue-6458-1.rs
Normal file
12
src/test/compile-fail/issue-6458-1.rs
Normal file
@ -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
|
13
src/test/compile-fail/issue-6458-2.rs
Normal file
13
src/test/compile-fail/issue-6458-2.rs
Normal file
@ -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
|
||||
}
|
15
src/test/compile-fail/issue-6458-3.rs
Normal file
15
src/test/compile-fail/issue-6458-3.rs
Normal file
@ -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
|
||||
}
|
17
src/test/compile-fail/issue-6458-4.rs
Normal file
17
src/test/compile-fail/issue-6458-4.rs
Normal file
@ -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);
|
||||
}
|
21
src/test/compile-fail/issue-6458.rs
Normal file
21
src/test/compile-fail/issue-6458.rs
Normal file
@ -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() {
|
||||
}
|
Loading…
Reference in New Issue
Block a user