diff options
| author | Jed Davis <jld@panix.com> | 2013-09-29 02:20:11 -0700 |
|---|---|---|
| committer | Jed Davis <jld@panix.com> | 2013-10-29 09:09:20 -0700 |
| commit | fcfbfde0b71d2470cb544d3d216eaf61ceb348bf (patch) | |
| tree | cf2498a05b0bd22e430b441482dbaa335d7c90e1 /src/libstd/reflect.rs | |
| parent | 92109b12029b21e27f9f12a2b4faf4abc0627b64 (diff) | |
| download | rust-fcfbfde0b71d2470cb544d3d216eaf61ceb348bf.tar.gz rust-fcfbfde0b71d2470cb544d3d216eaf61ceb348bf.zip | |
Adjust reflection for the possibility of discriminants larger than int.
Not only can discriminants be smaller than int now, but they can be larger than int on 32-bit targets. This has obvious implications for the reflection interface. Without this change, things fail with LLVM assertions when we try to "extend" i64 to i32.
Diffstat (limited to 'src/libstd/reflect.rs')
| -rw-r--r-- | src/libstd/reflect.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/reflect.rs b/src/libstd/reflect.rs index d63b14f982d..19fa9abc0da 100644 --- a/src/libstd/reflect.rs +++ b/src/libstd/reflect.rs @@ -16,7 +16,7 @@ Runtime type reflection #[allow(missing_doc)]; -use unstable::intrinsics::{Opaque, TyDesc, TyVisitor}; +use unstable::intrinsics::{Disr, Opaque, TyDesc, TyVisitor}; use libc::c_void; use mem; use unstable::raw; @@ -396,7 +396,7 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> { } fn visit_enter_enum(&mut self, n_variants: uint, - get_disr: extern unsafe fn(ptr: *Opaque) -> int, + get_disr: extern unsafe fn(ptr: *Opaque) -> Disr, sz: uint, align: uint) -> bool { self.align(align); @@ -407,7 +407,7 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> { } fn visit_enter_enum_variant(&mut self, variant: uint, - disr_val: int, + disr_val: Disr, n_fields: uint, name: &str) -> bool { if ! self.inner.visit_enter_enum_variant(variant, disr_val, @@ -426,7 +426,7 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> { } fn visit_leave_enum_variant(&mut self, variant: uint, - disr_val: int, + disr_val: Disr, n_fields: uint, name: &str) -> bool { if ! self.inner.visit_leave_enum_variant(variant, disr_val, @@ -437,7 +437,7 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> { } fn visit_leave_enum(&mut self, n_variants: uint, - get_disr: extern unsafe fn(ptr: *Opaque) -> int, + get_disr: extern unsafe fn(ptr: *Opaque) -> Disr, sz: uint, align: uint) -> bool { if ! self.inner.visit_leave_enum(n_variants, get_disr, sz, align) { return false; |
