Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 3084a64

Browse files
authored
Merge pull request #124 from JohnTitor/rustup
Rustup to the latest nightly
2 parents 2b96054 + b55a3e7 commit 3084a64

File tree

5 files changed

+64
-52
lines changed

5 files changed

+64
-52
lines changed

ci/run.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export RUST_BACKTRACE=full
77

88
cargo +nightly install rustup-toolchain-install-master
99
if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
10-
rustup-toolchain-install-master -f -n master -c rustc-dev -i x86_64-pc-windows-msvc
10+
rustup-toolchain-install-master -f -n master -c rustc-dev -c llvm-tools -i x86_64-pc-windows-msvc
1111
else
12-
rustup-toolchain-install-master -f -n master -c rustc-dev
12+
rustup-toolchain-install-master -f -n master -c rustc-dev -c llvm-tools
1313
fi
1414
rustup override set master
1515

src/translate.rs

+54-40
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,12 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
362362
predicate: Predicate<'tcx>,
363363
) -> Option<Predicate<'tcx>> {
364364
use rustc_middle::ty::{
365-
Binder, OutlivesPredicate, ProjectionPredicate, ProjectionTy, SubtypePredicate,
366-
TraitPredicate,
365+
Binder, OutlivesPredicate, PredicateKind, ProjectionPredicate, ProjectionTy,
366+
SubtypePredicate, ToPredicate, TraitPredicate,
367367
};
368368

