diff options
| author | Michael Sullivan <sully@msully.net> | 2012-06-01 17:58:40 -0700 |
|---|---|---|
| committer | Michael Sullivan <sully@msully.net> | 2012-06-01 17:58:40 -0700 |
| commit | 8f7364b26d22f945f1e013041730caaedc640a80 (patch) | |
| tree | 0c5e59c27b00b1473bdaca8a1b544685807b8792 /src/rustc | |
| parent | 2ab1b5838b5d35e57f2f8bcc90f8b70c03e4d9c8 (diff) | |
| download | rust-8f7364b26d22f945f1e013041730caaedc640a80.tar.gz rust-8f7364b26d22f945f1e013041730caaedc640a80.zip | |
Don't try to compute kinds of fictitious types. Indicate a bug instead.
Diffstat (limited to 'src/rustc')
| -rw-r--r-- | src/rustc/middle/ty.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index 04ea9fe01bb..07f6e7749ec 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -1434,14 +1434,8 @@ fn type_kind(cx: ctxt, ty: t) -> kind { ty_ptr(_) { kind_implicitly_sendable() | kind_const() } // FIXME: this *shouldn't* be implicitly copyable (#2450) ty_str { kind_implicitly_sendable() | kind_const() } - ty_type { kind_copyable() } ty_fn(f) { proto_kind(f.proto) } - // Closures have kind determined by capture mode - ty_opaque_closure_ptr(ck_block) { kind_noncopyable() } - ty_opaque_closure_ptr(ck_box) { kind_implicitly_copyable() } - ty_opaque_closure_ptr(ck_uniq) { kind_sendable() } - // Those with refcounts raise noncopyable to copyable, // lower sendable to copyable. Therefore just set result to copyable. ty_box(tm) { @@ -1456,7 +1450,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind { else { kind_implicitly_copyable() } } } - ty_iface(_, _) | ty_opaque_box { kind_implicitly_copyable() } + ty_iface(_, _) { kind_implicitly_copyable() } ty_rptr(_, _) { kind_implicitly_copyable() } // Unique boxes and vecs have the kind of their contained type, @@ -1548,6 +1542,9 @@ fn type_kind(cx: ctxt, ty: t) -> kind { ty_self { kind_noncopyable() } ty_var(_) { cx.sess.bug("Asked to compute kind of a type variable"); } + ty_type | ty_opaque_closure_ptr(_) | ty_opaque_box { + cx.sess.bug("Asked to compute kind of fictitious type"); + } }; cx.kind_cache.insert(ty, result); |
