Error out in resolve if structs try to capture type parameters

Closes #3214
This commit is contained in:
Tim Chevalier 2012-10-15 15:29:45 -07:00
parent 91ae5412d8
commit 7d84505654
2 changed files with 4 additions and 4 deletions

View File

@ -3522,8 +3522,8 @@ impl Resolver {
let outer_type_parameter_count = (*type_parameters).len();
let borrowed_type_parameters: &~[ty_param] = &*type_parameters;
do self.with_type_parameter_rib(HasTypeParameters
(borrowed_type_parameters, id, 0u,
NormalRibKind)) {
(borrowed_type_parameters, id, 0,
OpaqueFunctionRibKind)) {
// Resolve the type parameters.
self.resolve_type_parameters(*type_parameters, visitor);

View File

@ -1,7 +1,7 @@
// xfail-test
fn foo<T>() {
struct foo {
mut x: T, //~ ERROR quux
mut x: T, //~ ERROR attempt to use a type argument out of scope
//~^ ERROR use of undeclared type name
drop { }
}
}