Skip to content

Commit 57dd722

Browse files
committed
Auto merge of #51884 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
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
2 parents e3bf634 + 3332c0c commit 57dd722

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+577
-827
lines changed

RELEASES.md

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ Stabilized APIs
5656
- [`Take::set_limit`]
5757
- [`hint::unreachable_unchecked`]
5858
- [`os::unix::process::parent_id`]
59-
- [`process::id`]
6059
- [`ptr::swap_nonoverlapping`]
6160
- [`slice::rsplit_mut`]
6261
- [`slice::rsplit`]

src/libcore/slice/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1642,8 +1642,8 @@ impl<T> [T] {
16421642
/// [`split_at_mut`]: #method.split_at_mut
16431643
#[stable(feature = "copy_from_slice", since = "1.9.0")]
16441644
pub fn copy_from_slice(&mut self, src: &[T]) where T: Copy {
1645-
assert!(self.len() == src.len(),
1646-
"destination and source slices have different lengths");
1645+
assert_eq!(self.len(), src.len(),
1646+
"destination and source slices have different lengths");
16471647
unsafe {
16481648
ptr::copy_nonoverlapping(
16491649
src.as_ptr(), self.as_mut_ptr(), self.len());

src/librustc/dep_graph/dep_node.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
//! user of the `DepNode` API of having to know how to compute the expected
6161
//! fingerprint for a given set of node parameters.
6262
63-
use mir::interpret::{GlobalId, ConstValue};
63+
use mir::interpret::GlobalId;
6464
use hir::def_id::{CrateNum, DefId, DefIndex, CRATE_DEF_INDEX};
6565
use hir::map::DefPathHash;
6666
use hir::{HirId, ItemLocalId};
@@ -75,7 +75,7 @@ use traits::query::{
7575
CanonicalPredicateGoal, CanonicalTypeOpProvePredicateGoal, CanonicalTypeOpNormalizeGoal,
7676
};
7777
use ty::{TyCtxt, FnSig, Instance, InstanceDef,
78-
ParamEnv, ParamEnvAnd, Predicate, PolyFnSig, PolyTraitRef, Ty};
78+
ParamEnv, ParamEnvAnd, Predicate, PolyFnSig, PolyTraitRef, Ty, self};
7979
use ty::subst::Substs;
8080

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

637637
[input] Freevars(DefId),
638638
[input] MaybeUnusedTraitImport(DefId),

src/librustc/ich/impls_ty.rs

+8-45
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,11 @@ impl_stable_hash_for!(struct ty::FieldDef {
364364
});
365365

366366
impl<'a, 'gcx> HashStable<StableHashingContext<'a>>
367-
for ::middle::const_val::ConstVal<'gcx> {
367+
for ::mir::interpret::ConstValue<'gcx> {
368368
fn hash_stable<W: StableHasherResult>(&self,
369369
hcx: &mut StableHashingContext<'a>,
370370
hasher: &mut StableHasher<W>) {
371-
use middle::const_val::ConstVal::*;
371+
use mir::interpret::ConstValue::*;
372372

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

@@ -377,23 +377,6 @@ for ::middle::const_val::ConstVal<'gcx> {
377377
def_id.hash_stable(hcx, hasher);
378378
substs.hash_stable(hcx, hasher);
379379
}
380-
Value(ref value) => {
381-
value.hash_stable(hcx, hasher);
382-
}
383-
}
384-
}
385-
}
386-
387-
impl<'a, 'gcx> HashStable<StableHashingContext<'a>>
388-
for ::mir::interpret::ConstValue<'gcx> {
389-
fn hash_stable<W: StableHasherResult>(&self,
390-
hcx: &mut StableHashingContext<'a>,
391-
hasher: &mut StableHasher<W>) {
392-
use mir::interpret::ConstValue::*;
393-
394-
mem::discriminant(self).hash_stable(hcx, hasher);
395-
396-
match *self {
397380
Scalar(val) => {
398381
val.hash_stable(hcx, hasher);
399382
}
@@ -497,40 +480,18 @@ impl_stable_hash_for!(struct ty::Const<'tcx> {
497480
val
498481
});
499482

500-
impl_stable_hash_for!(struct ::middle::const_val::ConstEvalErr<'tcx> {
483+
impl_stable_hash_for!(struct ::mir::interpret::ConstEvalErr<'tcx> {
501484
span,
502-
kind
485+
stacktrace,
486+
error
503487
});
504488

505-
impl_stable_hash_for!(struct ::middle::const_val::FrameInfo {
489+
impl_stable_hash_for!(struct ::mir::interpret::FrameInfo {
506490
span,
507491
lint_root,
508492
location
509493
});
510494

511-
impl<'a, 'gcx> HashStable<StableHashingContext<'a>>
512-
for ::middle::const_val::ErrKind<'gcx> {
513-
fn hash_stable<W: StableHasherResult>(&self,
514-
hcx: &mut StableHashingContext<'a>,
515-
hasher: &mut StableHasher<W>) {
516-
use middle::const_val::ErrKind::*;
517-
518-
mem::discriminant(self).hash_stable(hcx, hasher);
519-
520-
match *self {
521-
TypeckError |
522-
CouldNotResolve |
523-
CheckMatchError => {
524-
// nothing to do
525-
}
526-
Miri(ref err, ref trace) => {
527-
err.hash_stable(hcx, hasher);
528-
trace.hash_stable(hcx, hasher);
529-
},
530-
}
531-
}
532-
}
533-
534495
impl_stable_hash_for!(struct ty::ClosureSubsts<'tcx> { substs });
535496
impl_stable_hash_for!(struct ty::GeneratorSubsts<'tcx> { substs });
536497

@@ -579,6 +540,8 @@ for ::mir::interpret::EvalErrorKind<'gcx, O> {
579540
ReadFromReturnPointer |
580541
UnimplementedTraitSelection |
581542
TypeckError |
543+
TooGeneric |
544+
CheckMatchError |
582545
DerefFunctionPointer |
583546
ExecuteMemory |
584547
OverflowNeg |

src/librustc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ pub mod middle {
132132
pub mod allocator;
133133
pub mod borrowck;
134134
pub mod expr_use_visitor;
135-
pub mod const_val;
136135
pub mod cstore;
137136
pub mod dataflow;
138137
pub mod dead;

src/librustc/middle/const_val.rs

-178
This file was deleted.

0 commit comments

Comments
 (0)