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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 16 additions & 10 deletions
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

Lines changed: 11 additions & 16 deletions
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

Lines changed: 2 additions & 3 deletions
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

Lines changed: 4 additions & 3 deletions
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

Lines changed: 2 additions & 3 deletions
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

Lines changed: 1 addition & 2 deletions
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

Lines changed: 5 additions & 6 deletions
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

Lines changed: 8 additions & 5 deletions
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

Lines changed: 12 additions & 10 deletions
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);

0 commit comments

Comments
 (0)