Skip to content

Commit

Permalink
Auto merge of #51884 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Rollup of 6 pull requests

Successful merges:

 - #51636 (Refactor error reporting of constants)
 - #51765 (Use assert_eq! in copy_from_slice)
 - #51822 (Provide existing ref suggestions for more E0308 errors)
 - #51839 (Detect overflows of non u32 shifts)
 - #51868 (Remove process::id from 'Stabilized APIs' in 1.27.0 release notes)
 - #51875 (Explicitely disable WASM code generation for Emscripten)

Failed merges:

r? @ghost
  • Loading branch information
bors committed Jun 28, 2018
2 parents e3bf634 + 3332c0c commit 57dd722
Show file tree
Hide file tree
Showing 70 changed files with 577 additions and 827 deletions.
1 change: 0 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Stabilized APIs
- [`Take::set_limit`]
- [`hint::unreachable_unchecked`]
- [`os::unix::process::parent_id`]
- [`process::id`]
- [`ptr::swap_nonoverlapping`]
- [`slice::rsplit_mut`]
- [`slice::rsplit`]
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1642,8 +1642,8 @@ impl<T> [T] {
/// [`split_at_mut`]: #method.split_at_mut
#[stable(feature = "copy_from_slice", since = "1.9.0")]
pub fn copy_from_slice(&mut self, src: &[T]) where T: Copy {
assert!(self.len() == src.len(),
"destination and source slices have different lengths");
assert_eq!(self.len(), src.len(),
"destination and source slices have different lengths");
unsafe {
ptr::copy_nonoverlapping(
src.as_ptr(), self.as_mut_ptr(), self.len());
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
//! user of the `DepNode` API of having to know how to compute the expected
//! fingerprint for a given set of node parameters.
use mir::interpret::{GlobalId, ConstValue};
use mir::interpret::GlobalId;
use hir::def_id::{CrateNum, DefId, DefIndex, CRATE_DEF_INDEX};
use hir::map::DefPathHash;
use hir::{HirId, ItemLocalId};
Expand All @@ -75,7 +75,7 @@ use traits::query::{
CanonicalPredicateGoal, CanonicalTypeOpProvePredicateGoal, CanonicalTypeOpNormalizeGoal,
};
use ty::{TyCtxt, FnSig, Instance, InstanceDef,
ParamEnv, ParamEnvAnd, Predicate, PolyFnSig, PolyTraitRef, Ty};
ParamEnv, ParamEnvAnd, Predicate, PolyFnSig, PolyTraitRef, Ty, self};
use ty::subst::Substs;

// erase!() just makes tokens go away. It's used to specify which macro argument
Expand Down Expand Up @@ -632,7 +632,7 @@ define_dep_nodes!( <'tcx>
// queries). Making them anonymous avoids hashing the result, which
// may save a bit of time.
[anon] EraseRegionsTy { ty: Ty<'tcx> },
[anon] ConstValueToAllocation { val: ConstValue<'tcx>, ty: Ty<'tcx> },
[anon] ConstValueToAllocation { val: &'tcx ty::Const<'tcx> },

[input] Freevars(DefId),
[input] MaybeUnusedTraitImport(DefId),
Expand Down
53 changes: 8 additions & 45 deletions src/librustc/ich/impls_ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,11 @@ impl_stable_hash_for!(struct ty::FieldDef {
});

impl<'a, 'gcx> HashStable<StableHashingContext<'a>>
for ::middle::const_val::ConstVal<'gcx> {
for ::mir::interpret::ConstValue<'gcx> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use middle::const_val::ConstVal::*;
use mir::interpret::ConstValue::*;

mem::discriminant(self).hash_stable(hcx, hasher);

Expand All @@ -377,23 +377,6 @@ for ::middle::const_val::ConstVal<'gcx> {
def_id.hash_stable(hcx, hasher);
substs.hash_stable(hcx, hasher);
}
Value(ref value) => {
value.hash_stable(hcx, hasher);
}
}
}
}

impl<'a, 'gcx> HashStable<StableHashingContext<'a>>
for ::mir::interpret::ConstValue<'gcx> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use mir::interpret::ConstValue::*;

mem::discriminant(self).hash_stable(hcx, hasher);

match *self {
Scalar(val) => {
val.hash_stable(hcx, hasher);
}
Expand Down Expand Up @@ -497,40 +480,18 @@ impl_stable_hash_for!(struct ty::Const<'tcx> {
val
});

impl_stable_hash_for!(struct ::middle::const_val::ConstEvalErr<'tcx> {
impl_stable_hash_for!(struct ::mir::interpret::ConstEvalErr<'tcx> {
span,
kind
stacktrace,
error
});

impl_stable_hash_for!(struct ::middle::const_val::FrameInfo {
impl_stable_hash_for!(struct ::mir::interpret::FrameInfo {
span,
lint_root,
location
});

impl<'a, 'gcx> HashStable<StableHashingContext<'a>>
for ::middle::const_val::ErrKind<'gcx> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use middle::const_val::ErrKind::*;

mem::discriminant(self).hash_stable(hcx, hasher);

match *self {
TypeckError |
CouldNotResolve |
CheckMatchError => {
// nothing to do
}
Miri(ref err, ref trace) => {
err.hash_stable(hcx, hasher);
trace.hash_stable(hcx, hasher);
},
}
}
}

impl_stable_hash_for!(struct ty::ClosureSubsts<'tcx> { substs });
impl_stable_hash_for!(struct ty::GeneratorSubsts<'tcx> { substs });

Expand Down Expand Up @@ -579,6 +540,8 @@ for ::mir::interpret::EvalErrorKind<'gcx, O> {
ReadFromReturnPointer |
UnimplementedTraitSelection |
TypeckError |
TooGeneric |
CheckMatchError |
DerefFunctionPointer |
ExecuteMemory |
OverflowNeg |
Expand Down
1 change: 0 additions & 1 deletion src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ pub mod middle {
pub mod allocator;
pub mod borrowck;
pub mod expr_use_visitor;
pub mod const_val;
pub mod cstore;
pub mod dataflow;
pub mod dead;
Expand Down
178 changes: 0 additions & 178 deletions src/librustc/middle/const_val.rs

This file was deleted.

Loading

0 comments on commit 57dd722

Please sign in to comment.