Skip to content

Commit

Permalink
Error out in resolve if structs try to capture type parameters
Browse files Browse the repository at this point in the history
Closes #3214
  • Loading branch information
catamorphism committed Oct 15, 2012
1 parent 91ae541 commit 7d84505
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/rustc/middle/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-3214.rs
Original file line number Diff line number Diff line change
@@ -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 { }
}
}
Expand Down

0 comments on commit 7d84505

Please sign in to comment.