Skip to content

Commit a99e458

Browse files
committed
Rustup to rustc 1.30.0-nightly (f49f6e7 2018-09-23)
1 parent 5b721a2 commit a99e458

File tree

2 files changed

+74
-21
lines changed

2 files changed

+74
-21
lines changed

0001-Disable-stdsimd-in-libcore.patch

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
From a26747487d398af360dc16344b1f9d2b367720c9 Mon Sep 17 00:00:00 2001
1+
From 09ba4e4d2574ba591524cffe18eb11e05e6726a4 Mon Sep 17 00:00:00 2001
22
From: bjorn3 <[email protected]>
3-
Date: Thu, 19 Jul 2018 18:26:56 +0200
3+
Date: Mon, 24 Sep 2018 18:50:20 +0200
44
Subject: [PATCH] Disable stdsimd in libcore
55

66
---
77
src/libcore/lib.rs | 2 ++
88
1 file changed, 2 insertions(+)
99

1010
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
11-
index bbe6ae8619..bdeb6ce426 100644
11+
index 3b7646f..d349a49 100644
1212
--- a/src/libcore/lib.rs
1313
+++ b/src/libcore/lib.rs
14-
@@ -238,6 +238,7 @@ macro_rules! test_v256 { ($item:item) => {}; }
15-
macro_rules! test_v512 { ($item:item) => {}; }
16-
#[allow(unused_macros)]
17-
macro_rules! vector_impl { ($([$f:ident, $($args:tt)*]),*) => { $($f!($($args)*);)* } }
14+
@@ -226,6 +226,7 @@ mod nonzero;
15+
mod tuple;
16+
mod unit;
17+
1818
+/*
19-
#[path = "../stdsimd/coresimd/mod.rs"]
20-
#[allow(missing_docs, missing_debug_implementations, dead_code, unused_imports)]
21-
#[unstable(feature = "stdsimd", issue = "48556")]
22-
@@ -250,3 +251,4 @@ pub use coresimd::simd;
19+
// Pull in the the `coresimd` crate directly into libcore. This is where all the
20+
// architecture-specific (and vendor-specific) intrinsics are defined. AKA
21+
// things like SIMD and such. Note that the actual source for all this lies in a
22+
@@ -256,3 +257,4 @@ mod coresimd;
2323
#[stable(feature = "simd_arch", since = "1.27.0")]
2424
#[cfg(not(stage0))]
2525
pub use coresimd::arch;
2626
+*/
27-
--
27+
--
2828
2.11.0
2929

src/constant.rs

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use cranelift_module::*;
22
use crate::prelude::*;
33
use crate::rustc::mir::interpret::{
4-
read_target_uint, AllocId, AllocType, Allocation, ConstValue, EvalResult, GlobalId,
4+
read_target_uint, AllocId, AllocType, Allocation, ConstValue, EvalResult, GlobalId, Scalar,
55
};
66
use crate::rustc::ty::Const;
7-
use crate::rustc_mir::interpret::{CompileTimeEvaluator, EvalContext, Memory, MemoryKind};
7+
use crate::rustc_mir::interpret::{EvalContext, Machine, Memory, MemoryKind, OpTy, PlaceTy};
88

99
#[derive(Default)]
1010
pub struct ConstantCx {
@@ -124,7 +124,7 @@ fn trans_const_place<'a, 'tcx: 'a>(
124124
let mut ecx = EvalContext::new(
125125
fx.tcx.at(DUMMY_SP),
126126
ty::ParamEnv::reveal_all(),
127-
CompileTimeEvaluator,
127+
TransPlaceInterpreter,
128128
(),
129129
);
130130
let op = ecx.const_to_op(const_)?;
@@ -155,11 +155,11 @@ fn data_id_for_static<'a, 'tcx: 'a, B: Backend>(
155155
) -> DataId {
156156
let symbol_name = tcx.symbol_name(Instance::mono(tcx, def_id)).as_str();
157157
let is_mutable = if let crate::rustc::hir::Mutability::MutMutable = tcx.is_static(def_id).unwrap() {
158-
true
159-
} else {
160-
!tcx.type_of(def_id)
161-
.is_freeze(tcx, ParamEnv::reveal_all(), DUMMY_SP)
162-
};
158+
true
159+
} else {
160+
!tcx.type_of(def_id)
161+
.is_freeze(tcx, ParamEnv::reveal_all(), DUMMY_SP)
162+
};
163163
module
164164
.declare_data(&*symbol_name, Linkage::Export, is_mutable)
165165
.unwrap()
@@ -185,7 +185,7 @@ fn define_all_allocs<'a, 'tcx: 'a, B: Backend + 'a>(
185185
module: &mut Module<B>,
186186
cx: &mut ConstantCx,
187187
) {
188-
let memory = Memory::<CompileTimeEvaluator>::new(tcx.at(DUMMY_SP), ());
188+
let memory = Memory::<TransPlaceInterpreter>::new(tcx.at(DUMMY_SP), ());
189189

190190
while let Some(todo_item) = pop_set(&mut cx.todo) {
191191
let (data_id, alloc) = match todo_item {
@@ -269,3 +269,56 @@ fn pop_set<T: Copy + Eq + ::std::hash::Hash>(set: &mut HashSet<T>) -> Option<T>
269269
None
270270
}
271271
}
272+
273+
struct TransPlaceInterpreter;
274+
275+
impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
276+
type MemoryData = ();
277+
type MemoryKinds = ();
278+
const MUT_STATIC_KIND: Option<()> = None;
279+
280+
fn before_terminator(_: &mut EvalContext<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx> {
281+
panic!();
282+
}
283+
284+
fn find_fn(
285+
_: &mut EvalContext<'a, 'mir, 'tcx, Self>,
286+
_: Instance<'tcx>,
287+
_: &[OpTy<'tcx>],
288+
_: Option<PlaceTy<'tcx>>,
289+
_: Option<BasicBlock>,
290+
) -> EvalResult<'tcx, Option<&'mir Mir<'tcx>>> {
291+
panic!();
292+
}
293+
294+
fn call_intrinsic(
295+
_: &mut EvalContext<'a, 'mir, 'tcx, Self>,
296+
_: Instance<'tcx>,
297+
_: &[OpTy<'tcx>],
298+
_: PlaceTy<'tcx>,
299+
) -> EvalResult<'tcx> {
300+
panic!();
301+
}
302+
303+
fn find_foreign_static(
304+
_: crate::rustc::ty::query::TyCtxtAt<'a, 'tcx, 'tcx>,
305+
_: DefId,
306+
) -> EvalResult<'tcx, &'tcx Allocation> {
307+
panic!();
308+
}
309+
310+
fn ptr_op(
311+
_: &EvalContext<'a, 'mir, 'tcx, Self>,
312+
_: mir::BinOp,
313+
_: Scalar,
314+
_: TyLayout<'tcx>,
315+
_: Scalar,
316+
_: TyLayout<'tcx>,
317+
) -> EvalResult<'tcx, (Scalar, bool)> {
318+
panic!();
319+
}
320+
321+
fn box_alloc(_: &mut EvalContext<'a, 'mir, 'tcx, Self>, _: PlaceTy<'tcx>) -> EvalResult<'tcx> {
322+
panic!();
323+
}
324+
}

0 commit comments

Comments
 (0)