// its scope.
self.resolve_error(span,
- "attempt to use a type \
- argument out of scope");
+ "can't use type parameters from \
+ outer function; try using a local \
+ type parameter instead");
}
return None;
// its scope.
self.resolve_error(span,
- "attempt to use a type \
- argument out of scope");
+ "can't use type parameters from \
+ outer function; try using a local \
+ type parameter instead");
}
return None;
root.repr(self.tcx)),
None => ~""
};
- let m = format!("missing type param `{}`{}",
- t.repr(self.tcx), root_msg);
+ let m = format!("can't use type parameters from outer \
+ function{}; try using a local type \
+ parameter instead", root_msg);
match self.span {
Some(span) => self.tcx.sess.span_err(span, m),
None => self.tcx.sess.err(m)
// except according to those terms.
fn foo<T>() {
- fn bar(b: T) { } //~ ERROR attempt to use a type argument out of scope
+ fn bar(b: T) { } //~ ERROR can't use type parameters from outer
//~^ ERROR use of undeclared type name
}
fn main() { }
fn siphash<T>() {
trait t {
- fn g(&self, x: T) -> T; //~ ERROR attempt to use a type argument out of scope
- //~^ ERROR attempt to use a type argument out of scope
+ fn g(&self, x: T) -> T; //~ ERROR can't use type parameters from outer function; try using
+ //~^ ERROR can't use type parameters from outer function; try using
//~^^ ERROR use of undeclared type name `T`
//~^^^ ERROR use of undeclared type name `T`
}
fn foo<T>() {
struct foo {
- x: T, //~ ERROR attempt to use a type argument out of scope
+ x: T, //~ ERROR can't use type parameters from outer function;
//~^ ERROR use of undeclared type name
}
fn f<Z>() -> bool {
enum E { V(Z) }
- //~^ ERROR missing type param `Z` in the substitution of `Z`
+ //~^ ERROR can't use type parameters from outer function in the
true
}
fn f<T>() -> bool {
struct S(T); //~ ERROR use of undeclared type name `T`
- //~^ ERROR attempt to use a type argument out of scope
+ //~^ ERROR can't use type parameters from outer function; try using
true
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// error-pattern:attempt to use a type argument out of scope
+// error-pattern:can't use type parameters from outer function; try using
fn hd<U>(v: Vec<U> ) -> U {
fn hd1(w: [U]) -> U { return w[0]; }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// error-pattern:attempt to use a type argument out of scope
+// error-pattern:can't use type parameters from outer function; try using
fn foo<T>(x: T) {
fn bar(f: |T| -> T) { }
}