diff --git a/src/llvm b/src/llvm index de5c31045dc..39e8e59056b 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit de5c31045dc0f6da1f65d02ee640ccf99ba90e7c +Subproject commit 39e8e59056bcd84bf9c44d0bcd46ae441567e0a0 diff --git a/src/rustllvm/llvm-auto-clean-trigger b/src/rustllvm/llvm-auto-clean-trigger index 7df7df505cd..50c32a59153 100644 --- a/src/rustllvm/llvm-auto-clean-trigger +++ b/src/rustllvm/llvm-auto-clean-trigger @@ -1,4 +1,4 @@ # If this file is modified, then llvm will be forcibly cleaned and then rebuilt. # The actual contents of this file do not matter, but to trigger a change on the # build bots then the contents should be changed so git updates the mtime. -2015-01-25 +2016-02-16 diff --git a/src/test/auxiliary/issue-31702-1.rs b/src/test/auxiliary/issue-31702-1.rs new file mode 100644 index 00000000000..50a31630df3 --- /dev/null +++ b/src/test/auxiliary/issue-31702-1.rs @@ -0,0 +1,26 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[derive(Copy)] +pub struct U256(pub [u64; 4]); + +impl Clone for U256 { + fn clone(&self) -> U256 { + *self + } +} + +impl U256 { + pub fn new(value: u64) -> U256 { + let mut ret = [0; 4]; + ret[0] = value; + U256(ret) + } +} diff --git a/src/test/auxiliary/issue-31702-2.rs b/src/test/auxiliary/issue-31702-2.rs new file mode 100644 index 00000000000..c5b1bc6dfb0 --- /dev/null +++ b/src/test/auxiliary/issue-31702-2.rs @@ -0,0 +1,30 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -g + +extern crate issue_31702_1; + +use std::collections::HashMap; +use issue_31702_1::U256; + +pub struct Ethash { + engine_params: for<'a> fn() -> Option<&'a Vec>, + u256_params: HashMap, +} + +impl Ethash { + pub fn u256_param(&mut self, name: &str) -> U256 { + let engine = self.engine_params; + *self.u256_params.entry(name.to_owned()).or_insert_with(|| { + engine().map_or(U256::new(0u64), |_a| loop {}) + }) + } +} diff --git a/src/test/run-pass/issue-31702.rs b/src/test/run-pass/issue-31702.rs new file mode 100644 index 00000000000..89eafa88ee0 --- /dev/null +++ b/src/test/run-pass/issue-31702.rs @@ -0,0 +1,19 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:issue-31702-1.rs +// aux-build:issue-31702-2.rs + +// this test is actually entirely in the linked library crates + +extern crate issue_31702_1; +extern crate issue_31702_2; + +fn main() {}