Skip to content

Commit 6d24cc4

Browse files
committed
---
yaml --- r: 227323 b: refs/heads/auto c: a264440 h: refs/heads/master i: 227321: ec72d93 227319: 2503756 v: v3
1 parent d25ae18 commit 6d24cc4

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 9c5cfea43da9b4e0372f240e01f58c977bd44d92
11+
refs/heads/auto: a264440ab0f498e1ab77b17d24c3d6988c721c27
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc/middle/outlives.rs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,28 @@ fn compute_components<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
161161
compute_components(infcx, ty, out);
162162
}
163163
}
164-
_ => {
165-
// for all other types, just constrain the regions and
166-
// keep walking to find any other types.
164+
165+
// Most types do not introduce any region binders, nor
166+
// involve any other subtle cases, and so the WF relation
167+
// simply constraints any regions referenced directly by
168+
// the type and then visits the types that are lexically
169+
// contained within. (The comments refer to relevant rules
170+
// from RFC1214.)
171+
ty::TyBool(..) | // OutlivesScalar
172+
ty::TyChar(..) | // OutlivesScalar
173+
ty::TyInt(..) | // OutlivesScalar
174+
ty::TyUint(..) | // OutlivesScalar
175+
ty::TyFloat(..) | // OutlivesScalar
176+
ty::TyEnum(..) | // OutlivesNominalType
177+
ty::TyStruct(..) | // OutlivesNominalType
178+
ty::TyBox(..) | // OutlivesNominalType (ish)
179+
ty::TyStr(..) | // OutlivesScalar (ish)
180+
ty::TyArray(..) | // ...
181+
ty::TySlice(..) | // ...
182+
ty::TyRawPtr(..) | // ...
183+
ty::TyRef(..) | // OutlivesReference
184+
ty::TyTuple(..) | // ...
185+
ty::TyError(..) => {
167186
push_region_constraints(out, ty.regions());
168187
}
169188
}
@@ -188,4 +207,3 @@ fn push_region_constraints<'tcx>(out: &mut Vec<Component<'tcx>>, regions: Vec<ty
188207
}
189208
}
190209
}
191-

0 commit comments

Comments
 (0)