Skip to content

Commit 5b22d9b

Browse files
committedSep 30, 2018
don't elide lifetimes in paths in librustc/
This seemed like a good way to kick the tires on the elided-lifetimes-in-paths lint (rust-lang#52069)—seems to work! This was also pretty tedious—it sure would be nice if `cargo fix` worked on this codebase (rust-lang#53896)!
1 parent 6310be4 commit 5b22d9b

Some content is hidden

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

77 files changed

+557
-545
lines changed
 

‎src/librustc/dep_graph/dep_node.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ macro_rules! define_dep_nodes {
331331
/// refers to something from the previous compilation session that
332332
/// has been removed.
333333
#[inline]
334-
pub fn extract_def_id(&self, tcx: TyCtxt) -> Option<DefId> {
334+
pub fn extract_def_id(&self, tcx: TyCtxt<'_, '_, '_>) -> Option<DefId> {
335335
if self.kind.can_reconstruct_query_key() {
336336
let def_path_hash = DefPathHash(self.hash);
337337
tcx.def_path_hash_to_def_id.as_ref()?
@@ -386,7 +386,7 @@ macro_rules! define_dep_nodes {
386386
}
387387

388388
impl fmt::Debug for DepNode {
389-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
389+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
390390
write!(f, "{:?}", self.kind)?;
391391

392392
if !self.kind.has_params() && !self.kind.is_anon() {
@@ -424,7 +424,7 @@ impl DefPathHash {
424424

425425
impl DefId {
426426
#[inline]
427-
pub fn to_dep_node(self, tcx: TyCtxt, kind: DepKind) -> DepNode {
427+
pub fn to_dep_node(self, tcx: TyCtxt<'_, '_, '_>, kind: DepKind) -> DepNode {
428428
DepNode::from_def_path_hash(kind, tcx.def_path_hash(self))
429429
}
430430
}
@@ -714,7 +714,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a, T> DepNodeParams<'a, 'gcx, 'tcx> for T
714714
impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for DefId {
715715
const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
716716

717-
fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
717+
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
718718
tcx.def_path_hash(*self).0
719719
}
720720

@@ -726,7 +726,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for DefId {
726726
impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for DefIndex {
727727
const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
728728

729-
fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
729+
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
730730
tcx.hir.definitions().def_path_hash(*self).0
731731
}
732732

@@ -738,7 +738,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for DefIndex {
738738
impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for CrateNum {
739739
const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
740740

741-
fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
741+
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
742742
let def_id = DefId {
743743
krate: *self,
744744
index: CRATE_DEF_INDEX,
@@ -757,7 +757,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId, De
757757
// We actually would not need to specialize the implementation of this
758758
// method but it's faster to combine the hashes than to instantiate a full
759759
// hashing context and stable-hashing state.
760-
fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
760+
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
761761
let (def_id_0, def_id_1) = *self;
762762

763763
let def_path_hash_0 = tcx.def_path_hash(def_id_0);
@@ -781,7 +781,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for HirId {
781781
// We actually would not need to specialize the implementation of this
782782
// method but it's faster to combine the hashes than to instantiate a full
783783
// hashing context and stable-hashing state.
784-
fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
784+
fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
785785
let HirId {
786786
owner,
787787
local_id: ItemLocalId(local_id),

‎src/librustc/hir/def_id.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub enum CrateNum {
3636
}
3737

3838
impl ::std::fmt::Debug for CrateNum {
39-
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
39+
fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4040
match self {
4141
CrateNum::Index(id) => write!(fmt, "crate{}", id.private),
4242
CrateNum::Invalid => write!(fmt, "invalid crate"),
@@ -97,7 +97,7 @@ impl CrateNum {
9797
}
9898

9999
impl fmt::Display for CrateNum {
100-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
100+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
101101
match self {
102102
CrateNum::Index(id) => fmt::Display::fmt(&id.private, f),
103103
CrateNum::Invalid => write!(f, "invalid crate"),
@@ -132,7 +132,7 @@ pub struct DefIndex(u32);
132132
pub const CRATE_DEF_INDEX: DefIndex = DefIndex(0);
133133

134134
impl fmt::Debug for DefIndex {
135-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
135+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
136136
write!(f,
137137
"DefIndex({}:{})",
138138
self.address_space().index(),
@@ -224,7 +224,7 @@ pub struct DefId {
224224
}
225225

226226
impl fmt::Debug for DefId {
227-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
227+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
228228
write!(f, "DefId({:?}/{}:{}",
229229
self.krate.index(),
230230
self.index.address_space().index(),
@@ -288,7 +288,7 @@ impl LocalDefId {
288288
}
289289

290290
impl fmt::Debug for LocalDefId {
291-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
291+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
292292
self.to_def_id().fmt(f)
293293
}
294294
}

0 commit comments

Comments
 (0)