Skip to content

Commit afc39bb

Browse files
committed
Run rustfmt --file-lines ... for changes from previous commits.
1 parent f3f9d6d commit afc39bb

File tree

107 files changed

+813
-1159
lines changed

Some content is hidden

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

107 files changed

+813
-1159
lines changed

src/librustc/ich/impls_syntax.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,12 @@ fn stable_non_narrow_char(swc: ::syntax_pos::NonNarrowChar,
506506
(pos.0 - source_file_start.0, width as u32)
507507
}
508508

509-
510-
511509
impl<'tcx> HashStable<StableHashingContext<'tcx>> for feature_gate::Features {
512-
fn hash_stable<W: StableHasherResult>(&self,
513-
hcx: &mut StableHashingContext<'tcx>,
514-
hasher: &mut StableHasher<W>) {
510+
fn hash_stable<W: StableHasherResult>(
511+
&self,
512+
hcx: &mut StableHashingContext<'tcx>,
513+
hasher: &mut StableHasher<W>,
514+
) {
515515
// Unfortunately we cannot exhaustively list fields here, since the
516516
// struct is macro generated.
517517
self.declared_lang_features.hash_stable(hcx, hasher);

src/librustc/ich/impls_ty.rs

+16-10
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ use crate::middle::region;
1111
use crate::ty;
1212
use crate::mir;
1313

14-
impl<'a, 'tcx, T> HashStable<StableHashingContext<'a>>
15-
for &'tcx ty::List<T>
16-
where T: HashStable<StableHashingContext<'a>> {
14+
impl<'a, 'tcx, T> HashStable<StableHashingContext<'a>> for &'tcx ty::List<T>
15+
where
16+
T: HashStable<StableHashingContext<'a>>,
17+
{
1718
fn hash_stable<W: StableHasherResult>(&self,
1819
hcx: &mut StableHashingContext<'a>,
1920
hasher: &mut StableHasher<W>) {
@@ -41,7 +42,8 @@ for &'tcx ty::List<T>
4142
}
4243

4344
impl<'a, 'tcx, T> ToStableHashKey<StableHashingContext<'a>> for &'tcx ty::List<T>
44-
where T: HashStable<StableHashingContext<'a>>
45+
where
46+
T: HashStable<StableHashingContext<'a>>,
4547
{
4648
type KeyType = Fingerprint;
4749

@@ -119,18 +121,22 @@ impl<'a> HashStable<StableHashingContext<'a>> for ty::RegionVid {
119121

120122
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ty::ConstVid<'tcx> {
121123
#[inline]
122-
fn hash_stable<W: StableHasherResult>(&self,
123-
hcx: &mut StableHashingContext<'a>,
124-
hasher: &mut StableHasher<W>) {
124+
fn hash_stable<W: StableHasherResult>(
125+
&self,
126+
hcx: &mut StableHashingContext<'a>,
127+
hasher: &mut StableHasher<W>,
128+
) {
125129
self.index.hash_stable(hcx, hasher);
126130
}
127131
}
128132

129133
impl<'tcx> HashStable<StableHashingContext<'tcx>> for ty::BoundVar {
130134
#[inline]
131-
fn hash_stable<W: StableHasherResult>(&self,
132-
hcx: &mut StableHashingContext<'tcx>,
133-
hasher: &mut StableHasher<W>) {
135+
fn hash_stable<W: StableHasherResult>(
136+
&self,
137+
hcx: &mut StableHashingContext<'tcx>,
138+
hasher: &mut StableHasher<W>,
139+
) {
134140
self.index().hash_stable(hcx, hasher);
135141
}
136142
}

src/librustc/infer/at.rs

+11-16
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ pub struct Trace<'a, 'tcx: 'a> {
4444

4545
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
4646
#[inline]
47-
pub fn at(&'a self,
48-
cause: &'a ObligationCause<'tcx>,
49-
param_env: ty::ParamEnv<'tcx>)
50-
-> At<'a, 'tcx>
51-
{
47+
pub fn at(
48+
&'a self,
49+
cause: &'a ObligationCause<'tcx>,
50+
param_env: ty::ParamEnv<'tcx>,
51+
) -> At<'a, 'tcx> {
5252
At { infcx: self, cause, param_env }
5353
}
5454
}
@@ -186,24 +186,19 @@ impl<'a, 'tcx> At<'a, 'tcx> {
186186
/// error-reporting, but doesn't actually perform any operation
187187
/// yet (this is useful when you want to set the trace using
188188
/// distinct values from those you wish to operate upon).
189-
pub fn trace<T>(self,
190-
expected: T,
191-
actual: T)
192-
-> Trace<'a, 'tcx>
193-
where T: ToTrace<'tcx>
189+
pub fn trace<T>(self, expected: T, actual: T) -> Trace<'a, 'tcx>
190+
where
191+
T: ToTrace<'tcx>,
194192
{
195193
self.trace_exp(true, expected, actual)
196194
}
197195

198196
/// Like `trace`, but the expected value is determined by the
199197
/// boolean argument (if true, then the first argument `a` is the
200198
/// "expected" value).
201-
pub fn trace_exp<T>(self,
202-
a_is_expected: bool,
203-
a: T,
204-
b: T)
205-
-> Trace<'a, 'tcx>
206-
where T: ToTrace<'tcx>
199+
pub fn trace_exp<T>(self, a_is_expected: bool, a: T, b: T) -> Trace<'a, 'tcx>
200+
where
201+
T: ToTrace<'tcx>,
207202
{
208203
let trace = ToTrace::to_trace(self.cause, a_is_expected, a, b);
209204
Trace { at: self, trace: trace, a_is_expected }

src/librustc/infer/canonical/query_response.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
4949
pub fn enter_canonical_trait_query<K, R>(
5050
&mut self,
5151
canonical_key: &Canonical<'tcx, K>,
52-
operation: impl FnOnce(&InferCtxt<'_, 'tcx>, &mut dyn TraitEngine<'tcx>, K)
53-
-> Fallible<R>,
52+
operation: impl FnOnce(&InferCtxt<'_, 'tcx>, &mut dyn TraitEngine<'tcx>, K) -> Fallible<R>,
5453
) -> Fallible<CanonicalizedQueryResponse<'tcx, R>>
5554
where
5655
K: TypeFoldable<'tcx>,
@@ -126,7 +125,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
126125
pub fn make_query_response_ignoring_pending_obligations<T>(
127126
&self,
128127
inference_vars: CanonicalVarValues<'tcx>,
129-
answer: T
128+
answer: T,
130129
) -> Canonical<'tcx, QueryResponse<'tcx, <T as Lift<'tcx>>::Lifted>>
131130
where
132131
T: Debug + Lift<'tcx> + TypeFoldable<'tcx>,

src/librustc/infer/equate.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ pub struct Equate<'combine, 'infcx: 'combine, 'tcx: 'infcx> {
1717
}
1818

1919
impl<'combine, 'infcx, 'tcx> Equate<'combine, 'infcx, 'tcx> {
20-
pub fn new(fields: &'combine mut CombineFields<'infcx, 'tcx>, a_is_expected: bool)
21-
-> Equate<'combine, 'infcx, 'tcx>
22-
{
20+
pub fn new(
21+
fields: &'combine mut CombineFields<'infcx, 'tcx>,
22+
a_is_expected: bool,
23+
) -> Equate<'combine, 'infcx, 'tcx> {
2324
Equate { fields: fields, a_is_expected: a_is_expected }
2425
}
2526
}

src/librustc/infer/error_reporting/need_type_info.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ impl<'a, 'tcx> Visitor<'tcx> for FindLocalByTypeVisitor<'a, 'tcx> {
7474
}
7575
}
7676

77-
7877
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
7978
pub fn extract_type_name(
8079
&self,
@@ -102,7 +101,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
102101
&self,
103102
body_id: Option<hir::BodyId>,
104103
span: Span,
105-
ty: Ty<'tcx>
104+
ty: Ty<'tcx>,
106105
) -> DiagnosticBuilder<'tcx> {
107106
let ty = self.resolve_vars_if_possible(&ty);
108107
let name = self.extract_type_name(&ty, None);
@@ -229,7 +228,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
229228
pub fn need_type_info_err_in_generator(
230229
&self,
231230
span: Span,
232-
ty: Ty<'tcx>
231+
ty: Ty<'tcx>,
233232
) -> DiagnosticBuilder<'tcx> {
234233
let ty = self.resolve_vars_if_possible(&ty);
235234
let name = self.extract_type_name(&ty, None);

src/librustc/infer/freshen.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ pub struct TypeFreshener<'a, 'tcx: 'a> {
5050
}
5151

5252
impl<'a, 'tcx> TypeFreshener<'a, 'tcx> {
53-
pub fn new(infcx: &'a InferCtxt<'a, 'tcx>)
54-
-> TypeFreshener<'a, 'tcx> {
53+
pub fn new(infcx: &'a InferCtxt<'a, 'tcx>) -> TypeFreshener<'a, 'tcx> {
5554
TypeFreshener {
5655
infcx,
5756
ty_freshen_count: 0,

src/librustc/infer/glb.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ pub struct Glb<'combine, 'infcx: 'combine, 'tcx: 'infcx> {
1414
}
1515

1616
impl<'combine, 'infcx, 'tcx> Glb<'combine, 'infcx, 'tcx> {
17-
pub fn new(fields: &'combine mut CombineFields<'infcx, 'tcx>, a_is_expected: bool)
18-
-> Glb<'combine, 'infcx, 'tcx>
19-
{
17+
pub fn new(
18+
fields: &'combine mut CombineFields<'infcx, 'tcx>,
19+
a_is_expected: bool,
20+
) -> Glb<'combine, 'infcx, 'tcx> {
2021
Glb { fields: fields, a_is_expected: a_is_expected }
2122
}
2223
}
@@ -85,9 +86,7 @@ impl TypeRelation<'tcx> for Glb<'combine, 'infcx, 'tcx> {
8586
}
8687
}
8788

88-
impl<'combine, 'infcx, 'tcx> LatticeDir<'infcx, 'tcx>
89-
for Glb<'combine, 'infcx, 'tcx>
90-
{
89+
impl<'combine, 'infcx, 'tcx> LatticeDir<'infcx, 'tcx> for Glb<'combine, 'infcx, 'tcx> {
9190
fn infcx(&self) -> &'infcx InferCtxt<'infcx, 'tcx> {
9291
self.fields.infcx
9392
}

src/librustc/infer/lattice.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ pub trait LatticeDir<'f, 'tcx: 'f>: TypeRelation<'tcx> {
4141
fn relate_bound(&mut self, v: Ty<'tcx>, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, ()>;
4242
}
4343

44-
pub fn super_lattice_tys<'a, 'tcx, L>(this: &mut L,
45-
a: Ty<'tcx>,
46-
b: Ty<'tcx>)
47-
-> RelateResult<'tcx, Ty<'tcx>>
48-
where L: LatticeDir<'a, 'tcx>, 'tcx: 'a
44+
pub fn super_lattice_tys<'a, 'tcx, L>(
45+
this: &mut L,
46+
a: Ty<'tcx>,
47+
b: Ty<'tcx>,
48+
) -> RelateResult<'tcx, Ty<'tcx>>
49+
where
50+
L: LatticeDir<'a, 'tcx>,
51+
'tcx: 'a,
4952
{
5053
debug!("{}.lattice_tys({:?}, {:?})",
5154
this.tag(),

src/librustc/infer/lexical_region_resolve/graphviz.rs

+12-10
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ graphs will be printed. \n\
4646

4747
pub fn maybe_print_constraints_for<'a, 'tcx>(
4848
region_data: &RegionConstraintData<'tcx>,
49-
region_rels: &RegionRelations<'a, 'tcx>)
50-
{
49+
region_rels: &RegionRelations<'a, 'tcx>,
50+
) {
5151
let tcx = region_rels.tcx;
5252
let context = region_rels.context;
5353

@@ -127,10 +127,11 @@ enum Edge<'tcx> {
127127
}
128128

129129
impl<'a, 'tcx> ConstraintGraph<'a, 'tcx> {
130-
fn new(name: String,
131-
region_rels: &'a RegionRelations<'a, 'tcx>,
132-
map: &'a ConstraintMap<'tcx>)
133-
-> ConstraintGraph<'a, 'tcx> {
130+
fn new(
131+
name: String,
132+
region_rels: &'a RegionRelations<'a, 'tcx>,
133+
map: &'a ConstraintMap<'tcx>,
134+
) -> ConstraintGraph<'a, 'tcx> {
134135
let mut i = 0;
135136
let mut node_ids = FxHashMap::default();
136137
{
@@ -246,10 +247,11 @@ impl<'a, 'tcx> dot::GraphWalk<'a> for ConstraintGraph<'a, 'tcx> {
246247

247248
pub type ConstraintMap<'tcx> = BTreeMap<Constraint<'tcx>, SubregionOrigin<'tcx>>;
248249

249-
fn dump_region_data_to<'a, 'tcx>(region_rels: &RegionRelations<'a, 'tcx>,
250-
map: &ConstraintMap<'tcx>,
251-
path: &str)
252-
-> io::Result<()> {
250+
fn dump_region_data_to<'a, 'tcx>(
251+
region_rels: &RegionRelations<'a, 'tcx>,
252+
map: &ConstraintMap<'tcx>,
253+
path: &str,
254+
) -> io::Result<()> {
253255
debug!("dump_region_data map (len: {}) path: {}",
254256
map.len(),
255257
path);

src/librustc/infer/lexical_region_resolve/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ pub fn resolve<'tcx>(
3333
region_rels: &RegionRelations<'_, 'tcx>,
3434
var_infos: VarInfos,
3535
data: RegionConstraintData<'tcx>,
36-
) -> (
37-
LexicalRegionResolutions<'tcx>,
38-
Vec<RegionResolutionError<'tcx>>,
39-
) {
36+
) -> (LexicalRegionResolutions<'tcx>, Vec<RegionResolutionError<'tcx>>) {
4037
debug!("RegionConstraintData: resolve_regions()");
4138
let mut errors = vec![];
4239
let mut resolver = LexicalResolver {

src/librustc/infer/lub.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ pub struct Lub<'combine, 'infcx: 'combine, 'tcx: 'infcx> {
1414
}
1515

1616
impl<'combine, 'infcx, 'tcx> Lub<'combine, 'infcx, 'tcx> {
17-
pub fn new(fields: &'combine mut CombineFields<'infcx, 'tcx>, a_is_expected: bool)
18-
-> Lub<'combine, 'infcx, 'tcx>
19-
{
17+
pub fn new(
18+
fields: &'combine mut CombineFields<'infcx, 'tcx>,
19+
a_is_expected: bool,
20+
) -> Lub<'combine, 'infcx, 'tcx> {
2021
Lub { fields: fields, a_is_expected: a_is_expected }
2122
}
2223
}
@@ -85,9 +86,7 @@ impl TypeRelation<'tcx> for Lub<'combine, 'infcx, 'tcx> {
8586
}
8687
}
8788

88-
impl<'combine, 'infcx, 'tcx> LatticeDir<'infcx, 'tcx>
89-
for Lub<'combine, 'infcx, 'tcx>
90-
{
89+
impl<'combine, 'infcx, 'tcx> LatticeDir<'infcx, 'tcx> for Lub<'combine, 'infcx, 'tcx> {
9190
fn infcx(&self) -> &'infcx InferCtxt<'infcx, 'tcx> {
9291
self.fields.infcx
9392
}

src/librustc/infer/outlives/env.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,8 @@ impl<'a, 'tcx: 'a> OutlivesEnvironment<'tcx> {
190190
/// contain inference variables, it must be supplied, in which
191191
/// case we will register "givens" on the inference context. (See
192192
/// `RegionConstraintData`.)
193-
fn add_outlives_bounds<I>(
194-
&mut self,
195-
infcx: Option<&InferCtxt<'a, 'tcx>>,
196-
outlives_bounds: I,
197-
) where
193+
fn add_outlives_bounds<I>(&mut self, infcx: Option<&InferCtxt<'a, 'tcx>>, outlives_bounds: I)
194+
where
198195
I: IntoIterator<Item = OutlivesBound<'tcx>>,
199196
{
200197
// Record relationships such as `T:'x` that don't go into the

src/librustc/infer/resolve.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub struct UnresolvedTypeFinder<'a, 'tcx: 'a> {
105105
infcx: &'a InferCtxt<'a, 'tcx>,
106106

107107
/// Used to find the type parameter name and location for error reporting.
108-
pub first_unresolved: Option<(Ty<'tcx>,Option<Span>)>,
108+
pub first_unresolved: Option<(Ty<'tcx>, Option<Span>)>,
109109
}
110110

111111
impl<'a, 'tcx> UnresolvedTypeFinder<'a, 'tcx> {
@@ -157,9 +157,9 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for UnresolvedTypeFinder<'a, 'tcx> {
157157
/// Full type resolution replaces all type and region variables with
158158
/// their concrete results. If any variable cannot be replaced (never unified, etc)
159159
/// then an `Err` result is returned.
160-
pub fn fully_resolve<'a, 'tcx, T>(infcx: &InferCtxt<'a, 'tcx>,
161-
value: &T) -> FixupResult<'tcx, T>
162-
where T : TypeFoldable<'tcx>
160+
pub fn fully_resolve<'a, 'tcx, T>(infcx: &InferCtxt<'a, 'tcx>, value: &T) -> FixupResult<'tcx, T>
161+
where
162+
T: TypeFoldable<'tcx>,
163163
{
164164
let mut full_resolver = FullTypeResolver { infcx: infcx, err: None };
165165
let result = value.fold_with(&mut full_resolver);

src/librustc/infer/sub.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ pub struct Sub<'combine, 'infcx: 'combine, 'tcx: 'infcx> {
1717
}
1818

1919
impl<'combine, 'infcx, 'tcx> Sub<'combine, 'infcx, 'tcx> {
20-
pub fn new(f: &'combine mut CombineFields<'infcx, 'tcx>, a_is_expected: bool)
21-
-> Sub<'combine, 'infcx, 'tcx>
22-
{
20+
pub fn new(
21+
f: &'combine mut CombineFields<'infcx, 'tcx>,
22+
a_is_expected: bool,
23+
) -> Sub<'combine, 'infcx, 'tcx> {
2324
Sub { fields: f, a_is_expected: a_is_expected }
2425
}
2526

src/librustc/lint/context.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1456,10 +1456,7 @@ fn late_lint_pass_crate<'tcx, T: for<'a> LateLintPass<'a, 'tcx>>(tcx: TyCtxt<'tc
14561456
})
14571457
}
14581458

1459-
fn late_lint_crate<'tcx, T: for<'a> LateLintPass<'a, 'tcx>>(
1460-
tcx: TyCtxt<'tcx>,
1461-
builtin_lints: T,
1462-
) {
1459+
fn late_lint_crate<'tcx, T: for<'a> LateLintPass<'a, 'tcx>>(tcx: TyCtxt<'tcx>, builtin_lints: T) {
14631460
let mut passes = tcx.sess.lint_store.borrow().late_passes.lock().take().unwrap();
14641461

14651462
if !tcx.sess.opts.debugging_opts.no_interleave_lints {

src/librustc/middle/entry.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,7 @@ fn find_item(item: &Item, ctxt: &mut EntryContext<'_, '_>, at_root: bool) {
140140
}
141141
}
142142

143-
fn configure_main(
144-
tcx: TyCtxt<'_>,
145-
visitor: &EntryContext<'_, '_>,
146-
) -> Option<(DefId, EntryFnType)> {
143+
fn configure_main(tcx: TyCtxt<'_>, visitor: &EntryContext<'_, '_>) -> Option<(DefId, EntryFnType)> {
147144
if let Some((hir_id, _)) = visitor.start_fn {
148145
Some((tcx.hir().local_def_id_from_hir_id(hir_id), EntryFnType::Start))
149146
} else if let Some((hir_id, _)) = visitor.attr_main_fn {

src/librustc/middle/exported_symbols.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ impl<'tcx> ExportedSymbol<'tcx> {
5252
}
5353
}
5454

55-
pub fn compare_stable(
56-
&self,
57-
tcx: TyCtxt<'tcx>,
58-
other: &ExportedSymbol<'tcx>,
59-
) -> cmp::Ordering {
55+
pub fn compare_stable(&self, tcx: TyCtxt<'tcx>, other: &ExportedSymbol<'tcx>) -> cmp::Ordering {
6056
match *self {
6157
ExportedSymbol::NonGeneric(self_def_id) => match *other {
6258
ExportedSymbol::NonGeneric(other_def_id) => {

0 commit comments

Comments
 (0)