Skip to content

Commit 6ae80cf

Browse files
committed
Remove needless lifetimes
1 parent 0477e07 commit 6ae80cf

File tree

19 files changed

+59
-59
lines changed

19 files changed

+59
-59
lines changed

src/librustc/cfg/construct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct LoopScope {
3030
break_index: CFGIndex, // where to go on a `break`
3131
}
3232

33-
pub fn construct<'tcx>(tcx: TyCtxt<'tcx>, body: &hir::Body) -> CFG {
33+
pub fn construct(tcx: TyCtxt<'_>, body: &hir::Body) -> CFG {
3434
let mut graph = graph::Graph::new();
3535
let entry = graph.add_node(CFGNodeData::Entry);
3636

src/librustc/cfg/mod.rs

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

5151
impl CFG {
52-
pub fn new<'tcx>(tcx: TyCtxt<'tcx>, body: &hir::Body) -> CFG {
52+
pub fn new(tcx: TyCtxt<'_>, body: &hir::Body) -> CFG {
5353
construct::construct(tcx, body)
5454
}
5555

src/librustc/dep_graph/graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ impl DepGraph {
841841
//
842842
// This method will only load queries that will end up in the disk cache.
843843
// Other queries will not be executed.
844-
pub fn exec_cache_promotions<'tcx>(&self, tcx: TyCtxt<'tcx>) {
844+
pub fn exec_cache_promotions(&self, tcx: TyCtxt<'_>) {
845845
let data = self.data.as_ref().unwrap();
846846
for prev_index in data.colors.values.indices() {
847847
match data.colors.get(prev_index) {

src/librustc_borrowck/borrowck/check_loans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
354354
cmt: &mc::cmt_<'tcx>,
355355
loan_region: ty::Region<'tcx>,
356356
borrow_span: Span) {
357-
pub fn borrow_of_local_data<'tcx>(cmt: &mc::cmt_<'tcx>) -> bool {
357+
pub fn borrow_of_local_data(cmt: &mc::cmt_<'_>) -> bool {
358358
match cmt.cat {
359359
// Borrows of static items is allowed
360360
Categorization::StaticItem => false,

src/librustc_borrowck/borrowck/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub struct LoanDataFlowOperator;
5353

5454
pub type LoanDataFlow<'tcx> = DataFlowContext<'tcx, LoanDataFlowOperator>;
5555

56-
pub fn check_crate<'tcx>(tcx: TyCtxt<'tcx>) {
56+
pub fn check_crate(tcx: TyCtxt<'_>) {
5757
tcx.par_body_owners(|body_owner_def_id| {
5858
tcx.ensure().borrowck(body_owner_def_id);
5959
});
@@ -73,7 +73,7 @@ pub struct AnalysisData<'tcx> {
7373
pub move_data: move_data::FlowedMoveData<'tcx>,
7474
}
7575

76-
fn borrowck<'tcx>(tcx: TyCtxt<'tcx>, owner_def_id: DefId) -> &'tcx BorrowCheckResult {
76+
fn borrowck(tcx: TyCtxt<'_>, owner_def_id: DefId) -> &BorrowCheckResult {
7777
assert!(tcx.use_ast_borrowck() || tcx.migrate_borrowck());
7878

7979
debug!("borrowck(body_owner_def_id={:?})", owner_def_id);

src/librustc_codegen_llvm/back/write.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ impl<'a> Drop for DiagnosticHandlers<'a> {
239239
}
240240
}
241241

242-
unsafe extern "C" fn report_inline_asm<'a, 'b>(cgcx: &'a CodegenContext<LlvmCodegenBackend>,
243-
msg: &'b str,
244-
cookie: c_uint) {
242+
unsafe extern "C" fn report_inline_asm(cgcx: &CodegenContext<LlvmCodegenBackend>,
243+
msg: &str,
244+
cookie: c_uint) {
245245
cgcx.diag_emitter.inline_asm_error(cookie as u32, msg.to_owned());
246246
}
247247

src/librustc_codegen_ssa/back/symbol_export.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ pub fn crates_export_threshold(crate_types: &[config::CrateType]) -> SymbolExpor
4646
}
4747
}
4848

49-
fn reachable_non_generics_provider<'tcx>(
50-
tcx: TyCtxt<'tcx>,
49+
fn reachable_non_generics_provider(
50+
tcx: TyCtxt<'_>,
5151
cnum: CrateNum,
52-
) -> &'tcx DefIdMap<SymbolExportLevel> {
52+
) -> &DefIdMap<SymbolExportLevel> {
5353
assert_eq!(cnum, LOCAL_CRATE);
5454

5555
if !tcx.sess.opts.output_types.should_codegen() {
@@ -157,7 +157,7 @@ fn reachable_non_generics_provider<'tcx>(
157157
tcx.arena.alloc(reachable_non_generics)
158158
}
159159

160-
fn is_reachable_non_generic_provider_local<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
160+
fn is_reachable_non_generic_provider_local(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
161161
let export_threshold = threshold(tcx);
162162

163163
if let Some(&level) = tcx.reachable_non_generics(def_id.krate).get(&def_id) {
@@ -167,14 +167,14 @@ fn is_reachable_non_generic_provider_local<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefI
167167
}
168168
}
169169

170-
fn is_reachable_non_generic_provider_extern<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
170+
fn is_reachable_non_generic_provider_extern(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
171171
tcx.reachable_non_generics(def_id.krate).contains_key(&def_id)
172172
}
173173

174-
fn exported_symbols_provider_local<'tcx>(
175-
tcx: TyCtxt<'tcx>,
174+
fn exported_symbols_provider_local(
175+
tcx: TyCtxt<'_>,
176176
cnum: CrateNum,
177-
) -> Arc<Vec<(ExportedSymbol<'tcx>, SymbolExportLevel)>> {
177+
) -> Arc<Vec<(ExportedSymbol<'_>, SymbolExportLevel)>> {
178178
assert_eq!(cnum, LOCAL_CRATE);
179179

180180
if !tcx.sess.opts.output_types.should_codegen() {
@@ -273,10 +273,10 @@ fn exported_symbols_provider_local<'tcx>(
273273
Arc::new(symbols)
274274
}
275275

276-
fn upstream_monomorphizations_provider<'tcx>(
277-
tcx: TyCtxt<'tcx>,
276+
fn upstream_monomorphizations_provider(
277+
tcx: TyCtxt<'_>,
278278
cnum: CrateNum,
279-
) -> &'tcx DefIdMap<FxHashMap<SubstsRef<'tcx>, CrateNum>> {
279+
) -> &DefIdMap<FxHashMap<SubstsRef<'_>, CrateNum>> {
280280
debug_assert!(cnum == LOCAL_CRATE);
281281

282282
let cnums = tcx.all_crate_nums(LOCAL_CRATE);
@@ -322,10 +322,10 @@ fn upstream_monomorphizations_provider<'tcx>(
322322
tcx.arena.alloc(instances)
323323
}
324324

325-
fn upstream_monomorphizations_for_provider<'tcx>(
326-
tcx: TyCtxt<'tcx>,
325+
fn upstream_monomorphizations_for_provider(
326+
tcx: TyCtxt<'_>,
327327
def_id: DefId,
328-
) -> Option<&'tcx FxHashMap<SubstsRef<'tcx>, CrateNum>> {
328+
) -> Option<&FxHashMap<SubstsRef<'_>, CrateNum>> {
329329
debug_assert!(!def_id.is_local());
330330
tcx.upstream_monomorphizations(LOCAL_CRATE).get(&def_id)
331331
}

src/librustc_codegen_ssa/debuginfo/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub enum FunctionDebugContext<D> {
1010
}
1111

1212
impl<D> FunctionDebugContext<D> {
13-
pub fn get_ref<'a>(&'a self, span: Span) -> &'a FunctionDebugContextData<D> {
13+
pub fn get_ref(&self, span: Span) -> &FunctionDebugContextData<D> {
1414
match *self {
1515
FunctionDebugContext::RegularContext(ref data) => data,
1616
FunctionDebugContext::DebugInfoDisabled => {

src/librustc_data_structures/graph/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ pub trait WithSuccessors: DirectedGraph
2626
where
2727
Self: for<'graph> GraphSuccessors<'graph, Item = <Self as DirectedGraph>::Node>,
2828
{
29-
fn successors<'graph>(
30-
&'graph self,
29+
fn successors(
30+
&self,
3131
node: Self::Node,
32-
) -> <Self as GraphSuccessors<'graph>>::Iter;
32+
) -> <Self as GraphSuccessors<'_>>::Iter;
3333

3434
fn depth_first_search(&self, from: Self::Node) -> iterate::DepthFirstSearch<'_, Self>
3535
where
@@ -48,10 +48,10 @@ pub trait WithPredecessors: DirectedGraph
4848
where
4949
Self: for<'graph> GraphPredecessors<'graph, Item = <Self as DirectedGraph>::Node>,
5050
{
51-
fn predecessors<'graph>(
52-
&'graph self,
51+
fn predecessors(
52+
&self,
5353
node: Self::Node,
54-
) -> <Self as GraphPredecessors<'graph>>::Iter;
54+
) -> <Self as GraphPredecessors<'_>>::Iter;
5555
}
5656

5757
pub trait GraphPredecessors<'graph> {

src/librustc_data_structures/graph/reference.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ impl<'graph, G: WithStartNode> WithStartNode for &'graph G {
1717
}
1818

1919
impl<'graph, G: WithSuccessors> WithSuccessors for &'graph G {
20-
fn successors<'iter>(&'iter self, node: Self::Node) -> <Self as GraphSuccessors<'iter>>::Iter {
20+
fn successors(&self, node: Self::Node) -> <Self as GraphSuccessors<'_>>::Iter {
2121
(**self).successors(node)
2222
}
2323
}
2424

2525
impl<'graph, G: WithPredecessors> WithPredecessors for &'graph G {
26-
fn predecessors<'iter>(&'iter self,
27-
node: Self::Node)
28-
-> <Self as GraphPredecessors<'iter>>::Iter {
26+
fn predecessors(&self,
27+
node: Self::Node)
28+
-> <Self as GraphPredecessors<'_>>::Iter {
2929
(**self).predecessors(node)
3030
}
3131
}

0 commit comments

Comments
 (0)