Skip to content

Commit 76a5ca3

Browse files
committed
Fixed build with newest nightly.
1 parent 5e754f0 commit 76a5ca3

File tree

5 files changed

+42
-49
lines changed

5 files changed

+42
-49
lines changed

Diff for: src/bin/cargo_semver.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,7 @@ impl<'a> WorkInfo<'a> {
439439
let package = source.download_now(package_id, config)?;
440440
let workspace = Workspace::ephemeral(package.clone(), config, None, false)?;
441441

442-
Ok(Self {
443-
package: package,
444-
workspace,
445-
})
442+
Ok(Self { package, workspace })
446443
}
447444

448445
/// Obtain the paths to the produced rlib and the dependency output directory.

Diff for: src/mismatch.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ use std::collections::{HashMap, HashSet, VecDeque};
2424
/// This allows to match up some items that aren't exported, and which possibly even differ in
2525
/// their names across versions.
2626
#[cfg_attr(feature = "cargo-clippy", allow(clippy::module_name_repetitions))]
27-
pub struct MismatchRelation<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
27+
pub struct MismatchRelation<'a, 'gcx: 'tcx, 'tcx> {
2828
/// The type context used.
29-
tcx: TyCtxt<'a, 'gcx, 'tcx>,
29+
tcx: TyCtxt<'gcx, 'tcx>,
3030
/// The queue of found item pairings to be processed.
3131
item_queue: VecDeque<(Res, Res)>,
3232
/// The id mapping to use.
@@ -37,9 +37,9 @@ pub struct MismatchRelation<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
3737
current_new_types: HashSet<Ty<'tcx>>,
3838
}
3939

