Skip to content

Commit 24ddd16

Browse files
committed
Auto merge of #61722 - eddyb:vowel-exclusion-zone, r=oli-obk
rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`. This first lifetime parameter of `TyCtxt` has been phantom for a while, thanks to @Zoxc, but was never removed, and I'm doing this now in preparation for removing the `'gcx`/`'tcx` split. I wasn't going to do this as a separate step, and instead start converting uses of `TyCtxt` to a single-lifetime alias of it (e.g. `type TyCx<'tcx> = TyCtxt<'tcx, 'tcx, 'tcx>;`) but it turns out (as @Zoxc rightly predicted) that there is far more fallout from not needing a lifetime for the first parameter of `TyCtxt`. That is, going from `TyCtxt<'a, 'gcx, 'tcx>` to `TyCtxt<'tcx, 'gcx, 'tcx>` (the first commit in this PR) has the largest amount of fallout out of all the changes we might make (because it can require removing the `'a` parameter of `struct`s containing `tcx: TyCtxt<'a, ...>`), and is the hardest to automate (because `'a` is used everywhere, not just with `TyCtxt`, unlike, say `'gcx, 'tcx` -> `'tcx`). So I'm submitting this now to get it out of the way and reduce further friction in the future. **EDIT**: for the `rustfmt` commit, I used rust-lang/rustfmt#1324 (comment), and manually filtered out some noise, like in #61735, but unlike that PR, there was also a weird bug to work around. It should be reviewed separately, and dropped if unwanted. cc @rust-lang/compiler r? @nikomatsakis
2 parents 3d7a1c9 + 4c98cb6 commit 24ddd16

File tree

317 files changed

+3873
-3828
lines changed

Some content is hidden

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

317 files changed

+3873
-3828
lines changed

src/librustc/cfg/construct.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::hir::{self, PatKind};
88
use crate::hir::def_id::DefId;
99

1010
struct CFGBuilder<'a, 'tcx: 'a> {
11-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
11+
tcx: TyCtxt<'tcx, 'tcx>,
1212
owner_def_id: DefId,
1313
tables: &'a ty::TypeckTables<'tcx>,
1414
graph: CFGGraph,
@@ -30,8 +30,7 @@ struct LoopScope {
3030
break_index: CFGIndex, // where to go on a `break`
3131
}
3232

33-
pub fn construct<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
34-
body: &hir::Body) -> CFG {
33+
pub fn construct<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, body: &hir::Body) -> CFG {
3534
let mut graph = graph::Graph::new();
3635
let entry = graph.add_node(CFGNodeData::Entry);
3736

src/librustc/cfg/graphviz.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode);
1212
pub type Edge<'a> = &'a cfg::CFGEdge;
1313

1414
pub struct LabelledCFG<'a, 'tcx: 'a> {
15-
pub tcx: TyCtxt<'a, 'tcx, 'tcx>,
15+
pub tcx: TyCtxt<'tcx, 'tcx>,
1616
pub cfg: &'a cfg::CFG,
1717
pub name: String,
1818
/// `labelled_edges` controls whether we emit labels on the edges

src/librustc/cfg/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ pub type CFGNode = graph::Node<CFGNodeData>;
4949
pub type CFGEdge = graph::Edge<CFGEdgeData>;
5050

5151
impl CFG {
52-
pub fn new<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
53-
body: &hir::Body) -> CFG {
52+
pub fn new<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, body: &hir::Body) -> CFG {
5453
construct::construct(tcx, body)
5554
}
5655

src/librustc/dep_graph/dep_node.rs

+29-28
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ macro_rules! define_dep_nodes {
204204
impl DepNode {
205205
#[allow(unreachable_code, non_snake_case)]
206206
#[inline(always)]
207-
pub fn new<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
207+
pub fn new<'a, 'gcx, 'tcx>(tcx: TyCtxt<'gcx, 'tcx>,
208208
dep: DepConstructor<'gcx>)
209209
-> DepNode
210210
where 'gcx: 'a + 'tcx,
@@ -307,7 +307,7 @@ macro_rules! define_dep_nodes {
307307
/// refers to something from the previous compilation session that
308308
/// has been removed.
309309
#[inline]
310-
pub fn extract_def_id(&self, tcx: TyCtxt<'_, '_, '_>) -> Option<DefId> {
310+
pub fn extract_def_id(&self, tcx: TyCtxt<'_, '_>) -> Option<DefId> {
311311
if self.kind.can_reconstruct_query_key() {
312312
let def_path_hash = DefPathHash(self.hash);
313313
tcx.def_path_hash_to_def_id.as_ref()?
@@ -400,7 +400,7 @@ impl DefPathHash {
400400

401401
impl DefId {
402402
#[inline(always)]
403-
pub fn to_dep_node(self, tcx: TyCtxt<'_, '_, '_>, kind: DepKind) -> DepNode {
403+
pub fn to_dep_node(self, tcx: TyCtxt<'_, '_>, kind: DepKind) -> DepNode {
404404
DepNode::from_def_path_hash(kind, tcx.def_path_hash(self))
405405
}
406406
}
@@ -442,49 +442,50 @@ rustc_dep_node_append!([define_dep_nodes!][ <'tcx>
442442
]);
443443

444444
pub trait RecoverKey<'tcx>: Sized {
445-
fn recover(tcx: TyCtxt<'_, 'tcx, 'tcx>, dep_node: &DepNode) -> Option<Self>;
445+
fn recover(tcx: TyCtxt<'tcx, 'tcx>, dep_node: &DepNode) -> Option<Self>;
446446
}
447447

448448
impl RecoverKey<'tcx> for CrateNum {
449-
fn recover(tcx: TyCtxt<'_, 'tcx, 'tcx>, dep_node: &DepNode) -> Option<Self> {
449+
fn recover(tcx: TyCtxt<'tcx, 'tcx>, dep_node: &DepNode) -> Option<Self> {
450450
dep_node.extract_def_id(tcx).map(|id| id.krate)
451451
}
452452
}
453453

454454
impl RecoverKey<'tcx> for DefId {
455-
fn recover(tcx: TyCtxt<'_, 'tcx, 'tcx>, dep_node: &DepNode) -> Option<Self> {
455+
fn recover(tcx: TyCtxt<'tcx, 'tcx>, dep_node: &DepNode) -> Option<Self> {
456456
dep_node.extract_def_id(tcx)
457457
}
458458
}
459459

460460
impl RecoverKey<'tcx> for DefIndex {
461-
fn recover(tcx: TyCtxt<'_, 'tcx, 'tcx>, dep_node: &DepNode) -> Option<Self> {
461+
fn recover(tcx: TyCtxt<'tcx, 'tcx>, dep_node: &DepNode) -> Option<Self> {
462462
dep_node.extract_def_id(tcx).map(|id| id.index)
463463
}
464464
}
465465

466-
trait DepNodeParams<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> : fmt::Debug {
466+
trait DepNodeParams<'gcx: 'tcx, 'tcx>: fmt::Debug {
467467
const CAN_RECONSTRUCT_QUERY_KEY: bool;
468468

469469
/// This method turns the parameters of a DepNodeConstructor into an opaque
470470
/// Fingerprint to be used in DepNode.
471471
/// Not all DepNodeParams support being turned into a Fingerprint (they
472472
/// don't need to if the corresponding DepNode is anonymous).
473-
fn to_fingerprint(&self, _: TyCtxt<'a, 'gcx, 'tcx>) -> Fingerprint {
473+
fn to_fingerprint(&self, _: TyCtxt<'gcx, 'tcx>) -> Fingerprint {
474474
panic!("Not implemented. Accidentally called on anonymous node?")
475475
}
476476

477-
fn to_debug_str(&self, _: TyCtxt<'a, 'gcx, 'tcx>) -> String {
477+
fn to_debug_str(&self, _: TyCtxt<'gcx, 'tcx>) -> String {
478478
format!("{:?}", self)
479479
}
480480
}
481481

482-
impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a, T> DepNodeParams<'a, 'gcx, 'tcx> for T
483-
where T: HashStable<StableHashingContext<'a>> + fmt::Debug
482+
impl<'gcx: 'tcx, 'tcx, T> DepNodeParams<'gcx, 'tcx> for T
483+
where
484+
T: HashStable<StableHashingContext<'tcx>> + fmt::Debug,
484485
{
485486
default const CAN_RECONSTRUCT_QUERY_KEY: bool = false;
486487

487-
default fn to_fingerprint(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Fingerprint {
488+
default fn to_fingerprint(&self, tcx: TyCtxt<'gcx, 'tcx>) -> Fingerprint {
488489
let mut hcx = tcx.create_stable_hashing_context();
489490
let mut hasher = StableHasher::new();
490491

@@ -493,58 +494,58 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a, T> DepNodeParams<'a, 'gcx, 'tcx> for T
493494
hasher.finish()
494495
}
495496

496-
default fn to_debug_str(&self, _: TyCtxt<'a, 'gcx, 'tcx>) -> String {
497+
default fn to_debug_str(&self, _: TyCtxt<'gcx, 'tcx>) -> String {
497498
format!("{:?}", *self)
498499
}
499500
}
500501

501-
impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for DefId {
502+
impl<'gcx: 'tcx, 'tcx> DepNodeParams<'gcx, 'tcx> for DefId {
502503
const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
503504

504-
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
505+
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_>) -> Fingerprint {
505506
tcx.def_path_hash(*self).0
506507
}
507508

508-
fn to_debug_str(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> String {
509+
fn to_debug_str(&self, tcx: TyCtxt<'gcx, 'tcx>) -> String {
509510
tcx.def_path_str(*self)
510511
}
511512
}
512513

513-
impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for DefIndex {
514+
impl<'gcx: 'tcx, 'tcx> DepNodeParams<'gcx, 'tcx> for DefIndex {
514515
const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
515516

516-
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
517+
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_>) -> Fingerprint {
517518
tcx.hir().definitions().def_path_hash(*self).0
518519
}
519520

520-
fn to_debug_str(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> String {
521+
fn to_debug_str(&self, tcx: TyCtxt<'gcx, 'tcx>) -> String {
521522
tcx.def_path_str(DefId::local(*self))
522523
}
523524
}
524525

525-
impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for CrateNum {
526+
impl<'gcx: 'tcx, 'tcx> DepNodeParams<'gcx, 'tcx> for CrateNum {
526527
const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
527528

528-
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
529+
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_>) -> Fingerprint {
529530
let def_id = DefId {
530531
krate: *self,
531532
index: CRATE_DEF_INDEX,
532533
};
533534
tcx.def_path_hash(def_id).0
534535
}
535536

536-
fn to_debug_str(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> String {
537+
fn to_debug_str(&self, tcx: TyCtxt<'gcx, 'tcx>) -> String {
537538
tcx.crate_name(*self).as_str().to_string()
538539
}
539540
}
540541

541-
impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId, DefId) {
542+
impl<'gcx: 'tcx, 'tcx> DepNodeParams<'gcx, 'tcx> for (DefId, DefId) {
542543
const CAN_RECONSTRUCT_QUERY_KEY: bool = false;
543544

544545
// We actually would not need to specialize the implementation of this
545546
// method but it's faster to combine the hashes than to instantiate a full
546547
// hashing context and stable-hashing state.
547-
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
548+
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_>) -> Fingerprint {
548549
let (def_id_0, def_id_1) = *self;
549550

550551
let def_path_hash_0 = tcx.def_path_hash(def_id_0);
@@ -553,7 +554,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId, De
553554
def_path_hash_0.0.combine(def_path_hash_1.0)
554555
}
555556

556-
fn to_debug_str(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> String {
557+
fn to_debug_str(&self, tcx: TyCtxt<'gcx, 'tcx>) -> String {
557558
let (def_id_0, def_id_1) = *self;
558559

559560
format!("({}, {})",
@@ -562,13 +563,13 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId, De
562563
}
563564
}
564565

565-
impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for HirId {
566+
impl<'gcx: 'tcx, 'tcx> DepNodeParams<'gcx, 'tcx> for HirId {
566567
const CAN_RECONSTRUCT_QUERY_KEY: bool = false;
567568

568569
// We actually would not need to specialize the implementation of this
569570
// method but it's faster to combine the hashes than to instantiate a full
570571
// hashing context and stable-hashing state.
571-
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
572+
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_>) -> Fingerprint {
572573
let HirId {
573574
owner,
574575
local_id,

src/librustc/dep_graph/graph.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ where
9090
}
9191

9292
impl DepGraph {
93-
9493
pub fn new(prev_graph: PreviousDepGraph,
9594
prev_work_products: FxHashMap<WorkProductId, WorkProduct>) -> DepGraph {
9695
let prev_graph_node_count = prev_graph.node_count();
@@ -558,8 +557,8 @@ impl DepGraph {
558557
/// a node index can be found for that node.
559558
pub fn try_mark_green_and_read(
560559
&self,
561-
tcx: TyCtxt<'_, '_, '_>,
562-
dep_node: &DepNode
560+
tcx: TyCtxt<'_, '_>,
561+
dep_node: &DepNode,
563562
) -> Option<(SerializedDepNodeIndex, DepNodeIndex)> {
564563
self.try_mark_green(tcx, dep_node).map(|(prev_index, dep_node_index)| {
565564
debug_assert!(self.is_green(&dep_node));
@@ -570,8 +569,8 @@ impl DepGraph {
570569

571570
pub fn try_mark_green(
572571
&self,
573-
tcx: TyCtxt<'_, '_, '_>,
574-
dep_node: &DepNode
572+
tcx: TyCtxt<'_, '_>,
573+
dep_node: &DepNode,
575574
) -> Option<(SerializedDepNodeIndex, DepNodeIndex)> {
576575
debug_assert!(!dep_node.kind.is_eval_always());
577576

@@ -604,10 +603,10 @@ impl DepGraph {
604603
/// Try to mark a dep-node which existed in the previous compilation session as green.
605604
fn try_mark_previous_green<'tcx>(
606605
&self,
607-
tcx: TyCtxt<'_, 'tcx, 'tcx>,
606+
tcx: TyCtxt<'tcx, 'tcx>,
608607
data: &DepGraphData,
609608
prev_dep_node_index: SerializedDepNodeIndex,
610-
dep_node: &DepNode
609+
dep_node: &DepNode,
611610
) -> Option<DepNodeIndex> {
612611
debug!("try_mark_previous_green({:?}) - BEGIN", dep_node);
613612

@@ -791,7 +790,7 @@ impl DepGraph {
791790
#[inline(never)]
792791
fn emit_diagnostics<'tcx>(
793792
&self,
794-
tcx: TyCtxt<'_, 'tcx, 'tcx>,
793+
tcx: TyCtxt<'tcx, 'tcx>,
795794
data: &DepGraphData,
796795
dep_node_index: DepNodeIndex,
797796
did_allocation: bool,
@@ -842,7 +841,7 @@ impl DepGraph {
842841
//
843842
// This method will only load queries that will end up in the disk cache.
844843
// Other queries will not be executed.
845-
pub fn exec_cache_promotions<'a, 'tcx>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>) {
844+
pub fn exec_cache_promotions<'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx>) {
846845
let green_nodes: Vec<DepNode> = {
847846
let data = self.data.as_ref().unwrap();
848847
data.colors.values.indices().filter_map(|prev_index| {

src/librustc/dep_graph/safe.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ impl DepGraphSafe for DefId {
3333

3434
/// The type context itself can be used to access all kinds of tracked
3535
/// state, but those accesses should always generate read events.
36-
impl<'a, 'gcx, 'tcx> DepGraphSafe for TyCtxt<'a, 'gcx, 'tcx> {
37-
}
36+
impl<'gcx, 'tcx> DepGraphSafe for TyCtxt<'gcx, 'tcx> {}
3837

3938
/// Tuples make it easy to build up state.
4039
impl<A, B> DepGraphSafe for (A, B)

src/librustc/hir/check_attr.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ impl Target {
8787
}
8888
}
8989

90-
struct CheckAttrVisitor<'a, 'tcx: 'a> {
91-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
90+
struct CheckAttrVisitor<'tcx> {
91+
tcx: TyCtxt<'tcx, 'tcx>,
9292
}
9393

94-
impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
94+
impl CheckAttrVisitor<'tcx> {
9595
/// Checks any attribute.
9696
fn check_attributes(&self, item: &hir::Item, target: Target) {
9797
if target == Target::Fn || target == Target::Const {
@@ -310,7 +310,7 @@ impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
310310
}
311311
}
312312

313-
impl<'a, 'tcx> Visitor<'tcx> for CheckAttrVisitor<'a, 'tcx> {
313+
impl Visitor<'tcx> for CheckAttrVisitor<'tcx> {
314314
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
315315
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
316316
}
@@ -347,7 +347,7 @@ fn is_c_like_enum(item: &hir::Item) -> bool {
347347
}
348348
}
349349

350-
fn check_mod_attrs<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>, module_def_id: DefId) {
350+
fn check_mod_attrs<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, module_def_id: DefId) {
351351
tcx.hir().visit_item_likes_in_module(
352352
module_def_id,
353353
&mut CheckAttrVisitor { tcx }.as_deep_visitor()

src/librustc/hir/def_id.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl DefId {
177177
LocalDefId::from_def_id(self)
178178
}
179179

180-
pub fn describe_as_module(&self, tcx: TyCtxt<'_, '_, '_>) -> String {
180+
pub fn describe_as_module(&self, tcx: TyCtxt<'_, '_>) -> String {
181181
if self.is_local() && self.index == CRATE_DEF_INDEX {
182182
format!("top-level module")
183183
} else {

src/librustc/hir/upvars.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl Visitor<'tcx> for LocalCollector {
5555
}
5656

5757
struct CaptureCollector<'a, 'tcx> {
58-
tcx: TyCtxt<'a, 'tcx, 'tcx>,
58+
tcx: TyCtxt<'tcx, 'tcx>,
5959
locals: &'a FxHashSet<HirId>,
6060
upvars: FxIndexMap<HirId, hir::Upvar>,
6161
}

src/librustc/ich/hcx.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ for &'b mut T {
205205
}
206206
}
207207

208-
impl<'a, 'gcx, 'lcx> StableHashingContextProvider<'a> for TyCtxt<'a, 'gcx, 'lcx> {
209-
fn get_stable_hashing_context(&self) -> StableHashingContext<'a> {
208+
impl StableHashingContextProvider<'lcx> for TyCtxt<'gcx, 'lcx> {
209+
fn get_stable_hashing_context(&self) -> StableHashingContext<'lcx> {
210210
(*self).create_stable_hashing_context()
211211
}
212212
}

src/librustc/infer/canonical/canonicalizer.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ impl CanonicalizeRegionMode for CanonicalizeFreeRegionsOtherThanStatic {
277277

278278
struct Canonicalizer<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
279279
infcx: Option<&'cx InferCtxt<'cx, 'gcx, 'tcx>>,
280-
tcx: TyCtxt<'cx, 'gcx, 'tcx>,
280+
tcx: TyCtxt<'gcx, 'tcx>,
281281
variables: SmallVec<[CanonicalVarInfo; 8]>,
282282
query_state: &'cx mut OriginalQueryValues<'tcx>,
283283
// Note that indices is only used once `var_values` is big enough to be
@@ -290,7 +290,7 @@ struct Canonicalizer<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
290290
}
291291

292292
impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx> {
293-
fn tcx<'b>(&'b self) -> TyCtxt<'b, 'gcx, 'tcx> {
293+
fn tcx<'b>(&'b self) -> TyCtxt<'gcx, 'tcx> {
294294
self.tcx
295295
}
296296

@@ -501,7 +501,7 @@ impl<'cx, 'gcx, 'tcx> Canonicalizer<'cx, 'gcx, 'tcx> {
501501
fn canonicalize<V>(
502502
value: &V,
503503
infcx: Option<&InferCtxt<'_, 'gcx, 'tcx>>,
504-
tcx: TyCtxt<'_, 'gcx, 'tcx>,
504+
tcx: TyCtxt<'gcx, 'tcx>,
505505
canonicalize_region_mode: &dyn CanonicalizeRegionMode,
506506
query_state: &mut OriginalQueryValues<'tcx>,
507507
) -> Canonicalized<'gcx, V>

src/librustc/infer/canonical/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ impl<'tcx> CanonicalVarValues<'tcx> {
478478
/// `self.var_values == [Type(u32), Lifetime('a), Type(u64)]`
479479
/// we'll return a substitution `subst` with:
480480
/// `subst.var_values == [Type(^0), Lifetime(^1), Type(^2)]`.
481-
pub fn make_identity<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Self {
481+
pub fn make_identity(&self, tcx: TyCtxt<'tcx, 'tcx>) -> Self {
482482
use crate::ty::subst::UnpackedKind;
483483

484484
CanonicalVarValues {

0 commit comments

Comments
 (0)