Skip to content

Commit 654d045

Browse files
committed
Fix lint findings in librustc_traits
1 parent 1526f7a commit 654d045

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

src/librustc_traits/chalk_context/program_clauses/builtin.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc::traits::{
44
ProgramClause,
55
ProgramClauseCategory,
66
};
7-
use rustc::ty;
7+
use rustc::ty::{self, Ty, TyCtxt};
88
use rustc::ty::subst::{Kind, InternalSubsts, Subst};
99
use rustc::hir;
1010
use rustc::hir::def_id::DefId;
@@ -15,8 +15,8 @@ use crate::generic_types;
1515
/// `Implemented(ty: Trait) :- Implemented(nested: Trait)...`
1616
/// where `Trait` is specified by `trait_def_id`.
1717
fn builtin_impl_clause(
18-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
19-
ty: ty::Ty<'tcx>,
18+
tcx: TyCtxt<'_, '_, 'tcx>,
19+
ty: Ty<'tcx>,
2020
nested: &[Kind<'tcx>],
2121
trait_def_id: DefId
2222
) -> ProgramClause<'tcx> {
@@ -43,10 +43,10 @@ fn builtin_impl_clause(
4343
}
4444

4545
crate fn assemble_builtin_unsize_impls<'tcx>(
46-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
46+
tcx: TyCtxt<'_, '_, 'tcx>,
4747
unsize_def_id: DefId,
48-
source: ty::Ty<'tcx>,
49-
target: ty::Ty<'tcx>,
48+
source: Ty<'tcx>,
49+
target: Ty<'tcx>,
5050
clauses: &mut Vec<Clause<'tcx>>
5151
) {
5252
match (&source.sty, &target.sty) {
@@ -119,12 +119,12 @@ crate fn assemble_builtin_unsize_impls<'tcx>(
119119
}
120120

121121
crate fn assemble_builtin_sized_impls<'tcx>(
122-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
122+
tcx: TyCtxt<'_, '_, 'tcx>,
123123
sized_def_id: DefId,
124-
ty: ty::Ty<'tcx>,
124+
ty: Ty<'tcx>,
125125
clauses: &mut Vec<Clause<'tcx>>
126126
) {
127-
let mut push_builtin_impl = |ty: ty::Ty<'tcx>, nested: &[Kind<'tcx>]| {
127+
let mut push_builtin_impl = |ty: Ty<'tcx>, nested: &[Kind<'tcx>]| {
128128
let clause = builtin_impl_clause(tcx, ty, nested, sized_def_id);
129129
// Bind innermost bound vars that may exist in `ty` and `nested`.
130130
clauses.push(Clause::ForAll(ty::Binder::bind(clause)));
@@ -223,12 +223,12 @@ crate fn assemble_builtin_sized_impls<'tcx>(
223223
}
224224

225225
crate fn assemble_builtin_copy_clone_impls<'tcx>(
226-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
226+
tcx: TyCtxt<'_, '_, 'tcx>,
227227
trait_def_id: DefId,
228-
ty: ty::Ty<'tcx>,
228+
ty: Ty<'tcx>,
229229
clauses: &mut Vec<Clause<'tcx>>
230230
) {
231-
let mut push_builtin_impl = |ty: ty::Ty<'tcx>, nested: &[Kind<'tcx>]| {
231+
let mut push_builtin_impl = |ty: Ty<'tcx>, nested: &[Kind<'tcx>]| {
232232
let clause = builtin_impl_clause(tcx, ty, nested, trait_def_id);
233233
// Bind innermost bound vars that may exist in `ty` and `nested`.
234234
clauses.push(Clause::ForAll(ty::Binder::bind(clause)));

src/librustc_traits/chalk_context/program_clauses/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc::traits::{
1010
ProgramClauseCategory,
1111
Environment,
1212
};
13-
use rustc::ty;
13+
use rustc::ty::{self, TyCtxt};
1414
use rustc::hir::def_id::DefId;
1515
use super::ChalkInferenceContext;
1616
use std::iter;
@@ -19,7 +19,7 @@ use self::primitive::*;
1919
use self::builtin::*;
2020

2121
fn assemble_clauses_from_impls<'tcx>(
22-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
22+
tcx: TyCtxt<'_, '_, 'tcx>,
2323
trait_def_id: DefId,
2424
clauses: &mut Vec<Clause<'tcx>>
2525
) {
@@ -33,7 +33,7 @@ fn assemble_clauses_from_impls<'tcx>(
3333
}
3434