40-
impl<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> MismatchRelation<'a, 'gcx, 'tcx> {
40+
impl<'a, 'gcx: 'tcx, 'tcx> MismatchRelation<'a, 'gcx, 'tcx> {
4141
/// Construct a new mismtach type relation.
42-
pub fn new(tcx: TyCtxt<'a, 'gcx, 'tcx>, id_mapping: &'a mut IdMapping) -> Self {
42+
pub fn new(tcx: TyCtxt<'gcx, 'tcx>, id_mapping: &'a mut IdMapping) -> Self {
4343
Self {
4444
tcx,
4545
item_queue: id_mapping.toplevel_queue(),
@@ -100,8 +100,8 @@ impl<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> MismatchRelation<'a, 'gcx, 'tcx> {
100100
}
101101
}
102102

103-
impl<'a, 'gcx, 'tcx> TypeRelation<'a, 'gcx, 'tcx> for MismatchRelation<'a, 'gcx, 'tcx> {
104-
fn tcx(&self) -> TyCtxt<'a, 'gcx, 'tcx> {
103+
impl<'a, 'gcx, 'tcx> TypeRelation<'gcx, 'tcx> for MismatchRelation<'a, 'gcx, 'tcx> {
104+
fn tcx(&self) -> TyCtxt<'gcx, 'tcx> {
105105
self.tcx
106106
}
107107

Diff for: src/translate.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use rustc::{
1515
use std::collections::HashMap;
1616

1717
/// The context in which `DefId` translation happens.
18-
pub struct TranslationContext<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> {
18+
pub struct TranslationContext<'a, 'gcx: 'tcx, 'tcx> {
1919
/// The type context to use.
20-
tcx: TyCtxt<'a, 'gcx, 'tcx>,
20+
tcx: TyCtxt<'gcx, 'tcx>,
2121
/// The id mapping to use.
2222
id_mapping: &'a IdMapping,
2323
/// Whether to translate type and region parameters.
@@ -31,7 +31,7 @@ pub struct TranslationContext<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> {
3131
impl<'a, 'gcx, 'tcx> TranslationContext<'a, 'gcx, 'tcx> {
3232
/// Construct a translation context translating to the new crate's `DefId`s.
3333
pub fn target_new(
34-
tcx: TyCtxt<'a, 'gcx, 'tcx>,
34+
tcx: TyCtxt<'gcx, 'tcx>,
3535
id_mapping: &'a IdMapping,
3636
translate_params: bool,
3737
) -> TranslationContext<'a, 'gcx, 'tcx> {
@@ -46,7 +46,7 @@ impl<'a, 'gcx, 'tcx> TranslationContext<'a, 'gcx, 'tcx> {
4646

4747
/// Construct a translation context translating to the old crate's `DefId`s.
4848
pub fn target_old(
49-
tcx: TyCtxt<'a, 'gcx, 'tcx>,
49+
tcx: TyCtxt<'gcx, 'tcx>,
5050
id_mapping: &'a IdMapping,
5151
translate_params: bool,
5252
) -> TranslationContext<'a, 'gcx, 'tcx> {
@@ -533,7 +533,7 @@ impl<'a, 'gcx, 'tcx> InferenceCleanupFolder<'a, 'gcx, 'tcx> {
533533
}
534534

535535
impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for InferenceCleanupFolder<'a, 'gcx, 'tcx> {
536-
fn tcx<'b>(&'b self) -> TyCtxt<'b, 'gcx, 'tcx> {
536+
fn tcx(&self) -> TyCtxt<'gcx, 'tcx> {
537537
self.infcx.tcx
538538
}
539539

Diff for: src/traverse.rs

+24-28
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ use std::collections::{BTreeMap, HashSet, VecDeque};
3535
/// The main entry point to our analysis passes.
3636
///
3737
/// Set up the necessary data structures and run the analysis passes and call the actual passes.
38-
pub fn run_analysis<'a, 'tcx>(
39-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
40-
old: DefId,
41-
new: DefId,
42-
) -> ChangeSet<'tcx> {
38+
pub fn run_analysis<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, old: DefId, new: DefId) -> ChangeSet<'tcx> {
4339
let mut changes = ChangeSet::default();
4440
let mut id_mapping = IdMapping::new(old.krate, new.krate);
4541

@@ -78,7 +74,7 @@ fn get_vis(outer_vis: Visibility, def: Export<HirId>) -> Visibility {
7874
}
7975
}
8076

81-
pub fn run_traversal<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, new: DefId) {
77+
pub fn run_traversal<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, new: DefId) {
8278
use rustc::hir::def::DefKind::*;
8379
let mut visited = HashSet::new();
8480
let mut mod_queue = VecDeque::new();
@@ -125,10 +121,10 @@ pub fn run_traversal<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, new: DefId) {
125121
/// from the two crate versions and compare for changes. Matching children get processed
126122
/// in the same fashion.
127123
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cognitive_complexity))]
128-
fn diff_structure<'a, 'tcx>(
124+
fn diff_structure<'tcx>(
129125
changes: &mut ChangeSet,
130126
id_mapping: &mut IdMapping,
131-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
127+
tcx: TyCtxt<'tcx, 'tcx>,
132128
old: DefId,
133129
new: DefId,
134130
) {
@@ -362,7 +358,7 @@ fn diff_structure<'a, 'tcx>(
362358
}
363359

364360
/// Given two fn items, perform structural checks.
365-
fn diff_fn<'a, 'tcx>(changes: &mut ChangeSet, tcx: TyCtxt<'a, 'tcx, 'tcx>, old: Res, new: Res) {
361+
fn diff_fn<'tcx>(changes: &mut ChangeSet, tcx: TyCtxt<'tcx, 'tcx>, old: Res, new: Res) {
366362
let old_def_id = old.def_id();
367363
let new_def_id = new.def_id();
368364

@@ -381,9 +377,9 @@ fn diff_fn<'a, 'tcx>(changes: &mut ChangeSet, tcx: TyCtxt<'a, 'tcx, 'tcx>, old:
381377
}
382378

383379
/// Given two method items, perform structural checks.
384-
fn diff_method<'a, 'tcx>(
380+
fn diff_method<'tcx>(
385381
changes: &mut ChangeSet,
386-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
382+
tcx: TyCtxt<'tcx, 'tcx>,
387383
old: AssocItem,
388384
new: AssocItem,
389385
) {
@@ -562,10 +558,10 @@ fn diff_adts(changes: &mut ChangeSet, id_mapping: &mut IdMapping, tcx: TyCtxt, o
562558
///
563559
/// This establishes the needed correspondence between non-toplevel items found in the trait
564560
/// definition.
565-
fn diff_traits<'a, 'tcx>(
561+
fn diff_traits<'tcx>(
566562
changes: &mut ChangeSet,
567563
id_mapping: &mut IdMapping,
568-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
564+
tcx: TyCtxt<'tcx, 'tcx>,
569565
old: DefId,
570566
new: DefId,
571567
output: bool,
@@ -833,10 +829,10 @@ fn diff_generics(
833829
// of matching items are compared for changes.
834830

835831
/// Given two items, compare their types.
836-
fn diff_types<'a, 'tcx>(
832+
fn diff_types<'tcx>(
837833
changes: &mut ChangeSet<'tcx>,
838834
id_mapping: &IdMapping,
839-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
835+
tcx: TyCtxt<'tcx, 'tcx>,
840836
old: Res,
841837
new: Res,
842838
) {
@@ -902,10 +898,10 @@ fn diff_types<'a, 'tcx>(
902898
}
903899

904900
/// Compare two types and their trait bounds, possibly registering the resulting change.
905-
fn cmp_types<'a, 'tcx>(
901+
fn cmp_types<'tcx>(
906902
changes: &mut ChangeSet<'tcx>,
907903
id_mapping: &IdMapping,
908-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
904+
tcx: TyCtxt<'tcx, 'tcx>,
909905
orig_def_id: DefId,
910906
target_def_id: DefId,
911907
orig: Ty<'tcx>,
@@ -955,10 +951,10 @@ fn cmp_types<'a, 'tcx>(
955951
}
956952

957953
/// Compare the trait bounds of two items, possibly registering the resulting change.
958-
fn cmp_bounds<'a, 'tcx>(
954+
fn cmp_bounds<'tcx>(
959955
changes: &mut ChangeSet<'tcx>,
960956
id_mapping: &IdMapping,
961-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
957+
tcx: TyCtxt<'tcx, 'tcx>,
962958
orig_def_id: DefId,
963959
target_def_id: DefId,
964960
) {
@@ -988,10 +984,10 @@ fn cmp_bounds<'a, 'tcx>(
988984
// their trait bounds and compared for changes, if applicable.
989985

990986
/// Compare the inherent implementations of all matching items.
991-
fn diff_inherent_impls<'a, 'tcx>(
987+
fn diff_inherent_impls<'tcx>(
992988
changes: &mut ChangeSet<'tcx>,
993989
id_mapping: &IdMapping,
994-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
990+
tcx: TyCtxt<'tcx, 'tcx>,
995991
) {
996992
debug!("diffing inherent impls");
997993

@@ -1071,8 +1067,8 @@ fn diff_inherent_impls<'a, 'tcx>(
10711067
// from perfect and will cause false positives in some cases (see comment in the inner function).
10721068
#[allow(clippy::let_and_return)]
10731069
#[allow(clippy::match_same_arms)]
1074-
fn is_impl_trait_public<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_def_id: DefId) -> bool {
1075-
fn type_visibility<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty) -> Visibility {
1070+
fn is_impl_trait_public<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, impl_def_id: DefId) -> bool {
1071+
fn type_visibility<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, ty: Ty) -> Visibility {
10761072
match ty.sty {
10771073
TyKind::Adt(def, _) => tcx.visibility(def.did),
10781074

@@ -1112,10 +1108,10 @@ fn is_impl_trait_public<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_def_id: DefI
11121108
}
11131109

11141110
/// Compare the implementations of all matching traits.
1115-
fn diff_trait_impls<'a, 'tcx>(
1111+
fn diff_trait_impls<'tcx>(
11161112
changes: &mut ChangeSet<'tcx>,
11171113
id_mapping: &IdMapping,
1118-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
1114+
tcx: TyCtxt<'tcx, 'tcx>,
11191115
) {
11201116
debug!("diffing trait impls");
11211117

@@ -1165,10 +1161,10 @@ fn diff_trait_impls<'a, 'tcx>(
11651161

11661162
/// Compare an item pair in two inherent implementations and indicate whether the target one is
11671163
/// compatible with the original one.
1168-
fn match_inherent_impl<'a, 'tcx>(
1164+
fn match_inherent_impl<'tcx>(
11691165
changes: &mut ChangeSet<'tcx>,
11701166
id_mapping: &IdMapping,
1171-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
1167+
tcx: TyCtxt<'tcx, 'tcx>,
11721168
orig_impl_def_id: DefId,
11731169
target_impl_def_id: DefId,
11741170
orig_item: AssocItem,
@@ -1294,7 +1290,7 @@ fn match_inherent_impl<'a, 'tcx>(
12941290
/// Compare two implementations and indicate whether the target one is compatible with the
12951291
/// original one.
12961292
fn match_trait_impl<'a, 'tcx>(
1297-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
1293+
tcx: TyCtxt<'tcx, 'tcx>,
12981294
trans: &TranslationContext<'a, 'tcx, 'tcx>,
12991295
orig_def_id: DefId,
13001296
) -> bool {

Diff for: src/typeck.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ impl<'a, 'gcx, 'tcx> TypeComparisonContext<'a, 'gcx, 'tcx> {
201201
}
202202

203203
/// Check for type mismatches in a pair of items.
204-
pub fn check_type_error<'b, 'tcx2>(
204+
pub fn check_type_error<'tcx2>(
205205
&self,
206-
lift_tcx: TyCtxt<'b, 'tcx2, 'tcx2>,
206+
lift_tcx: TyCtxt<'tcx2, 'tcx2>,
207207
target_def_id: DefId,
208208
target_param_env: ParamEnv<'tcx>,
209209
orig: Ty<'tcx>,
@@ -258,9 +258,9 @@ impl<'a, 'gcx, 'tcx> TypeComparisonContext<'a, 'gcx, 'tcx> {
258258
}
259259

260260
/// Check for trait bound mismatches in a pair of items.
261-
pub fn check_bounds_error<'b, 'tcx2>(
261+
pub fn check_bounds_error<'tcx2>(
262262
&self,
263-
lift_tcx: TyCtxt<'b, 'tcx2, 'tcx2>,
263+
lift_tcx: TyCtxt<'tcx2, 'tcx2>,
264264
orig_param_env: ParamEnv<'tcx>,
265265
target_def_id: DefId,
266266
target_substs: SubstsRef<'tcx>,
@@ -289,10 +289,10 @@ impl<'a, 'gcx, 'tcx> TypeComparisonContext<'a, 'gcx, 'tcx> {
289289
}
290290

291291
/// Check the bounds on an item in both directions and register changes found.
292-
pub fn check_bounds_bidirectional<'b, 'tcx2>(
292+
pub fn check_bounds_bidirectional<'tcx2>(
293293
&self,
294294
changes: &mut ChangeSet<'tcx2>,
295-
lift_tcx: TyCtxt<'b, 'tcx2, 'tcx2>,
295+
lift_tcx: TyCtxt<'tcx2, 'tcx2>,
296296
orig_def_id: DefId,
297297
target_def_id: DefId,
298298
orig_substs: SubstsRef<'tcx>,

0 commit comments

Comments
 (0)