about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-08-13 23:59:18 -0700
committerbors <bors@rust-lang.org>2013-08-13 23:59:18 -0700
commit0efbb25a26d9a793ce5aa67e030b3d0bee43f5fa (patch)
treea99a23d96d8be6959a43fa83bb85465c72f6c468 /src/test
parente86d414f2224cbdbd65e26761831ac6f9842d82e (diff)
parentdb2d9caeda41bbda7490166c63af3a0481c210a5 (diff)
downloadrust-0efbb25a26d9a793ce5aa67e030b3d0bee43f5fa.tar.gz
rust-0efbb25a26d9a793ce5aa67e030b3d0bee43f5fa.zip
auto merge of #8477 : catamorphism/rust/issue-4096, r=msullivan
r? @msullivan ...e parameters

In this case, it's likely to be that the user forgot the `self` type, so
say so.

Closes #4096
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-4096.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-4096.rs b/src/test/compile-fail/issue-4096.rs
new file mode 100644
index 00000000000..3f1172b6de8
--- /dev/null
+++ b/src/test/compile-fail/issue-4096.rs
@@ -0,0 +1,22 @@
+// 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 trait Nummy {
+    fn from_inty<T>() -> Self;
+}
+
+impl Nummy for float {
+    fn from_inty<T>() -> float { 0.0 }
+}
+
+fn main() {
+    let _1:float = Nummy::from_inty::<int>();  //~ ERROR not enough type
+    //~^ NOTE Static methods have an extra implicit type parameter
+}