mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-02 00:07:42 +03:00
Teach resolve to find obj fields and ty params from methods.
This commit is contained in:
@@ -115,6 +115,18 @@ fn in_scope(ast.ident i, &scope s) -> option.t[def] {
|
||||
}
|
||||
}
|
||||
}
|
||||
case (ast.item_obj(_, ?ob, ?ty_params, _, _)) {
|
||||
for (ast.obj_field f in ob.fields) {
|
||||
if (_str.eq(f.ident, i)) {
|
||||
ret some[def](ast.def_obj_field(f.id));
|
||||
}
|
||||
}
|
||||
for (ast.ty_param tp in ty_params) {
|
||||
if (_str.eq(tp.ident, i)) {
|
||||
ret some[def](ast.def_ty_arg(tp.id));
|
||||
}
|
||||
}
|
||||
}
|
||||
case (ast.item_mod(_, ?m, _)) {
|
||||
ret check_mod(i, m);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user