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
This commit is contained in:
bors 2013-08-13 23:59:18 -07:00
commit 0efbb25a26
2 changed files with 31 additions and 0 deletions

View file

@ -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
}