3535
fn assemble_clauses_from_assoc_ty_values<'tcx>(
36-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
36+
tcx: TyCtxt<'_, '_, 'tcx>,
3737
trait_def_id: DefId,
3838
clauses: &mut Vec<Clause<'tcx>>
3939
) {

src/librustc_traits/chalk_context/program_clauses/primitive.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc::traits::{
77
ProgramClause,
88
ProgramClauseCategory,
99
};
10-
use rustc::ty;
10+
use rustc::ty::{self, TyCtxt};
1111
use rustc::hir;
1212
use rustc::hir::def_id::DefId;
1313
use rustc_target::spec::abi;
@@ -16,7 +16,7 @@ use crate::generic_types;
1616
use std::iter;
1717

1818
crate fn wf_clause_for_raw_ptr<'tcx>(
19-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
19+
tcx: TyCtxt<'_, '_, 'tcx>,
2020
mutbl: hir::Mutability
2121
) -> Clauses<'tcx> {
2222
let ptr_ty = generic_types::raw_ptr(tcx, mutbl);
@@ -33,7 +33,7 @@ crate fn wf_clause_for_raw_ptr<'tcx>(
3333
}
3434

3535
crate fn wf_clause_for_fn_ptr<'tcx>(
36-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
36+
tcx: TyCtxt<'_, '_, 'tcx>,
3737
arity_and_output: usize,
3838
variadic: bool,
3939
unsafety: hir::Unsafety,
@@ -53,7 +53,7 @@ crate fn wf_clause_for_fn_ptr<'tcx>(
5353
tcx.mk_clauses(iter::once(wf_clause))
5454
}
5555

56-
crate fn wf_clause_for_slice<'tcx>(tcx: ty::TyCtxt<'_, '_, 'tcx>) -> Clauses<'tcx> {
56+
crate fn wf_clause_for_slice<'tcx>(tcx: TyCtxt<'_, '_, 'tcx>) -> Clauses<'tcx> {
5757
let ty = generic_types::bound(tcx, 0);
5858
let slice_ty = tcx.mk_slice(ty);
5959

@@ -83,7 +83,7 @@ crate fn wf_clause_for_slice<'tcx>(tcx: ty::TyCtxt<'_, '_, 'tcx>) -> Clauses<'tc
8383
}
8484

8585
crate fn wf_clause_for_array<'tcx>(
86-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
86+
tcx: TyCtxt<'_, '_, 'tcx>,
8787
length: &'tcx ty::Const<'tcx>
8888
) -> Clauses<'tcx> {
8989
let ty = generic_types::bound(tcx, 0);
@@ -115,7 +115,7 @@ crate fn wf_clause_for_array<'tcx>(
115115
}
116116

117117
crate fn wf_clause_for_tuple<'tcx>(
118-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
118+
tcx: TyCtxt<'_, '_, 'tcx>,
119119
arity: usize
120120
) -> Clauses<'tcx> {
121121
let type_list = generic_types::type_list(tcx, arity);
@@ -159,7 +159,7 @@ crate fn wf_clause_for_tuple<'tcx>(
159159
}
160160

161161
crate fn wf_clause_for_ref<'tcx>(
162-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
162+
tcx: TyCtxt<'_, '_, 'tcx>,
163163
mutbl: hir::Mutability
164164
) -> Clauses<'tcx> {
165165
let region = tcx.mk_region(
@@ -186,7 +186,7 @@ crate fn wf_clause_for_ref<'tcx>(
186186
}
187187

188188
crate fn wf_clause_for_fn_def<'tcx>(
189-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
189+
tcx: TyCtxt<'_, '_, 'tcx>,
190190
def_id: DefId
191191
) -> Clauses<'tcx> {
192192
let fn_def = generic_types::fn_def(tcx, def_id);

