Error out in resolve if structs try to capture type parameters
Closes #3214
This commit is contained in:
parent
91ae5412d8
commit
7d84505654
@ -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);
|
||||
|
@ -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 { }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user