about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-09-17 19:28:35 -0700
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-10-02 07:55:42 -0700
commit9de7ad2d8c1729b7b11c6d234fc8ef8ce96809bb (patch)
tree431c955595157f7e0c53a77509f9827fd1bcaaa3 /src/libsyntax
parent5a64e1a35a17c7aebd91e0d2fc9003f08fb5fd6d (diff)
downloadrust-9de7ad2d8c1729b7b11c6d234fc8ef8ce96809bb.tar.gz
rust-9de7ad2d8c1729b7b11c6d234fc8ef8ce96809bb.zip
std: Swap {To,From}Primitive to use the 64bit as the unimplemented version
One downside with this current implementation is that since BigInt's
default is now 64 bit, we can convert larger BigInt's to a primitive,
however the current implementation on 32 bit architectures does not
take advantage of this fact.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/deriving/primitive.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/ext/deriving/primitive.rs b/src/libsyntax/ext/deriving/primitive.rs
index ddf8fc404d4..38c30def1d1 100644
--- a/src/libsyntax/ext/deriving/primitive.rs
+++ b/src/libsyntax/ext/deriving/primitive.rs
@@ -25,32 +25,32 @@ pub fn expand_deriving_from_primitive(cx: @ExtCtxt,
         generics: LifetimeBounds::empty(),
         methods: ~[
             MethodDef {
-                name: "from_int",
+                name: "from_i64",
                 generics: LifetimeBounds::empty(),
                 explicit_self: None,
                 args: ~[
-                    Literal(Path::new(~["int"])),
+                    Literal(Path::new(~["i64"])),
                 ],
                 ret_ty: Literal(Path::new_(~["std", "option", "Option"],
                                            None,
                                            ~[~Self],
                                            true)),
                 const_nonmatching: false,
-                combine_substructure: |c, s, sub| cs_from("int", c, s, sub),
+                combine_substructure: |c, s, sub| cs_from("i64", c, s, sub),
             },
             MethodDef {
-                name: "from_uint",
+                name: "from_u64",
                 generics: LifetimeBounds::empty(),
                 explicit_self: None,
                 args: ~[
-                    Literal(Path::new(~["uint"])),
+                    Literal(Path::new(~["u64"])),
                 ],
                 ret_ty: Literal(Path::new_(~["std", "option", "Option"],
                                            None,
                                            ~[~Self],
                                            true)),
                 const_nonmatching: false,
-                combine_substructure: |c, s, sub| cs_from("uint", c, s, sub),
+                combine_substructure: |c, s, sub| cs_from("u64", c, s, sub),
             },
         ]
     };