src/librustc_traits/chalk_context/resolvent_ops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc::traits::{
1616
Environment,
1717
InEnvironment,
1818
};
19-
use rustc::ty::{self, Ty};
19+
use rustc::ty::{self, Ty, TyCtxt};
2020
use rustc::ty::subst::Kind;
2121
use rustc::ty::relate::{Relate, RelateResult, TypeRelation};
2222
use syntax_pos::DUMMY_SP;
@@ -169,7 +169,7 @@ impl AnswerSubstitutor<'cx, 'gcx, 'tcx> {
169169
}
170170

171171
impl TypeRelation<'cx, 'gcx, 'tcx> for AnswerSubstitutor<'cx, 'gcx, 'tcx> {
172-
fn tcx(&self) -> ty::TyCtxt<'cx, 'gcx, 'tcx> {
172+
fn tcx(&self) -> TyCtxt<'cx, 'gcx, 'tcx> {
173173
self.infcx.tcx
174174
}
175175

src/librustc_traits/generic_types.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc::hir;
66
use rustc::hir::def_id::DefId;
77
use rustc_target::spec::abi;
88

9-
crate fn bound(tcx: ty::TyCtxt<'_, '_, 'tcx>, index: u32) -> Ty<'tcx> {
9+
crate fn bound(tcx: TyCtxt<'_, '_, 'tcx>, index: u32) -> Ty<'tcx> {
1010
let ty = ty::Bound(
1111
ty::INNERMOST,
1212
ty::BoundVar::from_u32(index).into()
@@ -22,7 +22,7 @@ crate fn raw_ptr(tcx: TyCtxt<'_, '_, 'tcx>, mutbl: hir::Mutability) -> Ty<'tcx>
2222
}
2323

2424
crate fn fn_ptr(
25-
tcx: ty::TyCtxt<'_, '_, 'tcx>,
25+
tcx: TyCtxt<'_, '_, 'tcx>,
2626
arity_and_output: usize,
2727
c_variadic: bool,
2828
unsafety: hir::Unsafety,
@@ -44,7 +44,7 @@ crate fn fn_ptr(
4444
tcx.mk_fn_ptr(fn_sig)
4545
}
4646

47-
crate fn type_list(tcx: ty::TyCtxt<'_, '_, 'tcx>, arity: usize) -> SubstsRef<'tcx> {
47+
crate fn type_list(tcx: TyCtxt<'_, '_, 'tcx>, arity: usize) -> SubstsRef<'tcx> {
4848
tcx.mk_substs(
4949
(0..arity).into_iter()
5050
.map(|i| ty::BoundVar::from(i))
@@ -53,7 +53,7 @@ crate fn type_list(tcx: ty::TyCtxt<'_, '_, 'tcx>, arity: usize) -> SubstsRef<'tc
5353
)
5454
}
5555

56-
crate fn ref_ty(tcx: ty::TyCtxt<'_, '_, 'tcx>, mutbl: hir::Mutability) -> Ty<'tcx> {
56+
crate fn ref_ty(tcx: TyCtxt<'_, '_, 'tcx>, mutbl: hir::Mutability) -> Ty<'tcx> {
5757
let region = tcx.mk_region(
5858
ty::ReLateBound(ty::INNERMOST, ty::BoundRegion::BrAnon(0))
5959
);
@@ -64,17 +64,17 @@ crate fn ref_ty(tcx: ty::TyCtxt<'_, '_, 'tcx>, mutbl: hir::Mutability) -> Ty<'tc
6464
})
6565
}
6666

67-
crate fn fn_def(tcx: ty::TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
67+
crate fn fn_def(tcx: TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
6868
tcx.mk_ty(ty::FnDef(def_id, InternalSubsts::bound_vars_for_item(tcx, def_id)))
6969
}
7070

71-
crate fn closure(tcx: ty::TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
71+
crate fn closure(tcx: TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
7272
tcx.mk_closure(def_id, ty::ClosureSubsts {
7373
substs: InternalSubsts::bound_vars_for_item(tcx, def_id),
7474
})
7575
}
7676

77-
crate fn generator(tcx: ty::TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
77+
crate fn generator(tcx: TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
7878
tcx.mk_generator(def_id, ty::GeneratorSubsts {
7979
substs: InternalSubsts::bound_vars_for_item(tcx, def_id),
8080
}, hir::GeneratorMovability::Movable)

0 commit comments

Comments
 (0)