Skip to content

Commit 82f30d2

Browse files
committed
Auto merge of #31717 - alexcrichton:llvmup2, r=brson
This commit rebases our LLVM submodule on the most recent tip of the `release_38` branch of LLVM. There's been a few fixes and this notably fixes the assertion error in #31702. Closes #31702
2 parents 57c357d + 97f7898 commit 82f30d2

File tree

5 files changed

+77
-2
lines changed

5 files changed

+77
-2
lines changed

src/llvm

Submodule llvm updated 39 files

src/rustllvm/llvm-auto-clean-trigger

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
22
# The actual contents of this file do not matter, but to trigger a change on the
33
# build bots then the contents should be changed so git updates the mtime.
4-
2015-01-25
4+
2016-02-16

src/test/auxiliary/issue-31702-1.rs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[derive(Copy)]
12+
pub struct U256(pub [u64; 4]);
13+
14+
impl Clone for U256 {
15+
fn clone(&self) -> U256 {
16+
*self
17+
}
18+
}
19+
20+
impl U256 {
21+
pub fn new(value: u64) -> U256 {
22+
let mut ret = [0; 4];
23+
ret[0] = value;
24+
U256(ret)
25+
}
26+
}

src/test/auxiliary/issue-31702-2.rs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-flags: -g
12+
13+
extern crate issue_31702_1;
14+
15+
use std::collections::HashMap;
16+
use issue_31702_1::U256;
17+
18+
pub struct Ethash {
19+
engine_params: for<'a> fn() -> Option<&'a Vec<u8>>,
20+
u256_params: HashMap<String, U256>,
21+
}
22+
23+
impl Ethash {
24+
pub fn u256_param(&mut self, name: &str) -> U256 {
25+
let engine = self.engine_params;
26+
*self.u256_params.entry(name.to_owned()).or_insert_with(|| {
27+
engine().map_or(U256::new(0u64), |_a| loop {})
28+
})
29+
}
30+
}

src/test/run-pass/issue-31702.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// aux-build:issue-31702-1.rs
12+
// aux-build:issue-31702-2.rs
13+
14+
// this test is actually entirely in the linked library crates
15+
16+
extern crate issue_31702_1;
17+
extern crate issue_31702_2;
18+
19+
fn main() {}

0 commit comments

Comments
 (0)