369-
Some(match predicate {
370-
Predicate::Trait(trait_predicate, constness) => Predicate::Trait(
369+
Some(match predicate.kind() {
370+
PredicateKind::Trait(trait_predicate, constness) => PredicateKind::Trait(
371371
Binder::bind(
372372
if let Some((target_def_id, target_substs)) = self.translate_orig_substs(
373373
index_map,
@@ -384,48 +384,59 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
384384
return None;
385385
},
386386
),
387-
constness,
388-
),
389-
Predicate::RegionOutlives(region_outlives_predicate) => {
390-
Predicate::RegionOutlives(region_outlives_predicate.map_bound(|r_pred| {
387+
*constness,
388+
)
389+
.to_predicate(self.tcx),
390+
PredicateKind::RegionOutlives(region_outlives_predicate) => {
391+
PredicateKind::RegionOutlives(region_outlives_predicate.map_bound(|r_pred| {
391392
let l = self.translate_region(r_pred.0);
392393
let r = self.translate_region(r_pred.1);
393394
OutlivesPredicate(l, r)
394395
}))
396+
.to_predicate(self.tcx)
395397
}
396-
Predicate::TypeOutlives(type_outlives_predicate) => {
397-
Predicate::TypeOutlives(type_outlives_predicate.map_bound(|r_pred| {
398+
PredicateKind::TypeOutlives(type_outlives_predicate) => {
399+
PredicateKind::TypeOutlives(type_outlives_predicate.map_bound(|r_pred| {
398400
let l = self.translate(index_map, &r_pred.0);
399401
let r = self.translate_region(r_pred.1);
400402
OutlivesPredicate(l, r)
401403
}))
404+
.to_predicate(self.tcx)
402405
}
403-
Predicate::Projection(projection_predicate) => Predicate::Projection(Binder::bind(
404-
if let Some((target_def_id, target_substs)) = self.translate_orig_substs(
405-
index_map,
406-
projection_predicate.skip_binder().projection_ty.item_def_id,
407-
projection_predicate.skip_binder().projection_ty.substs,
408-
) {
409-
ProjectionPredicate {
410-
projection_ty: ProjectionTy {
411-
substs: target_substs,
412-
item_def_id: target_def_id,
413-
},
414-
ty: self.translate(index_map, &projection_predicate.skip_binder().ty),
415-
}
416-
} else {
417-
return None;
418-
},
419-
)),
420-
Predicate::WellFormed(ty) => Predicate::WellFormed(self.translate(index_map, &ty)),
421-
Predicate::ObjectSafe(did) => Predicate::ObjectSafe(self.translate_orig(did)),
422-
Predicate::ClosureKind(did, substs, kind) => Predicate::ClosureKind(
423-
self.translate_orig(did),
406+
PredicateKind::Projection(projection_predicate) => {
407+
PredicateKind::Projection(Binder::bind(
408+
if let Some((target_def_id, target_substs)) = self.translate_orig_substs(
409+
index_map,
410+
projection_predicate.skip_binder().projection_ty.item_def_id,
411+
projection_predicate.skip_binder().projection_ty.substs,
412+
) {
413+
ProjectionPredicate {
414+
projection_ty: ProjectionTy {
415+
substs: target_substs,
416+
item_def_id: target_def_id,
417+
},
418+
ty: self.translate(index_map, &projection_predicate.skip_binder().ty),
419+
}
420+
} else {
421+
return None;
422+
},
423+
))
424+
.to_predicate(self.tcx)
425+
}
426+
PredicateKind::WellFormed(ty) => {
427+
PredicateKind::WellFormed(self.translate(index_map, &ty)).to_predicate(self.tcx)
428+
}
429+
PredicateKind::ObjectSafe(did) => {
430+
PredicateKind::ObjectSafe(self.translate_orig(*did)).to_predicate(self.tcx)
431+
}
432+
PredicateKind::ClosureKind(did, substs, kind) => PredicateKind::ClosureKind(
433+
self.translate_orig(*did),
424434
self.translate(index_map, &substs),
425-
kind,
426-
),
427-
Predicate::Subtype(subtype_predicate) => {
428-
Predicate::Subtype(subtype_predicate.map_bound(|s_pred| {
435+
*kind,
436+
)
437+
.to_predicate(self.tcx),
438+
PredicateKind::Subtype(subtype_predicate) => {
439+
PredicateKind::Subtype(subtype_predicate.map_bound(|s_pred| {
429440
let l = self.translate(index_map, &s_pred.a);
430441
let r = self.translate(index_map, &s_pred.b);
431442
SubtypePredicate {
@@ -434,20 +445,23 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
434445
b: r,
435446
}
436447
}))
448+
.to_predicate(self.tcx)
437449
}
438-
Predicate::ConstEvaluatable(orig_did, orig_substs) => {
450+
PredicateKind::ConstEvaluatable(orig_did, orig_substs) => {
439451
if let Some((target_def_id, target_substs)) =
440-
self.translate_orig_substs(index_map, orig_did, orig_substs)
452+
self.translate_orig_substs(index_map, *orig_did, orig_substs)
441453
{
442-
Predicate::ConstEvaluatable(target_def_id, target_substs)
454+
PredicateKind::ConstEvaluatable(target_def_id, target_substs)
455+
.to_predicate(self.tcx)
443456
} else {
444457
return None;
445458
}
446459
}
447-
Predicate::ConstEquate(c1, c2) => Predicate::ConstEquate(
460+
PredicateKind::ConstEquate(c1, c2) => PredicateKind::ConstEquate(
448461
self.translate(index_map, &c1),
449462
self.translate(index_map, &c2),
450-
),
463+
)
464+
.to_predicate(self.tcx),
451465
})
452466
}
453467

src/traverse.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ fn diff_traits<'tcx>(
570570
) {
571571
use rustc_hir::Unsafety::Unsafe;
572572
use rustc_middle::ty::subst::GenericArgKind::Type;
573-
use rustc_middle::ty::{ParamTy, Predicate, TyS};
573+
use rustc_middle::ty::{ParamTy, PredicateKind, TyS};
574574

575575
debug!(
576576
"diff_traits: old: {:?}, new: {:?}, output: {:?}",
@@ -592,7 +592,7 @@ fn diff_traits<'tcx>(
592592
let old_param_env = tcx.param_env(old);
593593

594594
for bound in old_param_env.caller_bounds {
595-
if let Predicate::Trait(pred, _) = *bound {
595+
if let PredicateKind::Trait(pred, _) = *bound.kind() {
596596
let trait_ref = pred.skip_binder().trait_ref;
597597

598598
debug!("trait_ref substs (old): {:?}", trait_ref.substs);

src/typeck.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_middle::{
1818
error::TypeError,
1919
fold::TypeFoldable,
2020
subst::{GenericArg, InternalSubsts, SubstsRef},
21-
GenericParamDefKind, ParamEnv, Predicate, TraitRef, Ty, TyCtxt,
21+
GenericParamDefKind, ParamEnv, Predicate, PredicateKind, ToPredicate, TraitRef, Ty, TyCtxt,
2222
},
2323
};
2424
use rustc_trait_selection::traits::FulfillmentContext;
@@ -75,12 +75,13 @@ impl<'a, 'tcx> BoundContext<'a, 'tcx> {
7575
use rustc_hir::Constness;
7676
use rustc_middle::ty::{Binder, TraitPredicate};
7777

78-
let predicate = Predicate::Trait(
78+
let predicate = PredicateKind::Trait(
7979
Binder::bind(TraitPredicate {
8080
trait_ref: checked_trait_ref,
8181
}),
8282
Constness::NotConst,
83-
);
83+
)
84+
.to_predicate(self.infcx.tcx);
8485
let obligation = Obligation::new(ObligationCause::dummy(), self.given_param_env, predicate);
8586
self.fulfill_cx
8687
.register_predicate_obligation(self.infcx, obligation);
@@ -218,7 +219,6 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {
218219
) -> Option<TypeError<'tcx2>> {
219220
use rustc_infer::infer::outlives::env::OutlivesEnvironment;
220221
use rustc_infer::infer::{InferOk, RegionckMode};
221-
use rustc_middle::middle::region::ScopeTree;
222222
use rustc_middle::ty::Lift;
223223

224224
let error = self
@@ -230,7 +230,6 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {
230230
});
231231

232232
if let Err(err) = error {
233-
let scope_tree = ScopeTree::default();
234233
let outlives_env = OutlivesEnvironment::new(target_param_env);
235234

236235
// The old code here added the bounds from the target param env by hand. However, at
@@ -246,7 +245,6 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {
246245

247246
self.infcx.resolve_regions_and_report_errors(
248247
target_def_id,
249-
&scope_tree,
250248
&outlives_env,
251249
RegionckMode::default(),
252250
);

tests/full_cases/log-0.3.4-0.3.8.osx

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ warning: technically breaking changes in `<new::LogRecord<'a> as std::fmt::Debug
2323
|
2424
= note: trait impl generalized or newly added (technically breaking)
2525

26-
warning: technically breaking changes in `<new::LogMetadata<'a> as std::cmp::Eq>`
26+
warning: technically breaking changes in `<new::LogMetadata<'a> as std::marker::StructuralEq>`
2727
--> log-0.3.8/src/lib.rs:552:10
2828
|
2929
552 | #[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
@@ -71,7 +71,7 @@ warning: technically breaking changes in `<new::LogMetadata<'a> as std::fmt::Deb
7171
|
7272
= note: trait impl generalized or newly added (technically breaking)
7373

74-
warning: technically breaking changes in `<new::LogLocation as std::cmp::Eq>`
74+
warning: technically breaking changes in `<new::LogLocation as std::marker::StructuralEq>`
7575
--> log-0.3.8/src/lib.rs:604:30
7676
|
7777
604 | #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]

0 commit comments

Comments
 (0)