Skip to content

Type inference(?) regression, rand fails to build on nightly 2016-01-04 #30713

Closed
@SimonSapin

Description

@SimonSapin

The rand crate (rust-random/rand@4aa8f5b) builds correctly with rustc 1.7.0-nightly (8f11a9e 2016-01-03), but fails with rustc 1.7.0-nightly (d5e2290 2016-01-04):

% cargo build
   Compiling winapi-build v0.1.1
   Compiling libc v0.2.4
   Compiling winapi v0.2.5
   Compiling advapi32-sys v0.1.2
   Compiling rand v0.3.12 (file:///home/simon/projects/servo/deps/rand)
src/isaac.rs:134:37: 134:48 error: the type of this value must be known in this context
src/isaac.rs:134             ($x:expr) => ( self.mem[($x >> 2).0 as usize & (RAND_SIZE_USIZE - 1)] )
                                                     ^~~~~~~~~~~
src/isaac.rs:147:29: 147:36 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:171:17: 171:38 note: in this expansion of rngstepp! (defined in src/isaac.rs)
src/isaac.rs:134:37: 134:48 error: the type of this value must be known in this context
src/isaac.rs:134             ($x:expr) => ( self.mem[($x >> 2).0 as usize & (RAND_SIZE_USIZE - 1)] )
                                                     ^~~~~~~~~~~
src/isaac.rs:150:25: 150:49 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:171:17: 171:38 note: in this expansion of rngstepp! (defined in src/isaac.rs)
src/isaac.rs:134:37: 134:48 error: the type of this value must be known in this context
src/isaac.rs:134             ($x:expr) => ( self.mem[($x >> 2).0 as usize & (RAND_SIZE_USIZE - 1)] )
                                                     ^~~~~~~~~~~
src/isaac.rs:162:29: 162:36 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:172:17: 172:37 note: in this expansion of rngstepn! (defined in src/isaac.rs)
src/isaac.rs:134:37: 134:48 error: the type of this value must be known in this context
src/isaac.rs:134             ($x:expr) => ( self.mem[($x >> 2).0 as usize & (RAND_SIZE_USIZE - 1)] )
                                                     ^~~~~~~~~~~
src/isaac.rs:165:25: 165:49 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:172:17: 172:37 note: in this expansion of rngstepn! (defined in src/isaac.rs)
src/isaac.rs:134:37: 134:48 error: the type of this value must be known in this context
src/isaac.rs:134             ($x:expr) => ( self.mem[($x >> 2).0 as usize & (RAND_SIZE_USIZE - 1)] )
                                                     ^~~~~~~~~~~
src/isaac.rs:147:29: 147:36 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:173:17: 173:37 note: in this expansion of rngstepp! (defined in src/isaac.rs)
src/isaac.rs:134:37: 134:48 error: the type of this value must be known in this context
src/isaac.rs:134             ($x:expr) => ( self.mem[($x >> 2).0 as usize & (RAND_SIZE_USIZE - 1)] )
                                                     ^~~~~~~~~~~
src/isaac.rs:150:25: 150:49 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:173:17: 173:37 note: in this expansion of rngstepp! (defined in src/isaac.rs)
src/isaac.rs:134:37: 134:48 error: the type of this value must be known in this context
src/isaac.rs:134             ($x:expr) => ( self.mem[($x >> 2).0 as usize & (RAND_SIZE_USIZE - 1)] )
                                                     ^~~~~~~~~~~
src/isaac.rs:162:29: 162:36 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:174:17: 174:38 note: in this expansion of rngstepn! (defined in src/isaac.rs)
src/isaac.rs:134:37: 134:48 error: the type of this value must be known in this context
src/isaac.rs:134             ($x:expr) => ( self.mem[($x >> 2).0 as usize & (RAND_SIZE_USIZE - 1)] )
                                                     ^~~~~~~~~~~
src/isaac.rs:165:25: 165:49 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:174:17: 174:38 note: in this expansion of rngstepn! (defined in src/isaac.rs)
src/isaac.rs:373:42: 373:53 error: the type of this value must be known in this context
src/isaac.rs:373                 *self.mem.get_unchecked((($x >> 3).0 as usize) & (RAND_SIZE_64 - 1))
                                                          ^~~~~~~~~~~
src/isaac.rs:389:37: 389:44 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:416:17: 416:34 note: in this expansion of rngstepp! (defined in src/isaac.rs)
src/isaac.rs:373:42: 373:53 error: the type of this value must be known in this context
src/isaac.rs:373                 *self.mem.get_unchecked((($x >> 3).0 as usize) & (RAND_SIZE_64 - 1))
                                                          ^~~~~~~~~~~
src/isaac.rs:392:33: 392:60 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:416:17: 416:34 note: in this expansion of rngstepp! (defined in src/isaac.rs)
src/isaac.rs:373:42: 373:53 error: the type of this value must be known in this context
src/isaac.rs:373                 *self.mem.get_unchecked((($x >> 3).0 as usize) & (RAND_SIZE_64 - 1))
                                                          ^~~~~~~~~~~
src/isaac.rs:407:37: 407:44 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:417:17: 417:33 note: in this expansion of rngstepn! (defined in src/isaac.rs)
src/isaac.rs:373:42: 373:53 error: the type of this value must be known in this context
src/isaac.rs:373                 *self.mem.get_unchecked((($x >> 3).0 as usize) & (RAND_SIZE_64 - 1))
                                                          ^~~~~~~~~~~
src/isaac.rs:410:33: 410:60 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:417:17: 417:33 note: in this expansion of rngstepn! (defined in src/isaac.rs)
src/isaac.rs:373:42: 373:53 error: the type of this value must be known in this context
src/isaac.rs:373                 *self.mem.get_unchecked((($x >> 3).0 as usize) & (RAND_SIZE_64 - 1))
                                                          ^~~~~~~~~~~
src/isaac.rs:389:37: 389:44 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:418:17: 418:34 note: in this expansion of rngstepp! (defined in src/isaac.rs)
src/isaac.rs:373:42: 373:53 error: the type of this value must be known in this context
src/isaac.rs:373                 *self.mem.get_unchecked((($x >> 3).0 as usize) & (RAND_SIZE_64 - 1))
                                                          ^~~~~~~~~~~
src/isaac.rs:392:33: 392:60 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:418:17: 418:34 note: in this expansion of rngstepp! (defined in src/isaac.rs)
src/isaac.rs:373:42: 373:53 error: the type of this value must be known in this context
src/isaac.rs:373                 *self.mem.get_unchecked((($x >> 3).0 as usize) & (RAND_SIZE_64 - 1))
                                                          ^~~~~~~~~~~
src/isaac.rs:407:37: 407:44 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:419:17: 419:34 note: in this expansion of rngstepn! (defined in src/isaac.rs)
src/isaac.rs:373:42: 373:53 error: the type of this value must be known in this context
src/isaac.rs:373                 *self.mem.get_unchecked((($x >> 3).0 as usize) & (RAND_SIZE_64 - 1))
                                                          ^~~~~~~~~~~
src/isaac.rs:410:33: 410:60 note: in this expansion of ind! (defined in src/isaac.rs)
src/isaac.rs:419:17: 419:34 note: in this expansion of rngstepn! (defined in src/isaac.rs)
error: aborting due to 16 previous errors
Could not compile `rand`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions