Make shared kind the default only for generic functions

You almost never want a function with pinned type params. For
types, objects, resources, and tags, pinned types are actually often
more sane. For most of these, shared rarely makes sense. Only tricky
case is objs -- you'll have to think about the kinds you want there.

Issue #1076
This commit is contained in:
Marijn Haverbeke
2011-10-28 17:00:14 +02:00
parent 6fe7aa4aff
commit 7dacccde94
16 changed files with 63 additions and 71 deletions

View File

@@ -33,7 +33,7 @@ fn def_id_of_def(d: def) -> def_id {
def_local(id, _) { ret id; }
def_variant(_, id) { ret id; }
def_ty(id) { ret id; }
def_ty_arg(_, _) { fail; }
def_ty_param(_, _) { fail; }
def_binding(id) { ret id; }
def_use(id) { ret id; }
def_native_ty(id) { ret id; }
@@ -228,6 +228,10 @@ fn ret_by_ref(style: ret_style) -> bool {
}
}
fn ty_param_kind(tp: ty_param) -> kind {
alt tp.kind { explicit(x) | implicit(x) { x } }
}
// Local Variables:
// mode: rust
// fill-column: 78;